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