https://gcc.gnu.org/g:f82d1502da4fa2de8ccb97545ba93bef040ba156
commit r16-1783-gf82d1502da4fa2de8ccb97545ba93bef040ba156 Author: Johannes Kliemann <kliem...@adacore.com> Date: Mon Apr 14 12:24:38 2025 +0000 ada: Adjust comparisons in if-statements according to coding style 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. Diff: --- 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 40a5834edd05..994e639e2f99 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 cc1f778ee4ee..46f85e11159f 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;