From a746131d375283f28e6e0a3e45bddffb6d1ebfcd Mon Sep 17 00:00:00 2001 From: Piotr Trojanek Date: Tue, 18 Jan 2022 01:08:53 +0100 Subject: [PATCH] [Ada] Remove extra space around binary operators Style cleanups. Violation initially spotted while reading the code for UI_Expon; other occurrences found with grep (and examined manually, because sometimes the extra space is needed for a code layout). gcc/ada/ * bindgen.adb, errout.adb, exp_unst.adb, gnatchop.adb, libgnat/a-ngcefu.adb, libgnat/a-strunb.adb, libgnat/a-stwiun.adb, libgnat/a-stzunb.adb, libgnat/a-wtedit.adb, libgnat/g-debpoo.adb, osint.adb, sigtramp-vxworks.c, uintp.adb: Remove extra whitespace around +, -, *, / and **. --- gcc/ada/bindgen.adb | 2 +- gcc/ada/errout.adb | 2 +- gcc/ada/exp_unst.adb | 2 +- gcc/ada/gnatchop.adb | 2 +- gcc/ada/libgnat/a-ngcefu.adb | 6 +++--- gcc/ada/libgnat/a-strunb.adb | 2 +- gcc/ada/libgnat/a-stwiun.adb | 2 +- gcc/ada/libgnat/a-stzunb.adb | 2 +- gcc/ada/libgnat/a-wtedit.adb | 4 ++-- gcc/ada/libgnat/g-debpoo.adb | 4 ++-- gcc/ada/osint.adb | 8 ++++---- gcc/ada/sigtramp-vxworks.c | 10 +++++----- gcc/ada/uintp.adb | 2 +- 13 files changed, 24 insertions(+), 24 deletions(-) diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb index eec9dd5..d7ba267 100644 --- a/gcc/ada/bindgen.adb +++ b/gcc/ada/bindgen.adb @@ -2907,7 +2907,7 @@ package body Bindgen is Nlen := Name'Length; Name (Name'Last) := Character'Val (J mod 10 + Character'Pos ('0')); Name (Name'Last - 1) := - Character'Val (J / 10 + Character'Pos ('0')); + Character'Val (J / 10 + Character'Pos ('0')); end if; for K in ALIs.First .. ALIs.Last loop diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb index f506bcc..44d461f 100644 --- a/gcc/ada/errout.adb +++ b/gcc/ada/errout.adb @@ -3876,7 +3876,7 @@ package body Errout is -- dealing with some cases of internal names). while Name_Len > 1 and then Name_Buffer (Name_Len) in 'A' .. 'Z' loop - Name_Len := Name_Len - 1; + Name_Len := Name_Len - 1; end loop; -- If we have any of the names from standard that start with the diff --git a/gcc/ada/exp_unst.adb b/gcc/ada/exp_unst.adb index 90a626f..2fb9299 100644 --- a/gcc/ada/exp_unst.adb +++ b/gcc/ada/exp_unst.adb @@ -856,7 +856,7 @@ package body Exp_Unst is S : Entity_Id := E; begin - for J in reverse 1 .. L - 1 loop + for J in reverse 1 .. L - 1 loop S := Enclosing_Subprogram (S); Subps.Table (Subp_Index (S)).Reachable := True; end loop; diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb index 0199971..03ad454 100644 --- a/gcc/ada/gnatchop.adb +++ b/gcc/ada/gnatchop.adb @@ -721,7 +721,7 @@ procedure Gnatchop is begin Parse_Token (Source, Parse_Ptr, Token_Ptr); - if Source'Last + 1 - Token_Ptr < Literal'Length + if Source'Last + 1 - Token_Ptr < Literal'Length or else Source (Token_Ptr .. Token_Ptr + Literal'Length - 1) /= Literal then diff --git a/gcc/ada/libgnat/a-ngcefu.adb b/gcc/ada/libgnat/a-ngcefu.adb index eccb560..56beb0f 100644 --- a/gcc/ada/libgnat/a-ngcefu.adb +++ b/gcc/ada/libgnat/a-ngcefu.adb @@ -225,7 +225,7 @@ package body Ada.Numerics.Generic_Complex_Elementary_Functions is elsif abs Re (X) > 1.0 / Epsilon or else abs Im (X) > 1.0 / Epsilon then - Xt := Complex_One / X; + Xt := Complex_One / X; if Re (X) < 0.0 then Set_Re (Xt, PI - Re (Xt)); @@ -442,7 +442,7 @@ package body Ada.Numerics.Generic_Complex_Elementary_Functions is if abs Re (X) < Square_Root_Epsilon and then abs Im (X) < Square_Root_Epsilon then - return Complex_One / X; + return Complex_One / X; elsif Im (X) > Log_Inverse_Epsilon_2 then return -Complex_I; @@ -463,7 +463,7 @@ package body Ada.Numerics.Generic_Complex_Elementary_Functions is if abs Re (X) < Square_Root_Epsilon and then abs Im (X) < Square_Root_Epsilon then - return Complex_One / X; + return Complex_One / X; elsif Re (X) > Log_Inverse_Epsilon_2 then return Complex_One; diff --git a/gcc/ada/libgnat/a-strunb.adb b/gcc/ada/libgnat/a-strunb.adb index e97ee3d..f8e880e 100644 --- a/gcc/ada/libgnat/a-strunb.adb +++ b/gcc/ada/libgnat/a-strunb.adb @@ -721,7 +721,7 @@ package body Ada.Strings.Unbounded is Realloc_For_Chunk (Source, New_Item'Length); Source.Reference - (Before + New_Item'Length .. Source.Last + New_Item'Length) := + (Before + New_Item'Length .. Source.Last + New_Item'Length) := Source.Reference (Before .. Source.Last); Source.Reference (Before .. Before + New_Item'Length - 1) := New_Item; diff --git a/gcc/ada/libgnat/a-stwiun.adb b/gcc/ada/libgnat/a-stwiun.adb index 76fc2ea..8773a62 100644 --- a/gcc/ada/libgnat/a-stwiun.adb +++ b/gcc/ada/libgnat/a-stwiun.adb @@ -718,7 +718,7 @@ package body Ada.Strings.Wide_Unbounded is Realloc_For_Chunk (Source, New_Item'Length); Source.Reference - (Before + New_Item'Length .. Source.Last + New_Item'Length) := + (Before + New_Item'Length .. Source.Last + New_Item'Length) := Source.Reference (Before .. Source.Last); Source.Reference (Before .. Before + New_Item'Length - 1) := New_Item; diff --git a/gcc/ada/libgnat/a-stzunb.adb b/gcc/ada/libgnat/a-stzunb.adb index 34cbc32..a92714c 100644 --- a/gcc/ada/libgnat/a-stzunb.adb +++ b/gcc/ada/libgnat/a-stzunb.adb @@ -726,7 +726,7 @@ package body Ada.Strings.Wide_Wide_Unbounded is Realloc_For_Chunk (Source, New_Item'Length); Source.Reference - (Before + New_Item'Length .. Source.Last + New_Item'Length) := + (Before + New_Item'Length .. Source.Last + New_Item'Length) := Source.Reference (Before .. Source.Last); Source.Reference (Before .. Before + New_Item'Length - 1) := New_Item; diff --git a/gcc/ada/libgnat/a-wtedit.adb b/gcc/ada/libgnat/a-wtedit.adb index 64bb989..9b9f702 100644 --- a/gcc/ada/libgnat/a-wtedit.adb +++ b/gcc/ada/libgnat/a-wtedit.adb @@ -246,8 +246,8 @@ package body Ada.Wide_Text_IO.Editing is else Count := Count * 10 - + Character'Pos (Picture (Last)) - - Character'Pos ('0'); + + Character'Pos (Picture (Last)) - + Character'Pos ('0'); end if; Last := Last + 1; diff --git a/gcc/ada/libgnat/g-debpoo.adb b/gcc/ada/libgnat/g-debpoo.adb index ecab282..6e0cf10 100644 --- a/gcc/ada/libgnat/g-debpoo.adb +++ b/gcc/ada/libgnat/g-debpoo.adb @@ -791,7 +791,7 @@ package body GNAT.Debug_Pools is declare Block_Number : constant Integer_Address := - Int_Storage / Memory_Chunk_Size; + Int_Storage / Memory_Chunk_Size; Ptr : constant Validity_Bits_Ref := Validy_Htable.Get (Block_Number); Offset : constant Integer_Address := @@ -844,7 +844,7 @@ package body GNAT.Debug_Pools is procedure Set_Valid (Storage : System.Address; Value : Boolean) is Int_Storage : constant Integer_Address := To_Integer (Storage); Block_Number : constant Integer_Address := - Int_Storage / Memory_Chunk_Size; + Int_Storage / Memory_Chunk_Size; Ptr : Validity_Bits_Ref := Validy_Htable.Get (Block_Number); Offset : constant Integer_Address := (Int_Storage - (Block_Number * Memory_Chunk_Size)) / diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb index 3ac4fd5..af76dc7 100644 --- a/gcc/ada/osint.adb +++ b/gcc/ada/osint.adb @@ -1971,9 +1971,9 @@ package body Osint is function Nb_Dir_In_Obj_Search_Path return Natural is begin if Opt.Look_In_Primary_Dir then - return Lib_Search_Directories.Last - Primary_Directory + 1; + return Lib_Search_Directories.Last - Primary_Directory + 1; else - return Lib_Search_Directories.Last - Primary_Directory; + return Lib_Search_Directories.Last - Primary_Directory; end if; end Nb_Dir_In_Obj_Search_Path; @@ -1984,9 +1984,9 @@ package body Osint is function Nb_Dir_In_Src_Search_Path return Natural is begin if Opt.Look_In_Primary_Dir then - return Src_Search_Directories.Last - Primary_Directory + 1; + return Src_Search_Directories.Last - Primary_Directory + 1; else - return Src_Search_Directories.Last - Primary_Directory; + return Src_Search_Directories.Last - Primary_Directory; end if; end Nb_Dir_In_Src_Search_Path; diff --git a/gcc/ada/sigtramp-vxworks.c b/gcc/ada/sigtramp-vxworks.c index 138e3d0..357a834 100644 --- a/gcc/ada/sigtramp-vxworks.c +++ b/gcc/ada/sigtramp-vxworks.c @@ -49,15 +49,15 @@ typedef struct mcontext { - REG_SET regs; + REG_SET regs; } mcontext_t; typedef struct ucontext { - mcontext_t uc_mcontext; /* register set */ - struct ucontext * uc_link; /* not used */ - sigset_t uc_sigmask; /* set of signals blocked */ - stack_t uc_stack; /* stack of context signaled */ + mcontext_t uc_mcontext; /* register set */ + struct ucontext * uc_link; /* not used */ + sigset_t uc_sigmask; /* set of signals blocked */ + stack_t uc_stack; /* stack of context signaled */ } ucontext_t; #endif diff --git a/gcc/ada/uintp.adb b/gcc/ada/uintp.adb index 5c13061..854d2e1 100644 --- a/gcc/ada/uintp.adb +++ b/gcc/ada/uintp.adb @@ -1431,7 +1431,7 @@ package body Uintp is N := N / Uint_2; exit when N = Uint_0; - Squares := Squares * Squares; + Squares := Squares * Squares; end loop; Uintp.Release_And_Save (M, Result); -- 2.7.4