Commit 448f2610 by Arnaud Charlet

usage.adb: Add line for switch -gnat05 (allow Ada 2005 extensions) Slight fix to...

	* usage.adb: Add line for switch -gnat05 (allow Ada 2005 extensions)
	Slight fix to documentation of -gnaty with no parameters

	* xr_tabls.ads: Add ??? comment for missing overall comment

	* xsinfo.adb: Make default file name be sinfo.h, since this is what
	we now use by default.

	* xsnames.adb: Adjust end of file test to look for five space followed
	by '#' instead of six spaces. The format of xsnames.adb was modified
	in the last update.

	* a-numeri.ads: Add reference to AI-388 for greek letter pi
	identifier.

	* clean.adb: Minor reformatting.

	* gnat1drv.adb, gnatfind.adb, gnatlink.adb, gnatmem.adb,
	gnatname.adb: Minor reformatting
	Add 2005 to copyright output when utility is run

	* csets.adb: Eliminate obsolete comment

	* debug.adb, g-socket.ads, i-cobol.adb: Minor reformatting throughout
	Update comments.

	* sem_eval.ads (Eval_Integer_Literal): Do not inline this, not useful.

From-SVN: r94825
parent f5da72ce
...@@ -23,9 +23,9 @@ pragma Pure (Numerics); ...@@ -23,9 +23,9 @@ pragma Pure (Numerics);
3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511; 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37511;
["03C0"] : constant := Pi; ["03C0"] : constant := Pi;
-- This is the greek letter Pi. Note that it is conforming to have this -- This is the greek letter Pi (for Ada 2005 AI-388). Note that it is
-- present even in Ada 95 mode, because there is no way for a normal mode -- conforming to have this present even in Ada 95 mode, because there is
-- Ada 95 program to reference this identifier in any case. -- no way for a normal mode Ada 95 program to reference this identifier.
e : constant := e : constant :=
2.71828_18284_59045_23536_02874_71352_66249_77572_47093_69996; 2.71828_18284_59045_23536_02874_71352_66249_77572_47093_69996;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2003-2004, Free Software Foundation, Inc. -- -- Copyright (C) 2003-2005, 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- --
...@@ -80,9 +80,9 @@ package body Clean is ...@@ -80,9 +80,9 @@ package body Clean is
-- files will be done. -- files will be done.
Do_Nothing : Boolean := False; Do_Nothing : Boolean := False;
-- Set to True when switch -n is specified. -- Set to True when switch -n is specified. When True, no file is deleted.
-- When True, no file is deleted. gnatclean only lists the files that -- gnatclean only lists the files that would have been deleted if the
-- would have been deleted if the switch -n had not been specified. -- switch -n had not been specified.
File_Deleted : Boolean := False; File_Deleted : Boolean := False;
-- Set to True if at least one file has been deleted -- Set to True if at least one file has been deleted
...@@ -151,7 +151,7 @@ package body Clean is ...@@ -151,7 +151,7 @@ package body Clean is
-- Extracts the first element from the Q -- Extracts the first element from the Q
Q_Front : Natural; Q_Front : Natural;
-- Points to the first valid element in the Q. -- Points to the first valid element in the Q
package Q is new Table.Table ( package Q is new Table.Table (
Table_Component_Type => File_Name_Type, Table_Component_Type => File_Name_Type,
...@@ -1041,7 +1041,7 @@ package body Clean is ...@@ -1041,7 +1041,7 @@ package body Clean is
if not Copyright_Displayed then if not Copyright_Displayed then
Copyright_Displayed := True; Copyright_Displayed := True;
Put_Line ("GNATCLEAN " & Gnatvsn.Gnat_Version_String Put_Line ("GNATCLEAN " & Gnatvsn.Gnat_Version_String
& " Copyright 2003-2004 Free Software Foundation, Inc."); & " Copyright 2003-2005 Free Software Foundation, Inc.");
end if; end if;
end Display_Copyright; end Display_Copyright;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2002, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005, 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- --
...@@ -1159,8 +1159,7 @@ package body Csets is ...@@ -1159,8 +1159,7 @@ package body Csets is
Identifier_Char ('[') := True; Identifier_Char ('[') := True;
-- Add entry for ESC if wide characters in use with a wide character -- Add entry for ESC if wide characters in use with a wide character
-- encoding method active that uses the ESC code for encoding. Also -- encoding method active that uses the ESC code for encoding.
-- add entry for left bracket to capture use of brackets notation.
if Identifier_Character_Set = 'w' if Identifier_Character_Set = 'w'
and then Wide_Character_Encoding_Method in WC_ESC_Encoding_Method and then Wide_Character_Encoding_Method in WC_ESC_Encoding_Method
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 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- --
...@@ -120,8 +120,6 @@ package body Debug is ...@@ -120,8 +120,6 @@ package body Debug is
-- d.y -- d.y
-- d.z -- d.z
-- d1 Error msgs have node numbers where possible -- d1 Error msgs have node numbers where possible
-- d2 Eliminate error flags in verbose form error messages -- d2 Eliminate error flags in verbose form error messages
-- d3 Dump bad node in Comperr on an abort -- d3 Dump bad node in Comperr on an abort
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1998-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1998-2005 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- --
...@@ -87,10 +87,8 @@ procedure Gnatfind is ...@@ -87,10 +87,8 @@ procedure Gnatfind is
when 'a' => when 'a' =>
if GNAT.Command_Line.Full_Switch = "a" then if GNAT.Command_Line.Full_Switch = "a" then
Read_Only := True; Read_Only := True;
elsif GNAT.Command_Line.Full_Switch = "aI" then elsif GNAT.Command_Line.Full_Switch = "aI" then
Osint.Add_Src_Search_Dir (GNAT.Command_Line.Parameter); Osint.Add_Src_Search_Dir (GNAT.Command_Line.Parameter);
else else
Osint.Add_Lib_Search_Dir (GNAT.Command_Line.Parameter); Osint.Add_Lib_Search_Dir (GNAT.Command_Line.Parameter);
end if; end if;
...@@ -117,7 +115,6 @@ procedure Gnatfind is ...@@ -117,7 +115,6 @@ procedure Gnatfind is
when 'n' => when 'n' =>
if GNAT.Command_Line.Full_Switch = "nostdinc" then if GNAT.Command_Line.Full_Switch = "nostdinc" then
Opt.No_Stdinc := True; Opt.No_Stdinc := True;
elsif GNAT.Command_Line.Full_Switch = "nostlib" then elsif GNAT.Command_Line.Full_Switch = "nostlib" then
Opt.No_Stdlib := True; Opt.No_Stdlib := True;
end if; end if;
...@@ -125,7 +122,6 @@ procedure Gnatfind is ...@@ -125,7 +122,6 @@ procedure Gnatfind is
when 'p' => when 'p' =>
declare declare
S : constant String := GNAT.Command_Line.Parameter; S : constant String := GNAT.Command_Line.Parameter;
begin begin
Prj_File_Length := S'Length; Prj_File_Length := S'Length;
Prj_File (1 .. Prj_File_Length) := S; Prj_File (1 .. Prj_File_Length) := S;
...@@ -241,7 +237,7 @@ procedure Gnatfind is ...@@ -241,7 +237,7 @@ procedure Gnatfind is
procedure Write_Usage is procedure Write_Usage is
begin begin
Put_Line ("GNATFIND " & Gnatvsn.Gnat_Version_String); Put_Line ("GNATFIND " & Gnatvsn.Gnat_Version_String);
Put_Line ("Copyright 1998-2004, Ada Core Technologies Inc."); Put_Line ("Copyright 1998-2005, Ada Core Technologies Inc.");
Put_Line ("Usage: gnatfind pattern[:sourcefile[:line[:column]]] " Put_Line ("Usage: gnatfind pattern[:sourcefile[:line[:column]]] "
& "[file1 file2 ...]"); & "[file1 file2 ...]");
New_Line; New_Line;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1996-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1996-2005 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- --
...@@ -172,28 +172,28 @@ procedure Gnatlink is ...@@ -172,28 +172,28 @@ procedure Gnatlink is
-- Set to True to force generation of a response file -- Set to True to force generation of a response file
function Base_Name (File_Name : in String) return String; function Base_Name (File_Name : in String) return String;
-- Return just the file name part without the extension (if present). -- Return just the file name part without the extension (if present)
procedure Delete (Name : in String); procedure Delete (Name : in String);
-- Wrapper to unlink as status is ignored by this application. -- Wrapper to unlink as status is ignored by this application
procedure Error_Msg (Message : in String); procedure Error_Msg (Message : in String);
-- Output the error or warning Message -- Output the error or warning Message
procedure Exit_With_Error (Error : in String); procedure Exit_With_Error (Error : in String);
-- Output Error and exit program with a fatal condition. -- Output Error and exit program with a fatal condition
procedure Process_Args; procedure Process_Args;
-- Go through all the arguments and build option tables. -- Go through all the arguments and build option tables
procedure Process_Binder_File (Name : in String); procedure Process_Binder_File (Name : in String);
-- Reads the binder file and extracts linker arguments. -- Reads the binder file and extracts linker arguments
procedure Write_Header; procedure Write_Header;
-- Show user the program name, version and copyright. -- Show user the program name, version and copyright
procedure Write_Usage; procedure Write_Usage;
-- Show user the program options. -- Show user the program options
--------------- ---------------
-- Base_Name -- -- Base_Name --
...@@ -514,7 +514,7 @@ procedure Gnatlink is ...@@ -514,7 +514,7 @@ procedure Gnatlink is
new String'(Arg); new String'(Arg);
end if; end if;
-- Pass to gcc for linking program. -- Pass to gcc for linking program
Gcc_Linker_Options.Increment_Last; Gcc_Linker_Options.Increment_Last;
Gcc_Linker_Options.Table Gcc_Linker_Options.Table
...@@ -639,10 +639,10 @@ procedure Gnatlink is ...@@ -639,10 +639,10 @@ procedure Gnatlink is
-- For call to Close -- For call to Close
GNAT_Static : Boolean := False; GNAT_Static : Boolean := False;
-- Save state of -static option. -- Save state of -static option
GNAT_Shared : Boolean := False; GNAT_Shared : Boolean := False;
-- Save state of -shared option. -- Save state of -shared option
Xlinker_Was_Previous : Boolean := False; Xlinker_Was_Previous : Boolean := False;
-- Indicate that "-Xlinker" was the option preceding the current -- Indicate that "-Xlinker" was the option preceding the current
...@@ -704,7 +704,7 @@ procedure Gnatlink is ...@@ -704,7 +704,7 @@ procedure Gnatlink is
-- terminator. -- terminator.
function Index (S, Pattern : String) return Natural; function Index (S, Pattern : String) return Natural;
-- Return the last occurrence of Pattern in S, or 0 if none. -- Return the last occurrence of Pattern in S, or 0 if none
function Is_Option_Present (Opt : in String) return Boolean; function Is_Option_Present (Opt : in String) return Boolean;
-- Return true if the option Opt is already present in -- Return true if the option Opt is already present in
...@@ -1279,7 +1279,7 @@ procedure Gnatlink is ...@@ -1279,7 +1279,7 @@ procedure Gnatlink is
Write_Str ("GNATLINK "); Write_Str ("GNATLINK ");
Write_Str (Gnat_Version_String); Write_Str (Gnat_Version_String);
Write_Eol; Write_Eol;
Write_Str ("Copyright 1995-2004 Free Software Foundation, Inc"); Write_Str ("Copyright 1995-2005 Free Software Foundation, Inc");
Write_Eol; Write_Eol;
end if; end if;
end Write_Header; end Write_Header;
...@@ -1663,7 +1663,7 @@ begin ...@@ -1663,7 +1663,7 @@ begin
end Bind_Step; end Bind_Step;
end if; end if;
-- Now, actually link the program. -- Now, actually link the program
-- Skip this step for now on the JVM since the Java interpreter will do -- Skip this step for now on the JVM since the Java interpreter will do
-- the actual link at run time. We might consider packing all class files -- the actual link at run time. We might consider packing all class files
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1997-2004, Ada Core Technologies, Inc. -- -- Copyright (C) 1997-2005, Ada Core Technologies, 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- --
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
-- The running my_prog will produce a file named gmem.out that will be -- The running my_prog will produce a file named gmem.out that will be
-- parsed by gnatmem. -- parsed by gnatmem.
-- - Record a reference to the allocated memory on each allocation call. -- - Record a reference to the allocated memory on each allocation call
-- - Suppress this reference on deallocation. -- - Suppress this reference on deallocation
-- - At the end of the program, remaining references are potential leaks. -- - At the end of the program, remaining references are potential leaks.
-- sort them out the best possible way in order to locate the root of -- sort them out the best possible way in order to locate the root of
...@@ -89,7 +89,7 @@ procedure Gnatmem is ...@@ -89,7 +89,7 @@ procedure Gnatmem is
-- These need comments, and should be on separate lines ??? -- These need comments, and should be on separate lines ???
function Read_Next return Storage_Elmt; function Read_Next return Storage_Elmt;
-- Reads next dynamic storage operation from the log file. -- Reads next dynamic storage operation from the log file
function Mem_Image (X : Storage_Count) return String; function Mem_Image (X : Storage_Count) return String;
-- X is a size in storage_element. Returns a value -- X is a size in storage_element. Returns a value
...@@ -233,7 +233,7 @@ procedure Gnatmem is ...@@ -233,7 +233,7 @@ procedure Gnatmem is
New_Line; New_Line;
Put ("GNATMEM "); Put ("GNATMEM ");
Put_Line (Gnat_Version_String); Put_Line (Gnat_Version_String);
Put_Line ("Copyright 1997-2004 Free Software Foundation, Inc."); Put_Line ("Copyright 1997-2005 Free Software Foundation, Inc.");
New_Line; New_Line;
Put_Line ("Usage: gnatmem switches [depth] exename"); Put_Line ("Usage: gnatmem switches [depth] exename");
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2001-2004 Free Software Foundation, Inc. -- -- Copyright (C) 2001-2005 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- --
...@@ -172,7 +172,7 @@ procedure Gnatname is ...@@ -172,7 +172,7 @@ procedure Gnatname is
Output.Write_Str ("GNATNAME "); Output.Write_Str ("GNATNAME ");
Output.Write_Line (Gnatvsn.Gnat_Version_String); Output.Write_Line (Gnatvsn.Gnat_Version_String);
Output.Write_Line Output.Write_Line
("Copyright 2001-2004 Free Software Foundation, Inc."); ("Copyright 2001-2005 Free Software Foundation, Inc.");
end if; end if;
end Output_Version; end Output_Version;
...@@ -231,7 +231,6 @@ procedure Gnatname is ...@@ -231,7 +231,6 @@ procedure Gnatname is
when 'v' => when 'v' =>
if Opt.Verbose_Mode then if Opt.Verbose_Mode then
Very_Verbose := True; Very_Verbose := True;
else else
Opt.Verbose_Mode := True; Opt.Verbose_Mode := True;
end if; end if;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 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- --
...@@ -107,8 +107,7 @@ package body Interfaces.COBOL is ...@@ -107,8 +107,7 @@ package body Interfaces.COBOL is
function To_Display function To_Display
(Item : Integer_64; (Item : Integer_64;
Format : Display_Format; Format : Display_Format;
Length : Natural) Length : Natural) return Numeric;
return Numeric;
-- This function converts the given integer value into display format, -- This function converts the given integer value into display format,
-- using the given format, with the length in bytes of the result given -- using the given format, with the length in bytes of the result given
-- by the last parameter. This is the non-generic implementation of -- by the last parameter. This is the non-generic implementation of
...@@ -118,8 +117,7 @@ package body Interfaces.COBOL is ...@@ -118,8 +117,7 @@ package body Interfaces.COBOL is
function To_Packed function To_Packed
(Item : Integer_64; (Item : Integer_64;
Format : Packed_Format; Format : Packed_Format;
Length : Natural) Length : Natural) return Packed_Decimal;
return Packed_Decimal;
-- This function converts the given integer value into packed format, -- This function converts the given integer value into packed format,
-- using the given format, with the length in digits of the result given -- using the given format, with the length in digits of the result given
-- by the last parameter. This is the non-generic implementation of -- by the last parameter. This is the non-generic implementation of
...@@ -128,15 +126,13 @@ package body Interfaces.COBOL is ...@@ -128,15 +126,13 @@ package body Interfaces.COBOL is
function Valid_Numeric function Valid_Numeric
(Item : Numeric; (Item : Numeric;
Format : Display_Format) Format : Display_Format) return Boolean;
return Boolean;
-- This is the non-generic implementation of Decimal_Conversions.Valid -- This is the non-generic implementation of Decimal_Conversions.Valid
-- for the display case. -- for the display case.
function Valid_Packed function Valid_Packed
(Item : Packed_Decimal; (Item : Packed_Decimal;
Format : Packed_Format) Format : Packed_Format) return Boolean;
return Boolean;
-- This is the non-generic implementation of Decimal_Conversions.Valid -- This is the non-generic implementation of Decimal_Conversions.Valid
-- for the packed case. -- for the packed case.
...@@ -146,8 +142,7 @@ package body Interfaces.COBOL is ...@@ -146,8 +142,7 @@ package body Interfaces.COBOL is
function Binary_To_Decimal function Binary_To_Decimal
(Item : Byte_Array; (Item : Byte_Array;
Format : Binary_Format) Format : Binary_Format) return Integer_64
return Integer_64
is is
Len : constant Natural := Item'Length; Len : constant Natural := Item'Length;
...@@ -229,8 +224,7 @@ package body Interfaces.COBOL is ...@@ -229,8 +224,7 @@ package body Interfaces.COBOL is
function Numeric_To_Decimal function Numeric_To_Decimal
(Item : Numeric; (Item : Numeric;
Format : Display_Format) Format : Display_Format) return Integer_64
return Integer_64
is is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
Sign : COBOL_Character := COBOL_Plus; Sign : COBOL_Character := COBOL_Plus;
...@@ -288,8 +282,7 @@ package body Interfaces.COBOL is ...@@ -288,8 +282,7 @@ package body Interfaces.COBOL is
function Packed_To_Decimal function Packed_To_Decimal
(Item : Packed_Decimal; (Item : Packed_Decimal;
Format : Packed_Format) Format : Packed_Format) return Integer_64
return Integer_64
is is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
Result : Integer_64 := 0; Result : Integer_64 := 0;
...@@ -449,8 +442,7 @@ package body Interfaces.COBOL is ...@@ -449,8 +442,7 @@ package body Interfaces.COBOL is
function To_Display function To_Display
(Item : Integer_64; (Item : Integer_64;
Format : Display_Format; Format : Display_Format;
Length : Natural) Length : Natural) return Numeric
return Numeric
is is
Result : Numeric (1 .. Length); Result : Numeric (1 .. Length);
Val : Integer_64 := Item; Val : Integer_64 := Item;
...@@ -560,8 +552,7 @@ package body Interfaces.COBOL is ...@@ -560,8 +552,7 @@ package body Interfaces.COBOL is
function To_Packed function To_Packed
(Item : Integer_64; (Item : Integer_64;
Format : Packed_Format; Format : Packed_Format;
Length : Natural) Length : Natural) return Packed_Decimal
return Packed_Decimal
is is
Result : Packed_Decimal (1 .. Length); Result : Packed_Decimal (1 .. Length);
Val : Integer_64; Val : Integer_64;
...@@ -628,8 +619,7 @@ package body Interfaces.COBOL is ...@@ -628,8 +619,7 @@ package body Interfaces.COBOL is
function Valid_Numeric function Valid_Numeric
(Item : Numeric; (Item : Numeric;
Format : Display_Format) Format : Display_Format) return Boolean
return Boolean
is is
begin begin
if Item'Length = 0 then if Item'Length = 0 then
...@@ -681,8 +671,7 @@ package body Interfaces.COBOL is ...@@ -681,8 +671,7 @@ package body Interfaces.COBOL is
function Valid_Packed function Valid_Packed
(Item : Packed_Decimal; (Item : Packed_Decimal;
Format : Packed_Format) Format : Packed_Format) return Boolean
return Boolean
is is
begin begin
case Packed_Representation is case Packed_Representation is
...@@ -720,17 +709,13 @@ package body Interfaces.COBOL is ...@@ -720,17 +709,13 @@ package body Interfaces.COBOL is
function Length (Format : Binary_Format) return Natural is function Length (Format : Binary_Format) return Natural is
pragma Warnings (Off, Format); pragma Warnings (Off, Format);
begin begin
if Num'Digits <= 2 then if Num'Digits <= 2 then
return 1; return 1;
elsif Num'Digits <= 4 then elsif Num'Digits <= 4 then
return 2; return 2;
elsif Num'Digits <= 9 then elsif Num'Digits <= 9 then
return 4; return 4;
else -- Num'Digits in 10 .. 18 else -- Num'Digits in 10 .. 18
return 8; return 8;
end if; end if;
...@@ -756,8 +741,7 @@ package body Interfaces.COBOL is ...@@ -756,8 +741,7 @@ package body Interfaces.COBOL is
-- Note that the tests here are all compile time checks -- Note that the tests here are all compile time checks
function Length function Length
(Format : Packed_Format) (Format : Packed_Format) return Natural
return Natural
is is
pragma Warnings (Off, Format); pragma Warnings (Off, Format);
...@@ -774,8 +758,7 @@ package body Interfaces.COBOL is ...@@ -774,8 +758,7 @@ package body Interfaces.COBOL is
function To_Binary function To_Binary
(Item : Num; (Item : Num;
Format : Binary_Format) Format : Binary_Format) return Byte_Array
return Byte_Array
is is
begin begin
-- Note: all these tests are compile time tests -- Note: all these tests are compile time tests
...@@ -824,7 +807,6 @@ package body Interfaces.COBOL is ...@@ -824,7 +807,6 @@ package body Interfaces.COBOL is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return Binary'Integer_Value (Item); return Binary'Integer_Value (Item);
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
...@@ -836,14 +818,11 @@ package body Interfaces.COBOL is ...@@ -836,14 +818,11 @@ package body Interfaces.COBOL is
function To_Decimal function To_Decimal
(Item : Byte_Array; (Item : Byte_Array;
Format : Binary_Format) Format : Binary_Format) return Num
return Num
is is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return Num'Fixed_Value (Binary_To_Decimal (Item, Format)); return Num'Fixed_Value (Binary_To_Decimal (Item, Format));
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
...@@ -855,10 +834,8 @@ package body Interfaces.COBOL is ...@@ -855,10 +834,8 @@ package body Interfaces.COBOL is
function To_Decimal (Item : Binary) return Num is function To_Decimal (Item : Binary) return Num is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return Num'Fixed_Value (Item); return Num'Fixed_Value (Item);
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
...@@ -889,10 +866,8 @@ package body Interfaces.COBOL is ...@@ -889,10 +866,8 @@ package body Interfaces.COBOL is
function To_Decimal (Item : Long_Binary) return Num is function To_Decimal (Item : Long_Binary) return Num is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return Num'Fixed_Value (Item); return Num'Fixed_Value (Item);
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
...@@ -904,14 +879,11 @@ package body Interfaces.COBOL is ...@@ -904,14 +879,11 @@ package body Interfaces.COBOL is
function To_Decimal function To_Decimal
(Item : Packed_Decimal; (Item : Packed_Decimal;
Format : Packed_Format) Format : Packed_Format) return Num
return Num
is is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return Num'Fixed_Value (Packed_To_Decimal (Item, Format)); return Num'Fixed_Value (Packed_To_Decimal (Item, Format));
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
...@@ -923,18 +895,15 @@ package body Interfaces.COBOL is ...@@ -923,18 +895,15 @@ package body Interfaces.COBOL is
function To_Display function To_Display
(Item : Num; (Item : Num;
Format : Display_Format) Format : Display_Format) return Numeric
return Numeric
is is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return return
To_Display To_Display
(Integer_64'Integer_Value (Item), (Integer_64'Integer_Value (Item),
Format, Format,
Length (Format)); Length (Format));
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
...@@ -946,10 +915,8 @@ package body Interfaces.COBOL is ...@@ -946,10 +915,8 @@ package body Interfaces.COBOL is
function To_Long_Binary (Item : Num) return Long_Binary is function To_Long_Binary (Item : Num) return Long_Binary is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return Long_Binary'Integer_Value (Item); return Long_Binary'Integer_Value (Item);
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
...@@ -961,18 +928,15 @@ package body Interfaces.COBOL is ...@@ -961,18 +928,15 @@ package body Interfaces.COBOL is
function To_Packed function To_Packed
(Item : Num; (Item : Num;
Format : Packed_Format) Format : Packed_Format) return Packed_Decimal
return Packed_Decimal
is is
pragma Unsuppress (Range_Check); pragma Unsuppress (Range_Check);
begin begin
return return
To_Packed To_Packed
(Integer_64'Integer_Value (Item), (Integer_64'Integer_Value (Item),
Format, Format,
Length (Format)); Length (Format));
exception exception
when Constraint_Error => when Constraint_Error =>
raise Conversion_Error; raise Conversion_Error;
...@@ -984,16 +948,13 @@ package body Interfaces.COBOL is ...@@ -984,16 +948,13 @@ package body Interfaces.COBOL is
function Valid function Valid
(Item : Byte_Array; (Item : Byte_Array;
Format : Binary_Format) Format : Binary_Format) return Boolean
return Boolean
is is
Val : Num; Val : Num;
pragma Unreferenced (Val); pragma Unreferenced (Val);
begin begin
Val := To_Decimal (Item, Format); Val := To_Decimal (Item, Format);
return True; return True;
exception exception
when Conversion_Error => when Conversion_Error =>
return False; return False;
...@@ -1005,8 +966,7 @@ package body Interfaces.COBOL is ...@@ -1005,8 +966,7 @@ package body Interfaces.COBOL is
function Valid function Valid
(Item : Numeric; (Item : Numeric;
Format : Display_Format) Format : Display_Format) return Boolean
return Boolean
is is
begin begin
return Valid_Numeric (Item, Format); return Valid_Numeric (Item, Format);
...@@ -1018,8 +978,7 @@ package body Interfaces.COBOL is ...@@ -1018,8 +978,7 @@ package body Interfaces.COBOL is
function Valid function Valid
(Item : Packed_Decimal; (Item : Packed_Decimal;
Format : Packed_Format) Format : Packed_Format) return Boolean
return Boolean
is is
begin begin
return Valid_Packed (Item, Format); return Valid_Packed (Item, Format);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1992-2004 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 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- --
...@@ -411,7 +411,6 @@ private ...@@ -411,7 +411,6 @@ private
pragma Inline (Eval_Character_Literal); pragma Inline (Eval_Character_Literal);
pragma Inline (Eval_Conditional_Expression); pragma Inline (Eval_Conditional_Expression);
pragma Inline (Eval_Indexed_Component); pragma Inline (Eval_Indexed_Component);
pragma Inline (Eval_Integer_Literal);
pragma Inline (Eval_Named_Integer); pragma Inline (Eval_Named_Integer);
pragma Inline (Eval_Named_Real); pragma Inline (Eval_Named_Real);
pragma Inline (Eval_Real_Literal); pragma Inline (Eval_Real_Literal);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2004, Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005, 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- --
...@@ -422,8 +422,7 @@ begin ...@@ -422,8 +422,7 @@ begin
-- Lines for -gnaty switch -- Lines for -gnaty switch
Write_Switch_Char ("y"); Write_Switch_Char ("y");
Write_Line ("Enable all style checks except 'o', indent=3"); Write_Line ("Enable default style checks (same as -gnaty3abcefhiklmnprst)");
Write_Switch_Char ("yxx"); Write_Switch_Char ("yxx");
Write_Line ("Enable selected style checks xx = list of parameters:"); Write_Line ("Enable selected style checks xx = list of parameters:");
Write_Line (" 1-9 check indentation"); Write_Line (" 1-9 check indentation");
...@@ -467,4 +466,9 @@ begin ...@@ -467,4 +466,9 @@ begin
Write_Switch_Char ("83"); Write_Switch_Char ("83");
Write_Line ("Enforce Ada 83 restrictions"); Write_Line ("Enforce Ada 83 restrictions");
-- Line for -gnat05 switch
Write_Switch_Char ("05");
Write_Line ("Allow Ada 2005 extensions");
end Usage; end Usage;
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- S p e c -- -- S p e c --
-- -- -- --
-- Copyright (C) 1998-2003 Free Software Foundation, Inc. -- -- Copyright (C) 1998-2005 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- --
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- We need comment here saying what this package is???
with GNAT.OS_Lib; with GNAT.OS_Lib;
package Xr_Tabls is package Xr_Tabls is
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 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- --
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
-- -- -- --
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
-- Program to construct C header file a-sinfo.h (C version of sinfo.ads spec, -- Program to construct C header file sinfo.h (C version of sinfo.ads spec,
-- for use by Gigi, contains all definitions and access functions, but does -- for use by Gigi, contains all definitions and access functions, but does
-- not contain set procedures, since Gigi never modifies the GNAT tree) -- not contain set procedures, since Gigi never modifies the GNAT tree)
...@@ -34,14 +34,14 @@ ...@@ -34,14 +34,14 @@
-- Output files: -- Output files:
-- a-sinfo.h Corresponding c header file -- sinfo.h Corresponding c header file
-- Note: this program assumes that sinfo.ads has passed the error checks -- Note: this program assumes that sinfo.ads has passed the error checks
-- which are carried out by the CSinfo utility, so it does not duplicate -- which are carried out by the CSinfo utility, so it does not duplicate
-- these checks and assumes the soruce is correct. -- these checks and assumes the soruce is correct.
-- An optional argument allows the specification of an output file name to -- An optional argument allows the specification of an output file name to
-- override the default a-sinfo.h file name for the generated output file. -- override the default sinfo.h file name for the generated output file.
with Ada.Command_Line; use Ada.Command_Line; with Ada.Command_Line; use Ada.Command_Line;
with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
...@@ -118,7 +118,7 @@ begin ...@@ -118,7 +118,7 @@ begin
if Argument_Count > 0 then if Argument_Count > 0 then
Create (Ofile, Out_File, Argument (1)); Create (Ofile, Out_File, Argument (1));
else else
Create (Ofile, Out_File, "a-sinfo.h"); Create (Ofile, Out_File, "sinfo.h");
end if; end if;
Open (InS, In_File, "sinfo.ads"); Open (InS, In_File, "sinfo.ads");
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 1992-2002 Free Software Foundation, Inc. -- -- Copyright (C) 1992-2005 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- --
...@@ -138,7 +138,7 @@ begin ...@@ -138,7 +138,7 @@ begin
loop loop
Line := Get_Line (InB); Line := Get_Line (InB);
exit when Match (Line, " ""#"";"); exit when Match (Line, " ""#"";");
end loop; end loop;
Put_Line (OutB, Line); Put_Line (OutB, Line);
......
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