From: Ronan Desplanques Date: Thu, 21 Nov 2024 13:26:32 +0000 (+0100) Subject: ada: Fix minor display issue on invalid floats X-Git-Tag: basepoints/gcc-16~3399 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9ea2c78197cf16390b924c07acc402cb0954237f;p=thirdparty%2Fgcc.git ada: Fix minor display issue on invalid floats GNAT implements a format with trailing '*' signs for the Image attribute of NaN, +inf and -inf. It was probably always intended to be the same length as the image of 1.0, but one '*' was actually missing. This patch fixes this. gcc/ada/ChangeLog: * libgnat/s-imager.adb (Image_Floating_Point): Tweak display of invalid floating point values. --- diff --git a/gcc/ada/libgnat/s-imager.adb b/gcc/ada/libgnat/s-imager.adb index c598cc94e152..d19fda3b613d 100644 --- a/gcc/ada/libgnat/s-imager.adb +++ b/gcc/ada/libgnat/s-imager.adb @@ -109,6 +109,7 @@ package body System.Image_R is is pragma Assert (S'First = 1); + Fore : Natural; begin -- Decide whether a blank should be prepended before the call to -- Set_Image_Real. We generate a blank for positive values, and @@ -125,11 +126,13 @@ package body System.Image_R is -- Image_Floating_Point operation. S (1) := ' '; P := 1; + Fore := 1; else P := 0; + Fore := 2; end if; - Set_Image_Real (V, S, P, 1, Digs - 1, 3); + Set_Image_Real (V, S, P, Fore, Digs - 1, 3); end Image_Floating_Point; -----------------