]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Adjust comparisons in if-statements according to coding style
authorJohannes Kliemann <kliemann@adacore.com>
Mon, 14 Apr 2025 12:24:38 +0000 (12:24 +0000)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 30 Jun 2025 13:47:18 +0000 (15:47 +0200)
The Ada coding style requires the use of short circuit forms in
if-statements. Use this form consistently for all if-statements.

gcc/ada/ChangeLog:

* libgnat/s-valuer.adb: Switch missing if-statements to
short-circuit form.
* libgnat/i-cpoint.adb: Ditto.

gcc/ada/libgnat/i-cpoint.adb
gcc/ada/libgnat/s-valuer.adb

index 40a5834edd05c92249d22a90acca88ab2867618a..994e639e2f99190ee05a5e2f5999e3f7e50e3365 100644 (file)
@@ -148,7 +148,7 @@ package body Interfaces.C.Pointers is
       S : Pointer := Source;
 
    begin
-      if Source = null or Target = null then
+      if Source = null or else Target = null then
          raise Dereference_Error;
       end if;
 
index cc1f778ee4ee712f4bfca85a214c73a57de5f67e..46f85e11159f55851320d5720a7a7cc3caae29f6 100644 (file)
@@ -341,7 +341,7 @@ package body System.Value_R is
 
             --  Underscore is only allowed if followed by a digit
 
-            if Digit = Underscore and Index + 1 <= Max then
+            if Digit = Underscore and then Index + 1 <= Max then
 
                Digit := As_Digit (Str (Index + 1));
                if Digit in Valid_Digit then
@@ -496,7 +496,7 @@ package body System.Value_R is
             --  Next character is not a digit. In that case stop scanning
             --  unless the next chracter is an underscore followed by a digit.
 
-            if Digit = Underscore and Index + 1 <= Max then
+            if Digit = Underscore and then Index + 1 <= Max then
                Digit := As_Digit (Str (Index + 1));
                if Digit in Valid_Digit then
                   Index := Index + 1;