]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Remove subexpression that's always False
authorRonan Desplanques <desplanques@adacore.com>
Thu, 3 Apr 2025 12:22:24 +0000 (14:22 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Thu, 12 Jun 2025 08:37:54 +0000 (10:37 +0200)
Also improve a few comments in the enclosing subprogram body.

gcc/ada/ChangeLog:

* libgnat/s-valuer.adb (Scan_Raw_Real): Remove subexpression. Improve
surrounding comments.

gcc/ada/libgnat/s-valuer.adb

index 93e292cc34f47237360935cc13940c3542701f5b..4b444c2f8a771a35c36e5623cc7fcaca940650f5 100644 (file)
@@ -580,8 +580,8 @@ package body System.Value_R is
       if Str (Index) in '0' .. '9' then
          After_Point := False;
 
-         --  If this is a digit it can indicates either the float decimal
-         --  part or the base to use.
+         --  If this is a digit it can indicate either the integral part or the
+         --  base to use.
 
          Scan_Integral_Digits
            (Str, Index, Max, Base, False, Value, Scale, N,
@@ -632,10 +632,10 @@ package body System.Value_R is
          end if;
       end if;
 
-      --  Scan the integral part if still necessary
+      --  Scan the integral part if there was a base and no point right after
 
       if Base_Char /= ASCII.NUL and then not After_Point then
-         if Index > Max or else As_Digit (Str (Index)) not in Valid_Digit then
+         if As_Digit (Str (Index)) not in Valid_Digit then
             Bad_Value (Str);
          end if;