Commit bac865a2 by Arnaud Charlet

Code clenups.

From-SVN: r247193
parent 321c24f7
...@@ -2717,7 +2717,7 @@ package body Bindgen is ...@@ -2717,7 +2717,7 @@ package body Bindgen is
-- every file, then we could use the encoding of the initial specified -- every file, then we could use the encoding of the initial specified
-- file, but this information is passed only for potential main -- file, but this information is passed only for potential main
-- programs. We could fix this sometime, but it is a very minor point -- programs. We could fix this sometime, but it is a very minor point
-- (wide character default encoding for [Wide_[Wide_]Text_IO when there -- (wide character default encoding for [Wide_[Wide_]]Text_IO when there
-- is no main program). -- is no main program).
elsif No_Main_Subprogram then elsif No_Main_Subprogram then
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1998-2014, Free Software Foundation, Inc. -- -- Copyright (C) 1998-2016, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -1424,7 +1424,7 @@ procedure Gnatchop is ...@@ -1424,7 +1424,7 @@ procedure Gnatchop is
-- Test for presence of BOM -- Test for presence of BOM
Read_BOM (Buffer.all, BOM_Length, BOM, False); Read_BOM (Buffer.all, BOM_Length, BOM, XML_Support => False);
BOM_Present := BOM /= Unknown; BOM_Present := BOM /= Unknown;
-- Only chop those units that come from this file -- Only chop those units that come from this file
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 2011-2013, Free Software Foundation, Inc. -- -- Copyright (C) 2011-2016, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -186,6 +186,11 @@ package System.Dim.Mks is ...@@ -186,6 +186,11 @@ package System.Dim.Mks is
Ampere => -1, Ampere => -1,
others => 0); others => 0);
-- Note the type punning below. The Symbol is a single "ohm" character
-- encoded in UTF-8 (ce a9 in hexadecimal), but this file is not compiled
-- with -gnatW8, so we're treating the string literal as a two-character
-- String.
subtype Electric_Resistance is Mks_Type subtype Electric_Resistance is Mks_Type
with with
Dimension => (Symbol => "Ω", Dimension => (Symbol => "Ω",
......
...@@ -406,7 +406,7 @@ package body System.WCh_Cnv is ...@@ -406,7 +406,7 @@ package body System.WCh_Cnv is
when WCEM_Brackets => when WCEM_Brackets =>
-- Values in the range 0-255 are directly output. Note that there -- Values in the range 0-255 are directly output. Note that there
-- is some issue with [ (16#5B#] since this will cause confusion -- is an issue with [ (16#5B#) since this will cause confusion
-- if the resulting string is interpreted using brackets encoding. -- if the resulting string is interpreted using brackets encoding.
-- One possibility would be to always output [ as ["5B"] but in -- One possibility would be to always output [ as ["5B"] but in
......
...@@ -272,11 +272,13 @@ package body Sinput is ...@@ -272,11 +272,13 @@ package body Sinput is
Tst (J) := C; Tst (J) := C;
end loop; end loop;
Read_BOM (Tst, Len, BOM, False); Read_BOM (Tst, Len, BOM, XML_Support => False);
case BOM is case BOM is
when UTF8_All => when UTF8_All =>
Scan_Ptr := Scan_Ptr + Source_Ptr (Len); Scan_Ptr := Scan_Ptr + Source_Ptr (Len);
First_Non_Blank_Location := Scan_Ptr;
Current_Line_Start := Scan_Ptr;
Wide_Character_Encoding_Method := WCEM_UTF8; Wide_Character_Encoding_Method := WCEM_UTF8;
Upper_Half_Encoding := True; Upper_Half_Encoding := True;
......
...@@ -560,8 +560,8 @@ package Sinput is ...@@ -560,8 +560,8 @@ package Sinput is
-- the start of the current source. If the current source starts with a -- the start of the current source. If the current source starts with a
-- recognized BOM, then some flags such as Wide_Character_Encoding_Method -- recognized BOM, then some flags such as Wide_Character_Encoding_Method
-- are set accordingly, and the Scan_Ptr on return points past this BOM. -- are set accordingly, and the Scan_Ptr on return points past this BOM.
-- An error message is output and Unrecoverable_Error raised if a non- -- An error message is output and Unrecoverable_Error raised if an
-- recognized BOM is detected. The call has no effect if no BOM is found. -- unrecognized BOM is detected. The call has no effect if no BOM is found.
function Get_Column_Number (P : Source_Ptr) return Column_Number; function Get_Column_Number (P : Source_Ptr) return Column_Number;
-- The ones-origin column number of the specified Source_Ptr value is -- The ones-origin column number of the specified Source_Ptr value is
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2015, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2016, Free Software Foundation, Inc. --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -492,10 +492,13 @@ package body Styleg is ...@@ -492,10 +492,13 @@ package body Styleg is
-- Start of processing for Check_Comment -- Start of processing for Check_Comment
begin begin
-- Can never have a non-blank character preceding the first minus -- Can never have a non-blank character preceding the first minus.
-- The "+ 3" is to leave room for a possible byte order mark (BOM);
-- we want to avoid a warning for a comment at the start of the
-- file just after the BOM.
if Style_Check_Comments then if Style_Check_Comments then
if Scan_Ptr > Source_First (Current_Source_File) if Scan_Ptr > Source_First (Current_Source_File) + 3
and then Source (Scan_Ptr - 1) > ' ' and then Source (Scan_Ptr - 1) > ' '
then then
Error_Msg_S -- CODEFIX Error_Msg_S -- CODEFIX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment