]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
WriteInt in the ISO libraries should not emit '+' for positive values
authorGaius Mulley <gaiusmod2@gmail.com>
Wed, 17 May 2023 16:42:03 +0000 (17:42 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Wed, 17 May 2023 16:42:03 +0000 (17:42 +0100)
This trivial patch changes the default behaviour for WriteInt so that
'+' is not emitted when writing positive values.

gcc/m2/ChangeLog:

* gm2-libs-iso/LongWholeIO.mod (WriteInt): Only request a
sign if the value is < 0.
* gm2-libs-iso/ShortWholeIO.mod (WriteInt): Only request a
sign if the value is < 0.
* gm2-libs-iso/WholeIO.mod (WriteInt): Only request a sign
if the value is < 0.
* gm2-libs-iso/WholeStr.mod (WriteInt): Only request a sign
if the value is < 0.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-libs-iso/LongWholeIO.mod
gcc/m2/gm2-libs-iso/ShortWholeIO.mod
gcc/m2/gm2-libs-iso/WholeIO.mod
gcc/m2/gm2-libs-iso/WholeStr.mod

index 252026cd3fe8cdca488f710a1eb7c8a72ddfec58..666e109fabc132a15309394932f5a01126d5e058 100644 (file)
@@ -116,9 +116,9 @@ PROCEDURE WriteInt (cid: IOChan.ChanId; int: LONGINT;
 VAR
    s: String ;
 BEGIN
-   s := LongIntegerToString(int, width, ' ', TRUE, 10, FALSE) ;
-   writeString(cid, s) ;
-   s := KillString(s)
+   s := LongIntegerToString (int, width, ' ', int < 0, 10, FALSE) ;
+   writeString (cid, s) ;
+   s := KillString (s)
 END WriteInt ;
 
 
index ac244fa3610eb8483efafecc01bae339ea5a2de2..0c7286c3162d370aff905ad1e476cf126f49e0b2 100644 (file)
@@ -116,9 +116,9 @@ PROCEDURE WriteInt (cid: IOChan.ChanId; int: SHORTINT;
 VAR
    s: String ;
 BEGIN
-   s := IntegerToString(int, width, ' ', TRUE, 10, FALSE) ;
-   writeString(cid, s) ;
-   s := KillString(s)
+   s := IntegerToString (int, width, ' ', int < 0, 10, FALSE) ;
+   writeString (cid, s) ;
+   s := KillString (s)
 END WriteInt ;
 
 
index 0bfe1a8fc0a491345550a234b28dc3ae9184b589..b8ed377973954521026b463e8fc295c4397f1993 100644 (file)
@@ -116,9 +116,9 @@ PROCEDURE WriteInt (cid: IOChan.ChanId; int: INTEGER;
 VAR
    s: String ;
 BEGIN
-   s := IntegerToString(int, width, ' ', TRUE, 10, FALSE) ;
-   writeString(cid, s) ;
-   s := KillString(s)
+   s := IntegerToString (int, width, ' ', int < 0, 10, FALSE) ;
+   writeString (cid, s) ;
+   s := KillString (s)
 END WriteInt ;
 
 
index cbe15723bac44245281026d9a0e1bf7fb6e178b7..328246a3cc482e992e22d63115738016ca34694b 100644 (file)
@@ -57,9 +57,9 @@ PROCEDURE IntToStr (int: INTEGER; VAR str: ARRAY OF CHAR);
 VAR
    s: String ;
 BEGIN
-   s := IntegerToString(int, 0, ' ', TRUE, 10, FALSE) ;
-   CopyOut(str, s) ;
-   s := KillString(s)
+   s := IntegerToString (int, 0, ' ', int < 0, 10, FALSE) ;
+   CopyOut (str, s) ;
+   s := KillString (s)
 END IntToStr ;