* sem_ch5.adb (Analyze_Loop_Parameter_Specification): Do not freeze
the loop variable while preanalyzing a quantified expression.
2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
* a-calend.adb (Split, Time_Of): Rename parameter Is_Ada_05
to Use_TZ to better illustrate its function. Update all
references to the parameter.
(To_Ada_Time): Update the call to Formatting_Operations.Time_Of.
* a-calend.ads (Split, Time_Of): Rename parameter Is_Ada_05
to Use_TZ to better illustrate its function. Update the related
comment on usage.
* a-calend-vms.adb (Split, Time_Of): Rename parameter
Is_Ada_05 to Use_TZ to better illustrate its function. Update
all references to the parameter.
(To_Ada_Time): Update the call to Formatting_Operations.Time_Of.
* a-calend-vms.ads (Split, Time_Of): Rename parameter Is_Ada_05
to Use_TZ to better illustrate its function. Update the related
comment on usage.
* a-calfor.adb (Split, Time_Of): Update the call to
Formatting_Operations.Time_Of.
* sysdep.c (__gnat_localtime_tzoff): Dereference pointer
"is_historic" and rewrite the check as a comparison. Add a
comment on flag values.
2012-04-26 Robert Dewar <dewar@adacore.com>
* exp_ch2.adb, sem_ch8.adb: Minor reformatting.
2012-04-26 Vasiliy Fofanov <fofanov@adacore.com>
* a-stzunb-shared.adb, gnat_ugn.texi, a-strunb-shared.adb,
a-strunb-shared.ads, uintp.adb, a-stwiun-shared.adb,
a-stwiun-shared.ads, a-cbhama.ads, vms_data.ads, a-cobove.adb,
a-convec.adb, sem_ch13.adb, a-cbhase.ads: Fix common misuses of the
word "then" where "than" should be used in English.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@186871
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * sem_ch5.adb (Analyze_Loop_Parameter_Specification): Do not freeze
+ the loop variable while preanalyzing a quantified expression.
+
+2012-04-26 Hristian Kirtchev <kirtchev@adacore.com>
+
+ * a-calend.adb (Split, Time_Of): Rename parameter Is_Ada_05
+ to Use_TZ to better illustrate its function. Update all
+ references to the parameter.
+ (To_Ada_Time): Update the call to Formatting_Operations.Time_Of.
+ * a-calend.ads (Split, Time_Of): Rename parameter Is_Ada_05
+ to Use_TZ to better illustrate its function. Update the related
+ comment on usage.
+ * a-calend-vms.adb (Split, Time_Of): Rename parameter
+ Is_Ada_05 to Use_TZ to better illustrate its function. Update
+ all references to the parameter.
+ (To_Ada_Time): Update the call to Formatting_Operations.Time_Of.
+ * a-calend-vms.ads (Split, Time_Of): Rename parameter Is_Ada_05
+ to Use_TZ to better illustrate its function. Update the related
+ comment on usage.
+ * a-calfor.adb (Split, Time_Of): Update the call to
+ Formatting_Operations.Time_Of.
+ * sysdep.c (__gnat_localtime_tzoff): Dereference pointer
+ "is_historic" and rewrite the check as a comparison. Add a
+ comment on flag values.
+
+2012-04-26 Robert Dewar <dewar@adacore.com>
+
+ * exp_ch2.adb, sem_ch8.adb: Minor reformatting.
+
+2012-04-26 Vasiliy Fofanov <fofanov@adacore.com>
+
+ * a-stzunb-shared.adb, gnat_ugn.texi, a-strunb-shared.adb,
+ a-strunb-shared.ads, uintp.adb, a-stwiun-shared.adb,
+ a-stwiun-shared.ads, a-cbhama.ads, vms_data.ads, a-cobove.adb,
+ a-convec.adb, sem_ch13.adb, a-cbhase.ads: Fix common misuses of the
+ word "then" where "than" should be used in English.
+
2012-04-26 Robert Dewar <dewar@adacore.com>
* sem_ch5.adb (Check_Unreachable_Code): Skip past pragmas.
Le : Boolean;
begin
- -- Use UTC as the local time zone on VMS, the status of flag Is_Ada_05
- -- is irrelevant in this case.
+ -- Use UTC as the local time zone on VMS, the status of flag Use_TZ is
+ -- irrelevant in this case.
Formatting_Operations.Split
(Date => Date,
Second => Se,
Sub_Sec => Ss,
Leap_Sec => Le,
- Is_Ada_05 => False,
+ Use_TZ => False,
Time_Zone => 0);
-- Validity checks
raise Time_Error;
end if;
- -- Use UTC as the local time zone on VMS, the status of flag Is_Ada_05
- -- is irrelevant in this case.
+ -- Use UTC as the local time zone on VMS, the status of flag Use_TZ is
+ -- irrelevant in this case.
return
Formatting_Operations.Time_Of
Sub_Sec => Ss,
Leap_Sec => False,
Use_Day_Secs => True,
- Is_Ada_05 => False,
+ Use_TZ => False,
Time_Zone => 0);
end Time_Of;
Sub_Sec => 0.0, -- No precise sub second given
Leap_Sec => Leap,
Use_Day_Secs => False, -- Time is given in h:m:s
- Is_Ada_05 => True, -- Force usage of explicit time zone
+ Use_TZ => True, -- Force usage of explicit time zone
Time_Zone => 0)); -- Place the value in UTC
-- Step 4: Daylight Savings Time
Second : out Integer;
Sub_Sec : out Duration;
Leap_Sec : out Boolean;
- Is_Ada_05 : Boolean;
+ Use_TZ : Boolean;
Time_Zone : Long_Integer)
is
- -- The flag Is_Ada_05 is present for interfacing purposes
+ -- The flag Use_TZ is present for interfacing purposes
- pragma Unreferenced (Is_Ada_05);
+ pragma Unreferenced (Use_TZ);
procedure Numtim
(Status : out Unsigned_Longword;
Sub_Sec : Duration;
Leap_Sec : Boolean := False;
Use_Day_Secs : Boolean := False;
- Is_Ada_05 : Boolean := False;
+ Use_TZ : Boolean := False;
Time_Zone : Long_Integer := 0) return Time
is
procedure Cvt_Vectim
Rounded_Res_M := Res_M - (Res_M mod Mili);
- if Is_Ada_05
+ if Use_TZ
and then Leap_Sec
and then Rounded_Res_M /= Next_Leap_M
then
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2009, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
Second : out Integer;
Sub_Sec : out Duration;
Leap_Sec : out Boolean;
- Is_Ada_05 : Boolean;
+ Use_TZ : Boolean;
Time_Zone : Long_Integer);
- -- Split a time value into its components. Set Is_Ada_05 to use the
- -- local time zone (the value in Time_Zone is ignored) when splitting
- -- a time value.
+ -- Split a time value into its components. Set Use_TZ to use the local
+ -- time zone (the value in Time_Zone is ignored) when splitting a time
+ -- value.
function Time_Of
(Year : Year_Number;
Sub_Sec : Duration;
Leap_Sec : Boolean := False;
Use_Day_Secs : Boolean := False;
- Is_Ada_05 : Boolean := False;
+ Use_TZ : Boolean := False;
Time_Zone : Long_Integer := 0) return Time;
-- Given all the components of a date, return the corresponding time
-- value. Set Use_Day_Secs to use the value in Day_Secs, otherwise the
-- day duration will be calculated from Hour, Minute, Second and Sub_
- -- Sec. Set Is_Ada_05 to use the local time zone (the value in formal
+ -- Sec. Set Use_TZ to use the local time zone (the value in formal
-- Time_Zone is ignored) when building a time value and to verify the
-- validity of a requested leap second.
pragma Unreferenced (H, M, Se, Ss, Le);
begin
- -- Even though the input time zone is UTC (0), the flag Is_Ada_05 will
+ -- Even though the input time zone is UTC (0), the flag Use_TZ will
-- ensure that Split picks up the local time zone.
Formatting_Operations.Split
Second => Se,
Sub_Sec => Ss,
Leap_Sec => Le,
- Is_Ada_05 => False,
+ Use_TZ => False,
Time_Zone => 0);
-- Validity checks
raise Time_Error;
end if;
- -- Even though the input time zone is UTC (0), the flag Is_Ada_05 will
+ -- Even though the input time zone is UTC (0), the flag Use_TZ will
-- ensure that Split picks up the local time zone.
return
Sub_Sec => Ss,
Leap_Sec => False,
Use_Day_Secs => True,
- Is_Ada_05 => False,
+ Use_TZ => False,
Time_Zone => 0);
end Time_Of;
Secs_T := time_t (Date_N / Nano);
- -- Determine whether to treat the input date as historical or not
+ -- Determine whether to treat the input date as historical or not. A
+ -- value of "0" signifies that the date is NOT historic.
Flag := (if Is_Historic then 1 else 0);
Sub_Sec => 0.0, -- No precise sub second given
Leap_Sec => Leap,
Use_Day_Secs => False, -- Time is given in h:m:s
- Is_Ada_05 => True, -- Force usage of explicit time zone
+ Use_TZ => True, -- Force usage of explicit time zone
Time_Zone => 0)); -- Place the value in UTC
-- Step 4: Daylight Savings Time
Second : out Integer;
Sub_Sec : out Duration;
Leap_Sec : out Boolean;
- Is_Ada_05 : Boolean;
+ Use_TZ : Boolean;
Time_Zone : Long_Integer)
is
-- The following constants represent the number of nanoseconds
-- Step 2: Time zone processing. This action converts the input date
-- from GMT to the requested time zone. Applies from Ada 2005 on.
- if Is_Ada_05 then
+ if Use_TZ then
if Time_Zone /= 0 then
Date_N := Date_N + Time_Rep (Time_Zone) * 60 * Nano;
end if;
Sub_Sec : Duration;
Leap_Sec : Boolean := False;
Use_Day_Secs : Boolean := False;
- Is_Ada_05 : Boolean := False;
+ Use_TZ : Boolean := False;
Time_Zone : Long_Integer := 0) return Time
is
Count : Integer;
-- a uniform representation which can be treated by arithmetic
-- operations for instance without any additional corrections.
- if Is_Ada_05 then
+ if Use_TZ then
if Time_Zone /= 0 then
Res_N := Res_N - Time_Rep (Time_Zone) * 60 * Nano;
end if;
Rounded_Res_N := Res_N - (Res_N mod Nano);
- if Is_Ada_05
+ if Use_TZ
and then Leap_Sec
and then Rounded_Res_N /= Next_Leap_N
then
Second : out Integer;
Sub_Sec : out Duration;
Leap_Sec : out Boolean;
- Is_Ada_05 : Boolean;
+ Use_TZ : Boolean;
Time_Zone : Long_Integer);
- -- Split a time value into its components. Set Is_Ada_05 to use the
- -- local time zone (the value in Time_Zone is ignored) when splitting
- -- a time value.
+ -- Split a time value into its components. Set Use_TZ to use the local
+ -- time zone (the value in Time_Zone is ignored) when splitting a time
+ -- value.
function Time_Of
(Year : Year_Number;
Sub_Sec : Duration;
Leap_Sec : Boolean := False;
Use_Day_Secs : Boolean := False;
- Is_Ada_05 : Boolean := False;
+ Use_TZ : Boolean := False;
Time_Zone : Long_Integer := 0) return Time;
-- Given all the components of a date, return the corresponding time
-- value. Set Use_Day_Secs to use the value in Day_Secs, otherwise the
-- day duration will be calculated from Hour, Minute, Second and Sub_
- -- Sec. Set Is_Ada_05 to use the local time zone (the value in formal
+ -- Sec. Set Use_TZ to use the local time zone (the value in formal
-- Time_Zone is ignored) when building a time value and to verify the
-- validity of a requested leap second.
-- --
-- B o d y --
-- --
--- Copyright (C) 2006-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 2006-2012, 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- --
Second => Se,
Sub_Sec => Su,
Leap_Sec => Leap_Second,
- Time_Zone => Tz,
- Is_Ada_05 => True);
+ Use_TZ => True,
+ Time_Zone => Tz);
-- Validity checks
Second => Second,
Sub_Sec => Sub_Second,
Leap_Sec => Le,
- Time_Zone => Tz,
- Is_Ada_05 => True);
+ Use_TZ => True,
+ Time_Zone => Tz);
-- Validity checks
Second => Second,
Sub_Sec => Sub_Second,
Leap_Sec => Leap_Second,
- Time_Zone => Tz,
- Is_Ada_05 => True);
+ Use_TZ => True,
+ Time_Zone => Tz);
-- Validity checks
Sub_Sec => Ss,
Leap_Sec => Leap_Second,
Use_Day_Secs => True,
- Is_Ada_05 => True,
+ Use_TZ => True,
Time_Zone => Tz);
end Time_Of;
Sub_Sec => Sub_Second,
Leap_Sec => Leap_Second,
Use_Day_Secs => False,
- Is_Ada_05 => True,
+ Use_TZ => True,
Time_Zone => Tz);
end Time_Of;
procedure Assign (Target : in out Map; Source : Map);
-- If Target denotes the same object as Source, then the operation has no
- -- effect. If the Target capacity is less then the Source length, then
+ -- effect. If the Target capacity is less than the Source length, then
-- Assign raises Capacity_Error. Otherwise, Assign clears Target and then
-- copies the (active) elements from Source to Target.
procedure Assign (Target : in out Set; Source : Set);
-- If Target denotes the same object as Source, then the operation has no
- -- effect. If the Target capacity is less then the Source length, then
+ -- effect. If the Target capacity is less than the Source length, then
-- Assign raises Capacity_Error. Otherwise, Assign clears Target and then
-- copies the (active) elements from Source to Target.
begin
-- Set_Length allows the user to set the length explicitly, instead of
-- implicitly as a side-effect of deletion or insertion. If the
- -- requested length is less then the current length, this is equivalent
+ -- requested length is less than the current length, this is equivalent
-- to deleting items from the back end of the vector. If the requested
-- length is greater than the current length, then this is equivalent to
-- inserting "space" (nonce items) at the end.
begin
-- Set_Length allows the user to set the length explicitly, instead
-- of implicitly as a side-effect of deletion or insertion. If the
- -- requested length is less then the current length, this is equivalent
+ -- requested length is less than the current length, this is equivalent
-- to deleting items from the back end of the vector. If the requested
-- length is greater than the current length, then this is equivalent
-- to inserting "space" (nonce items) at the end.
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
if Count < SR.Last then
DR.Data (1 .. Count) := SR.Data (1 .. Count);
- -- Length of the source string is less then requested, copy all
+ -- Length of the source string is less than requested, copy all
-- contents and fill others by Pad character.
else
else
DR := Allocate (Count);
- -- Length of the source string is greater then requested, copy
+ -- Length of the source string is greater than requested, copy
-- corresponding slice.
if Count < SR.Last then
DR.Data (1 .. Count) := SR.Data (1 .. Count);
- -- Length of the source string is less the requested, copy all
+ -- Length of the source string is less than requested, copy all
-- existing data and fill remaining positions with Pad characters.
else
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- reallocation when all of the following requirements are met:
-- - the shared data object is no longer used by anyone else;
-- - the size is sufficient to store the new value;
- -- - the gap after reuse is less then a defined threshold.
+ -- - the gap after reuse is less than a defined threshold.
-- - Memory preallocation. Most of used memory allocation algorithms
-- align allocated segments on the some boundary, thus some amount of
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
if Count < SR.Last then
DR.Data (1 .. Count) := SR.Data (1 .. Count);
- -- Length of the source string is less then requested, copy all
+ -- Length of the source string is less than requested, copy all
-- contents and fill others by Pad character.
else
else
DR := Allocate (Count);
- -- Length of the source string is greater then requested, copy
+ -- Length of the source string is greater than requested, copy
-- corresponding slice.
if Count < SR.Last then
DR.Data (1 .. Count) := SR.Data (1 .. Count);
- -- Length of the source string is less the requested, copy all
+ -- Length of the source string is less than requested, copy all
-- exists data and fill others by Pad character.
else
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
-- reallocation when all of the following requirements are meat:
-- - shared data object don't used anywhere longer;
-- - its size is sufficient to store new value;
- -- - the gap after reuse is less then some threshold.
+ -- - the gap after reuse is less than some threshold.
-- - memory preallocation. Most of used memory allocation algorithms
-- aligns allocated segment on the some boundary, thus some amount of
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2011, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
if Count < SR.Last then
DR.Data (1 .. Count) := SR.Data (1 .. Count);
- -- Length of the source string is less then requested, copy all
+ -- Length of the source string is less than requested, copy all
-- contents and fill others by Pad character.
else
else
DR := Allocate (Count);
- -- Length of the source string is greater then requested, copy
+ -- Length of the source string is greater than requested, copy
-- corresponding slice.
if Count < SR.Last then
DR.Data (1 .. Count) := SR.Data (1 .. Count);
- -- Length of the source string is less the requested, copy all
+ -- Length of the source string is less than requested, copy all
-- exists data and fill others by Pad character.
else
-- typ!(recobj).rec.all'Constrained
-- where rec is a selector whose Entry_Formal link points to the formal
+
-- If the type of the entry parameter has a representation clause, then an
-- extra temp is involved (see below).
+
-- For a formal of a task entity, the formal is rewritten as a local
-- renaming.
@cindex @option{^--no-separate-is^/NO_SEPARATE_IS^} (@command{gnatpp})
@item ^--no-separate-is^/NO_SEPARATE_IS^
Do not place the keyword @code{is} on a separate line in a subprogram body in
-case if the spec occupies more then one line.
+case if the spec occupies more than one line.
@cindex @option{^--separate-label^/SEPARATE_LABEL^} (@command{gnatpp})
@item ^--separate-label^/SEPARATE_LABEL^
Indentation level for continuation lines (relative to the line being
continued), @var{nnn} from 1@dots{}9.
The default
-value is one less then the (normal) indentation level, unless the
+value is one less than the (normal) indentation level, unless the
indentation is set to 1 (in which case the default value for continuation
line indentation is also 1)
@end table
elsif Small > Delta_Value (U_Ent) then
Error_Msg_N
- ("small value must not be greater then delta value", Nam);
+ ("small value must not be greater than delta value", Nam);
else
Set_Small_Value (U_Ent, Small);
Generate_Reference (Base_Type (Etype (DS)), N, ' ');
Set_Is_Known_Valid (Id, True);
- -- The loop is not a declarative part, so the only entity declared
- -- "within" must be frozen explicitly.
+ -- The loop is not a declarative part, so the loop variable must be
+ -- frozen explicitly. Do not freeze while preanalyzing a quantified
+ -- expression because the freeze node will not be inserted into the
+ -- tree due to flag Is_Spec_Expression being set.
- declare
- Flist : constant List_Id := Freeze_Entity (Id, N);
- begin
- if Is_Non_Empty_List (Flist) then
- Insert_Actions (N, Flist);
- end if;
- end;
+ if Nkind (Parent (N)) /= N_Quantified_Expression then
+ declare
+ Flist : constant List_Id := Freeze_Entity (Id, N);
+ begin
+ if Is_Non_Empty_List (Flist) then
+ Insert_Actions (N, Flist);
+ end if;
+ end;
+ end if;
-- Check for null or possibly null range and issue warning. We suppress
-- such messages in generic templates and instances, because in practice
declare
Spec : constant Node_Id :=
Parent (List_Containing (Parent (Id)));
- begin
+ begin
-- Check whether type is declared in a package specification,
-- and current unit is the corresponding package body. The
-- use clauses themselves may be within a nested package.
return
Nkind (Spec) = N_Package_Specification
- and then
- In_Same_Source_Unit (Corresponding_Body (Parent (Spec)),
- Cunit_Entity (Current_Sem_Unit));
+ and then
+ In_Same_Source_Unit (Corresponding_Body (Parent (Spec)),
+ Cunit_Entity (Current_Sem_Unit));
end;
end if;
tzi_status = GetTimeZoneInformation (&tzi);
/* Processing for RTX targets or cases where we simply want to extract the
- offset of the current time zone, regardless of the date. */
+ offset of the current time zone, regardless of the date. A value of "0"
+ for flag "is_historic" signifies that the date is NOT historic, see the
+ body of Ada.Calendar.UTC_Time_Offset. */
- if (rtx_active || !is_historic) {
+ if (rtx_active || *is_historic == 0) {
*off = tzi.Bias;
/* The system is operating in the range covered by the StandardDate
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2012, 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- --
function Sum_Digits (Left : Uint; Sign : Int) return Int;
-- If Sign = 1 return the sum of the "digits" of Abs (Left). If the total
- -- has more then one digit then return Sum_Digits of total.
+ -- has more than one digit then return Sum_Digits of total.
function Sum_Double_Digits (Left : Uint; Sign : Int) return Int;
-- Same as above but work in New_Base = Base * Base
Discard_Quotient : Boolean := False;
Discard_Remainder : Boolean := False)
is
- pragma Warnings (Off, Quotient);
- pragma Warnings (Off, Remainder);
begin
pragma Assert (Right /= Uint_0);
-- /CONTINUATION_INDENT=nnn
--
-- Indentation level for continuation lines, nnn from 1 .. 9.
- -- The default value is one less then the (normal) indentation level,
+ -- The default value is one less than the (normal) indentation level,
-- unless the indentation is set to 1: in that case the default value for
-- continuation line indentation is also 1.
-- /NO_SEPARATE_IS
--
-- Do not place the IS keyword on a separate line in a subprogram body in
- -- case if the specification occupies more then one line.
+ -- case if the specification occupies more than one line.
S_Pretty_Sep_Label : aliased constant S := "/SEPARATE_LABEL " &
"--separate-label";