]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Refine subtype of a universal arithmetic utility routine
authorPiotr Trojanek <trojanek@adacore.com>
Wed, 4 Dec 2024 18:23:08 +0000 (19:23 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 3 Jan 2025 15:39:13 +0000 (16:39 +0100)
Code cleanup; semantics is unaffected.

gcc/ada/ChangeLog:

* uintp.adb (N_Digits): Refine return subtype, since this routine
always returns a positive number of digits.

gcc/ada/uintp.adb

index fc548e02d57018155ac2bdb73914009c7127610a..59ed5b04588906d6c3ceb497b1f2b20eeaaa97cd 100644 (file)
@@ -174,7 +174,7 @@ package body Uintp is
    --  K is as small as possible S.T. Right_Hat < Base * Base. It is required
    --  that Left >= Right for the algorithm to work.
 
-   function N_Digits (Input : Valid_Uint) return Int;
+   function N_Digits (Input : Valid_Uint) return Pos;
    pragma Inline (N_Digits);
    --  Returns number of "digits" in a Uint
 
@@ -603,7 +603,7 @@ package body Uintp is
    -- N_Digits --
    ---------------
 
-   function N_Digits (Input : Valid_Uint) return Int is
+   function N_Digits (Input : Valid_Uint) return Pos is
    begin
       if Direct (Input) then
          if Direct_Val (Input) >= Base then