diff options
author | Tristan Gingold <tgingold@free.fr> | 2016-09-19 03:35:47 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2016-09-19 03:48:19 +0200 |
commit | 7252e42a10961a1243a0093905db00abbd1f95a9 (patch) | |
tree | c5df38f6970c880e9146cab2fc73b8e592780565 /src/types.ads | |
parent | 8c6e8db93f3ef85f7edf242d83c3e7e9af194636 (diff) | |
download | ghdl-7252e42a10961a1243a0093905db00abbd1f95a9.tar.gz ghdl-7252e42a10961a1243a0093905db00abbd1f95a9.tar.bz2 ghdl-7252e42a10961a1243a0093905db00abbd1f95a9.zip |
files_map: use unsigned type for source_ptr and location_type.
Diffstat (limited to 'src/types.ads')
-rw-r--r-- | src/types.ads | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/types.ads b/src/types.ads index db1e5bf70..343ca7fb1 100644 --- a/src/types.ads +++ b/src/types.ads @@ -85,26 +85,27 @@ package Types is -- *command-line*: used for identifiers from command line -- (eg: unit to elab) - -- Index into a file buffer. - type Source_Ptr is new Int32; + -- Index into a file buffer. + type Source_Ptr is new Uns32; - -- Lower boundary of any file buffer. + -- Valid bounds of any file buffer. Source_Ptr_Org : constant Source_Ptr := 0; + Source_Ptr_Last : constant Source_Ptr := Source_Ptr'Last - 1; -- Bad file buffer index (used to mark no line). - Source_Ptr_Bad : constant Source_Ptr := -1; - - -- This type contains everything necessary to get a file name, a line - -- number and a column number. - type Location_Type is new Nat32; - for Location_Type'Size use 32; - Location_Nil : constant Location_Type := 0; - No_Location : constant Location_Type := 0; + Source_Ptr_Bad : constant Source_Ptr := Source_Ptr'Last; -- Type of a file buffer. type File_Buffer is array (Source_Ptr range <>) of Character; type File_Buffer_Acc is access File_Buffer; + -- This type contains everything necessary to get a file name, a line + -- number and a column number. + type Location_Type is new Uns32; + for Location_Type'Size use 32; + Location_Nil : constant Location_Type := 0; + No_Location : constant Location_Type := 0; + -- PSL Node. type PSL_Node is new Int32; |