diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 10:28:23 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-30 10:28:23 +0000 |
commit | 8d1e3745fc7dcd77f68e7e3841209bb73e284aa6 (patch) | |
tree | 31ebe42337e32d1a1265944b1ae6957ba684600f | |
parent | c2fb68ac9fbebf56a2aa00b7ec47c950642e9b2d (diff) | |
download | gcc-8d1e3745fc7dcd77f68e7e3841209bb73e284aa6.tar.gz |
2009-11-30 Sergey Rybin <rybin@adacore.com>
* gnat_ugn.texi: Update gnatcheck doc.
2009-11-30 Robert Dewar <dewar@adacore.com>
make.adb, prj-makr.adb, g-sothco.ads: Minor reformattting
* s-taprop-dummy.adb: Minor code reorganization (raise with msgs start
with lower case).
* i-vxwoio.adb, g-dirope.adb, g-sercom-linux.adb,
g-enblsp-vms-alpha.adb, g-regist.adb, s-imgcha.adb, s-tarest.adb,
s-taprop-mingw.adb, g-exctra.adb, g-expect.adb, g-comlin.adb,
g-debpoo.adb, g-expect-vms.adb, g-pehage.adb, g-trasym-vms-alpha.adb,
g-enblsp-vms-ia64.adb, s-fatgen.adb, s-fileio.adb: Minor code
reorganization (use conditional expressions).
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@154773 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ada/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/ada/g-comlin.adb | 23 | ||||
-rw-r--r-- | gcc/ada/g-debpoo.adb | 13 | ||||
-rw-r--r-- | gcc/ada/g-dirope.adb | 24 | ||||
-rw-r--r-- | gcc/ada/g-enblsp-vms-alpha.adb | 10 | ||||
-rw-r--r-- | gcc/ada/g-enblsp-vms-ia64.adb | 9 | ||||
-rw-r--r-- | gcc/ada/g-exctra.adb | 14 | ||||
-rw-r--r-- | gcc/ada/g-expect-vms.adb | 6 | ||||
-rw-r--r-- | gcc/ada/g-expect.adb | 9 | ||||
-rw-r--r-- | gcc/ada/g-pehage.adb | 15 | ||||
-rw-r--r-- | gcc/ada/g-regist.adb | 6 | ||||
-rw-r--r-- | gcc/ada/g-sercom-linux.adb | 11 | ||||
-rw-r--r-- | gcc/ada/g-sothco.ads | 17 | ||||
-rw-r--r-- | gcc/ada/g-trasym-vms-alpha.adb | 8 | ||||
-rw-r--r-- | gcc/ada/gnat_ugn.texi | 10 | ||||
-rw-r--r-- | gcc/ada/i-vxwoio.adb | 8 | ||||
-rw-r--r-- | gcc/ada/make.adb | 4 | ||||
-rw-r--r-- | gcc/ada/prj-makr.adb | 5 | ||||
-rw-r--r-- | gcc/ada/s-fatgen.adb | 7 | ||||
-rw-r--r-- | gcc/ada/s-fileio.adb | 18 | ||||
-rw-r--r-- | gcc/ada/s-imgcha.adb | 13 | ||||
-rw-r--r-- | gcc/ada/s-taprop-dummy.adb | 2 | ||||
-rw-r--r-- | gcc/ada/s-taprop-mingw.adb | 11 | ||||
-rw-r--r-- | gcc/ada/s-tarest.adb | 18 |
24 files changed, 106 insertions, 171 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 3baddf6a275..6effdb82c4f 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -1,3 +1,19 @@ +2009-11-30 Sergey Rybin <rybin@adacore.com> + + * gnat_ugn.texi: Update gnatcheck doc. + +2009-11-30 Robert Dewar <dewar@adacore.com> + + make.adb, prj-makr.adb, g-sothco.ads: Minor reformattting + * s-taprop-dummy.adb: Minor code reorganization (raise with msgs start + with lower case). + * i-vxwoio.adb, g-dirope.adb, g-sercom-linux.adb, + g-enblsp-vms-alpha.adb, g-regist.adb, s-imgcha.adb, s-tarest.adb, + s-taprop-mingw.adb, g-exctra.adb, g-expect.adb, g-comlin.adb, + g-debpoo.adb, g-expect-vms.adb, g-pehage.adb, g-trasym-vms-alpha.adb, + g-enblsp-vms-ia64.adb, s-fatgen.adb, s-fileio.adb: Minor code + reorganization (use conditional expressions). + 2009-11-30 Vincent Celier <celier@adacore.com> * prj-makr.adb (Source_Files): New hash table to keep track of source diff --git a/gcc/ada/g-comlin.adb b/gcc/ada/g-comlin.adb index e655cad763d..eb982543b38 100644 --- a/gcc/ada/g-comlin.adb +++ b/gcc/ada/g-comlin.adb @@ -574,11 +574,8 @@ package body GNAT.Command_Line is -- Depending on the value of Concatenate, the full switch is -- a single character or the rest of the argument. - if Concatenate then - End_Index := Parser.Current_Index; - else - End_Index := Arg'Last; - end if; + End_Index := + (if Concatenate then Parser.Current_Index else Arg'Last); if Switches (Switches'First) = '*' then @@ -2279,20 +2276,16 @@ package body GNAT.Command_Line is Cmd.Coalesce_Sections := new Argument_List (Cmd.Sections'Range); for E in Cmd.Sections'Range loop - if Cmd.Sections (E) = null then - Cmd.Coalesce_Sections (E) := null; - else - Cmd.Coalesce_Sections (E) := new String'(Cmd.Sections (E).all); - end if; + Cmd.Coalesce_Sections (E) := + (if Cmd.Sections (E) = null then null + else new String'(Cmd.Sections (E).all)); end loop; Cmd.Coalesce_Params := new Argument_List (Cmd.Params'Range); for E in Cmd.Params'Range loop - if Cmd.Params (E) = null then - Cmd.Coalesce_Params (E) := null; - else - Cmd.Coalesce_Params (E) := new String'(Cmd.Params (E).all); - end if; + Cmd.Coalesce_Params (E) := + (if Cmd.Params (E) = null then null + else new String'(Cmd.Params (E).all)); end loop; -- Not a clone, since we will not modify the parameters anyway diff --git a/gcc/ada/g-debpoo.adb b/gcc/ada/g-debpoo.adb index 5127de9bdd4..ef7ce9e3dbd 100644 --- a/gcc/ada/g-debpoo.adb +++ b/gcc/ada/g-debpoo.adb @@ -985,11 +985,7 @@ package body GNAT.Debug_Pools is is begin if H.Block_Size /= 0 then - if In_Use then - To_Byte (A).all := In_Use_Mark; - else - To_Byte (A).all := Free_Mark; - end if; + To_Byte (A).all := (if In_Use then In_Use_Mark else Free_Mark); end if; end Mark; @@ -1416,11 +1412,8 @@ package body GNAT.Debug_Pools is Backtrace_Htable_Cumulate.Set (Elem); if Cumulate then - if Data.Kind = Alloc then - K := Indirect_Alloc; - else - K := Indirect_Dealloc; - end if; + K := (if Data.Kind = Alloc then Indirect_Alloc + else Indirect_Dealloc); -- Propagate the direct call to all its parents diff --git a/gcc/ada/g-dirope.adb b/gcc/ada/g-dirope.adb index c7670ef558b..294aa7031ee 100644 --- a/gcc/ada/g-dirope.adb +++ b/gcc/ada/g-dirope.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 1998-2008, AdaCore -- +-- Copyright (C) 1998-2009, AdaCore -- -- -- -- 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- -- @@ -97,12 +97,7 @@ package body GNAT.Directory_Operations is begin -- Cut_Start point to the first basename character - if Cut_Start = 0 then - Cut_Start := Path'First; - - else - Cut_Start := Cut_Start + 1; - end if; + Cut_Start := (if Cut_Start = 0 then Path'First else Cut_Start + 1); -- Cut_End point to the last basename character @@ -580,11 +575,8 @@ package body GNAT.Directory_Operations is begin Local_Get_Current_Dir (Buffer'Address, Path_Len'Address); - if Dir'Length > Path_Len then - Last := Dir'First + Path_Len - 1; - else - Last := Dir'Last; - end if; + Last := + (if Dir'Length > Path_Len then Dir'First + Path_Len - 1 else Dir'Last); Dir (Buffer'First .. Last) := Buffer (Buffer'First .. Last); @@ -683,11 +675,9 @@ package body GNAT.Directory_Operations is return; end if; - if Str'Length > Filename_Len then - Last := Str'First + Filename_Len - 1; - else - Last := Str'Last; - end if; + Last := + (if Str'Length > Filename_Len then Str'First + Filename_Len - 1 + else Str'Last); declare subtype Path_String is String (1 .. Filename_Len); diff --git a/gcc/ada/g-enblsp-vms-alpha.adb b/gcc/ada/g-enblsp-vms-alpha.adb index 4b703263f59..64af051d825 100644 --- a/gcc/ada/g-enblsp-vms-alpha.adb +++ b/gcc/ada/g-enblsp-vms-alpha.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2005-2008, AdaCore -- +-- Copyright (C) 2005-2009, AdaCore -- -- -- -- 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- -- @@ -77,11 +77,9 @@ begin -- Fork a new process (it is not possible to do this in a subprogram) - if Alloc_Vfork_Blocks >= 0 then - Descriptor.Pid := Get_Current_Invo_Context (Get_Vfork_Jmpbuf); - else - Descriptor.Pid := -1; - end if; + Descriptor.Pid := + (if Alloc_Vfork_Blocks >= 0 + then Get_Current_Invo_Context (Get_Vfork_Jmpbuf) else -1); -- Are we now in the child diff --git a/gcc/ada/g-enblsp-vms-ia64.adb b/gcc/ada/g-enblsp-vms-ia64.adb index b7a9d340072..6ac7c5a0804 100644 --- a/gcc/ada/g-enblsp-vms-ia64.adb +++ b/gcc/ada/g-enblsp-vms-ia64.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2005-2008, AdaCore -- +-- Copyright (C) 2005-2009, AdaCore -- -- -- -- 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- -- @@ -75,11 +75,8 @@ begin -- Fork a new process (it is not possible to do this in a subprogram) - if Alloc_Vfork_Blocks >= 0 then - Descriptor.Pid := Setjmp1 (Get_Vfork_Jmpbuf); - else - Descriptor.Pid := -1; - end if; + Descriptor.Pid := + (if Alloc_Vfork_Blocks >= 0 then Setjmp1 (Get_Vfork_Jmpbuf) else -1); -- Are we now in the child diff --git a/gcc/ada/g-exctra.adb b/gcc/ada/g-exctra.adb index 7d51ba4b79b..8534bbbb47e 100644 --- a/gcc/ada/g-exctra.adb +++ b/gcc/ada/g-exctra.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2000-2005, AdaCore -- +-- Copyright (C) 2000-2009, AdaCore -- -- -- -- 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- -- @@ -88,17 +88,11 @@ package body GNAT.Exception_Traces is procedure Set_Trace_Decorator (Decorator : Traceback_Decorator) is begin Current_Decorator := Decorator; - - if Current_Decorator /= null then - Traceback_Decorator_Wrapper := Decorator_Wrapper'Access; - else - Traceback_Decorator_Wrapper := null; - end if; + Traceback_Decorator_Wrapper := + (if Current_Decorator /= null + then Decorator_Wrapper'Access else null); end Set_Trace_Decorator; - -- Trace_On/Trace_Off control the kind of automatic output to occur - -- by way of the global Exception_Trace variable. - --------------- -- Trace_Off -- --------------- diff --git a/gcc/ada/g-expect-vms.adb b/gcc/ada/g-expect-vms.adb index 429a66ca55c..cc413f7248d 100644 --- a/gcc/ada/g-expect-vms.adb +++ b/gcc/ada/g-expect-vms.adb @@ -1030,11 +1030,7 @@ package body GNAT.Expect is Reinitialize_Buffer (Descriptor); end if; - if Add_LF then - Last := Full_Str'Last; - else - Last := Full_Str'Last - 1; - end if; + Last := (if Add_LF then Full_Str'Last else Full_Str'Last - 1); Call_Filters (Descriptor, Full_Str (Full_Str'First .. Last), Input); diff --git a/gcc/ada/g-expect.adb b/gcc/ada/g-expect.adb index a67696a649d..6510c310813 100644 --- a/gcc/ada/g-expect.adb +++ b/gcc/ada/g-expect.adb @@ -1003,11 +1003,10 @@ package body GNAT.Expect is -- Prepare low-level argument list from the normalized arguments for K in Arg_List'Range loop - if Arg_List (K) /= null then - C_Arg_List (K) := Arg_List (K).all'Address; - else - C_Arg_List (K) := System.Null_Address; - end if; + C_Arg_List (K) := + (if Arg_List (K) /= null + then Arg_List (K).all'Address + else System.Null_Address); end loop; -- This does not return on Unix systems diff --git a/gcc/ada/g-pehage.adb b/gcc/ada/g-pehage.adb index 5abb04c2138..e96b9cc0c58 100644 --- a/gcc/ada/g-pehage.adb +++ b/gcc/ada/g-pehage.adb @@ -6,7 +6,7 @@ -- -- -- B o d y -- -- -- --- Copyright (C) 2002-2008, AdaCore -- +-- Copyright (C) 2002-2009, AdaCore -- -- -- -- 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- -- @@ -1970,11 +1970,7 @@ package body GNAT.Perfect_Hash_Generators is Q := Seed / 127773; X := 16807 * R - 2836 * Q; - if X < 0 then - Seed := X + 2147483647; - else - Seed := X; - end if; + Seed := (if X < 0 then X + 2147483647 else X); end Random; ------------- @@ -2233,11 +2229,8 @@ package body GNAT.Perfect_Hash_Generators is -- The first position should not exceed the minimum key length. -- Otherwise, we may end up with an empty word once reduced. - if Last_Sel_Pos = 0 then - Max_Sel_Pos := Min_Key_Len; - else - Max_Sel_Pos := Max_Key_Len; - end if; + Max_Sel_Pos := + (if Last_Sel_Pos = 0 then Min_Key_Len else Max_Key_Len); -- Find which position increases more the number of differences diff --git a/gcc/ada/g-regist.adb b/gcc/ada/g-regist.adb index 2c706ff69e4..c04248e588f 100644 --- a/gcc/ada/g-regist.adb +++ b/gcc/ada/g-regist.adb @@ -417,11 +417,7 @@ package body GNAT.Registry is Result : LONG; begin - if Expand then - Value_Type := REG_EXPAND_SZ; - else - Value_Type := REG_SZ; - end if; + Value_Type := (if Expand then REG_EXPAND_SZ else REG_SZ); Result := RegSetValueEx diff --git a/gcc/ada/g-sercom-linux.adb b/gcc/ada/g-sercom-linux.adb index c25d5e8e44a..b1b5d3454e2 100644 --- a/gcc/ada/g-sercom-linux.adb +++ b/gcc/ada/g-sercom-linux.adb @@ -211,7 +211,10 @@ package body GNAT.Serial_Communications is pragma Import (C, tcflush, "tcflush"); Current : termios; - Res : int; + + Res : int; + pragma Warnings (Off, Res); + -- Warnings off, since we don't always test the result begin if Port.H = null then @@ -246,11 +249,7 @@ package body GNAT.Serial_Communications is -- Block - if Block then - Res := fcntl (int (Port.H.all), F_SETFL, 0); - else - Res := fcntl (int (Port.H.all), F_SETFL, FNDELAY); - end if; + Res := fcntl (int (Port.H.all), F_SETFL, (if Block then 0 else FNDELAY)); if Res = -1 then Raise_Error ("set: fcntl failed"); diff --git a/gcc/ada/g-sothco.ads b/gcc/ada/g-sothco.ads index 399f6d20346..ffa3e69ca63 100644 --- a/gcc/ada/g-sothco.ads +++ b/gcc/ada/g-sothco.ads @@ -212,8 +212,8 @@ package GNAT.Sockets.Thin_Common is C.Strings.Null_Ptr); -- Arrays of C (char *) - type Servent is new System.Storage_Elements.Storage_Array - (1 .. SOSC.SIZEOF_struct_servent); + type Servent is new + System.Storage_Elements.Storage_Array (1 .. SOSC.SIZEOF_struct_servent); for Servent'Alignment use 8; -- Service entry. This is an opaque type used only via the following -- accessor functions, because 'struct servent' has different layouts on @@ -223,11 +223,14 @@ package GNAT.Sockets.Thin_Common is pragma Convention (C, Servent_Access); -- Access to service entry - function Servent_S_Name (E : Servent_Access) return C.Strings.chars_ptr; - function Servent_S_Aliases (E : Servent_Access) - return Chars_Ptr_Pointers.Pointer; - function Servent_S_Port (E : Servent_Access) return C.int; - function Servent_S_Proto (E : Servent_Access) return C.Strings.chars_ptr; + function Servent_S_Name + (E : Servent_Access) return C.Strings.chars_ptr; + function Servent_S_Aliases + (E : Servent_Access) return Chars_Ptr_Pointers.Pointer; + function Servent_S_Port + (E : Servent_Access) return C.int; + function Servent_S_Proto + (E : Servent_Access) return C.Strings.chars_ptr; ------------------ -- Host entries -- diff --git a/gcc/ada/g-trasym-vms-alpha.adb b/gcc/ada/g-trasym-vms-alpha.adb index adfa8f83d4e..c58c5610bfd 100644 --- a/gcc/ada/g-trasym-vms-alpha.adb +++ b/gcc/ada/g-trasym-vms-alpha.adb @@ -217,11 +217,9 @@ package body GNAT.Traceback.Symbolic is System.Soft_Links.Lock_Task.all; for J in Traceback'Range loop - if J = Traceback'Last then - Return_Address := Address_Zero; - else - Return_Address := PC_For (Traceback (J + 1)); - end if; + Return_Address := + (if J = Traceback'Last then Address_Zero + else PC_For (Traceback (J + 1))); Symbolize (Status, diff --git a/gcc/ada/gnat_ugn.texi b/gcc/ada/gnat_ugn.texi index 19304a75f40..70b02c9b375 100644 --- a/gcc/ada/gnat_ugn.texi +++ b/gcc/ada/gnat_ugn.texi @@ -22519,7 +22519,9 @@ This rule has no parameters. @cindex @code{Positional_Generic_Parameters} rule (for @command{gnatcheck}) @noindent -Flag each instantiation using positional parameter notation. +Flag each positional actual generic parameter except for the case when +the generic unit being iinstantiated has exactly one generic formal +parameter. This rule has no parameters. @@ -22529,15 +22531,15 @@ This rule has no parameters. @cindex @code{Positional_Parameters} rule (for @command{gnatcheck}) @noindent -Flag each subprogram or entry call using positional parameter notation, +Flag each positional parameter notation in a subprogram or entry call, except for the following: @itemize @bullet @item -Invocations of prefix or infix operators are not flagged +Parameters of calls to of prefix or infix operators are not flagged @item If the called subprogram or entry has only one formal parameter, -the call is not flagged; +the parameter of the call is not flagged; @item If a subprogram call uses the @emph{Object.Operation} notation, then @itemize @minus diff --git a/gcc/ada/i-vxwoio.adb b/gcc/ada/i-vxwoio.adb index 00ee6356872..4d480e0519f 100644 --- a/gcc/ada/i-vxwoio.adb +++ b/gcc/ada/i-vxwoio.adb @@ -63,16 +63,10 @@ package body Interfaces.VxWorks.IO is is Status : int; Fd : int; - begin Fd := fileno (File); Status := ioctl (Fd, FIOSETOPTIONS, OPT_TERMINAL); - - if Status /= int (ERROR) then - Success := True; - else - Success := False; - end if; + Success := (if Status /= int (ERROR) then True else False); end Disable_Get_Immediate; end Interfaces.VxWorks.IO; diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb index 336d2ac8b85..39a30468317 100644 --- a/gcc/ada/make.adb +++ b/gcc/ada/make.adb @@ -3427,8 +3427,8 @@ package body Make is end if; -- Start the compilation and record it. We can do this - -- because there is at least one free process. This - -- might change the current directory. + -- because there is at least one free process. This might + -- change the current directory. Collect_Arguments_And_Compile (Full_Source_File => Full_Source_File, diff --git a/gcc/ada/prj-makr.adb b/gcc/ada/prj-makr.adb index 566d507f296..50cd0703d67 100644 --- a/gcc/ada/prj-makr.adb +++ b/gcc/ada/prj-makr.adb @@ -39,7 +39,7 @@ with Table; use Table; with Ada.Characters.Handling; use Ada.Characters.Handling; with GNAT.Directory_Operations; use GNAT.Directory_Operations; -with System.Case_Util; use System.Case_Util; +with System.Case_Util; use System.Case_Util; with System.CRTL; with System.HTable; @@ -613,13 +613,14 @@ package body Prj.Makr is In_Tree => Tree); begin - -- Add source file name to the source list file, if it is not + -- Add source file name to the source list file if it is not -- already there. if not Source_Files.Get (Current_Source.File_Name) then Source_Files.Set (Current_Source.File_Name, True); Get_Name_String (Current_Source.File_Name); Add_Char_To_Name_Buffer (ASCII.LF); + if Write (Source_List_FD, Name_Buffer (1)'Address, Name_Len) /= Name_Len diff --git a/gcc/ada/s-fatgen.adb b/gcc/ada/s-fatgen.adb index 0db154db4ae..cf7e4254b66 100644 --- a/gcc/ada/s-fatgen.adb +++ b/gcc/ada/s-fatgen.adb @@ -232,12 +232,7 @@ package body System.Fat_Gen is end loop; end if; - if X > 0.0 then - Frac := Ax; - else - Frac := -Ax; - end if; - + Frac := (if X > 0.0 then Ax else -Ax); Expo := Ex; end; end if; diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb index a384d40a29b..60a96e427cf 100644 --- a/gcc/ada/s-fileio.adb +++ b/gcc/ada/s-fileio.adb @@ -519,27 +519,17 @@ package body System.File_IO is end if; when Inout_File | Append_File => - if Creat then - Fopstr (1) := 'w'; - else - Fopstr (1) := 'r'; - end if; - + Fopstr (1) := (if Creat then 'w' else 'r'); Fopstr (2) := '+'; Fptr := 3; end case; - -- If text_translation_required is true then we need to append - -- either a t or b to the string to get the right mode + -- If text_translation_required is true then we need to append either a + -- "t" or "b" to the string to get the right mode. if text_translation_required then - if Text then - Fopstr (Fptr) := 't'; - else - Fopstr (Fptr) := 'b'; - end if; - + Fopstr (Fptr) := (if Text then 't' else 'b'); Fptr := Fptr + 1; end if; diff --git a/gcc/ada/s-imgcha.adb b/gcc/ada/s-imgcha.adb index dd3b4d90eaf..7678bf7205a 100644 --- a/gcc/ada/s-imgcha.adb +++ b/gcc/ada/s-imgcha.adb @@ -124,22 +124,13 @@ package body System.Img_Char is if V in C0_Range then S (1 .. 3) := C0 (V); - - if S (3) = ' ' then - P := 2; - else - P := 3; - end if; + P := (if S (3) = ' ' then 2 else 3); elsif V in C1_Range then S (1 .. 3) := C1 (V); if S (1) /= 'r' then - if S (3) = ' ' then - P := 2; - else - P := 3; - end if; + P := (if S (3) = ' ' then 2 else 3); -- Special case, res means RESERVED_nnn where nnn is the three digit -- decimal value corresponding to the code position (more efficient diff --git a/gcc/ada/s-taprop-dummy.adb b/gcc/ada/s-taprop-dummy.adb index 894500bb754..645e9fd90ba 100644 --- a/gcc/ada/s-taprop-dummy.adb +++ b/gcc/ada/s-taprop-dummy.adb @@ -190,7 +190,7 @@ package body System.Task_Primitives.Operations is procedure Initialize (Environment_Task : Task_Id) is No_Tasking : Boolean; begin - raise Program_Error with "Tasking not implemented on this configuration"; + raise Program_Error with "tasking not implemented on this configuration"; end Initialize; procedure Initialize (S : in out Suspension_Object) is diff --git a/gcc/ada/s-taprop-mingw.adb b/gcc/ada/s-taprop-mingw.adb index cb51841a54d..a3b19ab5c5d 100644 --- a/gcc/ada/s-taprop-mingw.adb +++ b/gcc/ada/s-taprop-mingw.adb @@ -312,18 +312,17 @@ package body System.Task_Primitives.Operations is Unlock (L, Global_Lock => True); -- No problem if we are interrupted here: if the condition is signaled, - -- WaitForSingleObject will simply not block + -- WaitForSingleObject will simply not block. if Rel_Time <= 0.0 then Timed_Out := True; Wait_Result := 0; else - if Rel_Time >= Duration (Time_Out_Max) / 1000 then - Time_Out := Time_Out_Max; - else - Time_Out := DWORD (Rel_Time * 1000); - end if; + Time_Out := + (if Rel_Time >= Duration (Time_Out_Max) / 1000 + then Time_Out_Max + else DWORD (Rel_Time * 1000)); Wait_Result := WaitForSingleObject (HANDLE (Cond.all), Time_Out); diff --git a/gcc/ada/s-tarest.adb b/gcc/ada/s-tarest.adb index a29aed78a41..07ddbce8c60 100644 --- a/gcc/ada/s-tarest.adb +++ b/gcc/ada/s-tarest.adb @@ -340,11 +340,10 @@ package body System.Tasking.Restricted.Stages is Write_Lock (C); - if C.Common.Base_Priority < Get_Priority (Self_ID) then - Activate_Prio := Get_Priority (Self_ID); - else - Activate_Prio := C.Common.Base_Priority; - end if; + Activate_Prio := + (if C.Common.Base_Priority < Get_Priority (Self_ID) + then Get_Priority (Self_ID) + else C.Common.Base_Priority); STPO.Create_Task (C, Task_Wrapper'Address, @@ -477,11 +476,10 @@ package body System.Tasking.Restricted.Stages is pragma Assert (Stack_Address = Null_Address); - if Priority = Unspecified_Priority then - Base_Priority := Self_ID.Common.Base_Priority; - else - Base_Priority := System.Any_Priority (Priority); - end if; + Base_Priority := + (if Priority = Unspecified_Priority + then Self_ID.Common.Base_Priority + else System.Any_Priority (Priority)); if Single_Lock then Lock_RTS; |