From 7252e42a10961a1243a0093905db00abbd1f95a9 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 19 Sep 2016 03:35:47 +0200 Subject: files_map: use unsigned type for source_ptr and location_type. --- src/types.ads | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'src/types.ads') 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; -- cgit v1.2.3