From: Johannes Kliemann <kliem...@adacore.com>

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.

Tested on x86_64-pc-linux-gnu, committed on master.

---
 gcc/ada/libgnat/i-cpoint.adb | 2 +-
 gcc/ada/libgnat/s-valuer.adb | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/ada/libgnat/i-cpoint.adb b/gcc/ada/libgnat/i-cpoint.adb
index 40a5834edd0..994e639e2f9 100644
--- a/gcc/ada/libgnat/i-cpoint.adb
+++ b/gcc/ada/libgnat/i-cpoint.adb
@@ -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;
 
diff --git a/gcc/ada/libgnat/s-valuer.adb b/gcc/ada/libgnat/s-valuer.adb
index cc1f778ee4e..46f85e11159 100644
--- a/gcc/ada/libgnat/s-valuer.adb
+++ b/gcc/ada/libgnat/s-valuer.adb
@@ -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;
-- 
2.43.0

Reply via email to