summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2023-05-17 17:42:03 +0100
committerGaius Mulley <gaiusmod2@gmail.com>2023-05-17 17:42:03 +0100
commitf5b246ce5fd95e721f0f418633964f466448d2ae (patch)
tree3f9491e960cc7a2bd50e904aaf1d0a059bcad63d
parent637edefc5863cf3b572c0c0bcd58fcc01ee60184 (diff)
downloadgcc-f5b246ce5fd95e721f0f418633964f466448d2ae.tar.gz
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 <gaiusmod2@gmail.com>
-rw-r--r--gcc/m2/gm2-libs-iso/LongWholeIO.mod6
-rw-r--r--gcc/m2/gm2-libs-iso/ShortWholeIO.mod6
-rw-r--r--gcc/m2/gm2-libs-iso/WholeIO.mod6
-rw-r--r--gcc/m2/gm2-libs-iso/WholeStr.mod6
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 ;