From: Gaius Mulley Date: Wed, 17 May 2023 16:42:03 +0000 (+0100) Subject: WriteInt in the ISO libraries should not emit '+' for positive values X-Git-Tag: basepoints/gcc-15~9198 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5b246ce5fd95e721f0f418633964f466448d2ae;p=thirdparty%2Fgcc.git WriteInt in the ISO libraries should not emit '+' for positive values 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 --- diff --git a/gcc/m2/gm2-libs-iso/LongWholeIO.mod b/gcc/m2/gm2-libs-iso/LongWholeIO.mod index 252026cd3fe8..666e109fabc1 100644 --- a/gcc/m2/gm2-libs-iso/LongWholeIO.mod +++ b/gcc/m2/gm2-libs-iso/LongWholeIO.mod @@ -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 ; diff --git a/gcc/m2/gm2-libs-iso/ShortWholeIO.mod b/gcc/m2/gm2-libs-iso/ShortWholeIO.mod index ac244fa3610e..0c7286c3162d 100644 --- a/gcc/m2/gm2-libs-iso/ShortWholeIO.mod +++ b/gcc/m2/gm2-libs-iso/ShortWholeIO.mod @@ -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 ; diff --git a/gcc/m2/gm2-libs-iso/WholeIO.mod b/gcc/m2/gm2-libs-iso/WholeIO.mod index 0bfe1a8fc0a4..b8ed37797395 100644 --- a/gcc/m2/gm2-libs-iso/WholeIO.mod +++ b/gcc/m2/gm2-libs-iso/WholeIO.mod @@ -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 ; diff --git a/gcc/m2/gm2-libs-iso/WholeStr.mod b/gcc/m2/gm2-libs-iso/WholeStr.mod index cbe15723bac4..328246a3cc48 100644 --- a/gcc/m2/gm2-libs-iso/WholeStr.mod +++ b/gcc/m2/gm2-libs-iso/WholeStr.mod @@ -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 ;