From f5b246ce5fd95e721f0f418633964f466448d2ae Mon Sep 17 00:00:00 2001 From: Gaius Mulley Date: Wed, 17 May 2023 17:42:03 +0100 Subject: 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 --- gcc/m2/gm2-libs-iso/LongWholeIO.mod | 6 +++--- gcc/m2/gm2-libs-iso/ShortWholeIO.mod | 6 +++--- gcc/m2/gm2-libs-iso/WholeIO.mod | 6 +++--- gcc/m2/gm2-libs-iso/WholeStr.mod | 6 +++--- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/gcc/m2/gm2-libs-iso/LongWholeIO.mod b/gcc/m2/gm2-libs-iso/LongWholeIO.mod index 252026cd3fe..666e109fabc 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 ac244fa3610..0c7286c3162 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 0bfe1a8fc0a..b8ed3779739 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 cbe15723bac..328246a3cc4 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 ; -- cgit v1.2.1