https://gcc.gnu.org/g:36ce325643c9bc0e67452f0c27b6a2fc8162e04d
commit r15-6419-g36ce325643c9bc0e67452f0c27b6a2fc8162e04d Author: Wilken Gottwalt <wilken.gottw...@posteo.net> Date: Sun Dec 8 19:46:16 2024 +0000 gm2: fix bad programming practice warning Fix identifier names to be too similar to Modula-2 keywords and causing warnings coming from Modula-2's own libraries. m2/m2log/InOut.mod:51:18: note: In implementation module ‘InOut’: either the identifier has the same name as a keyword or alternatively a keyword has the wrong case (‘IN’ and ‘in’) 51 | in, out: File ; m2/m2log/InOut.mod:51:18: note: the symbol name ‘in’ is legal as an identifier, however as such it might cause confusion and is considered bad programming practice gcc/gm2: * gm2-libs-log/InOut.mod: Fix bad identifier warning. Signed-off-by: Wilken Gottwalt <wilken.gottw...@posteo.net> Diff: --- gcc/m2/gm2-libs-log/InOut.mod | 53 +++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 27 deletions(-) diff --git a/gcc/m2/gm2-libs-log/InOut.mod b/gcc/m2/gm2-libs-log/InOut.mod index 6e21fdcb6c10..defd6d206ea7 100644 --- a/gcc/m2/gm2-libs-log/InOut.mod +++ b/gcc/m2/gm2-libs-log/InOut.mod @@ -48,9 +48,8 @@ TYPE CharSet = SET OF CHAR ; VAR - in, out: File ; - inUsed, - outUsed: BOOLEAN ; + inFile, outFile: File ; + inUsed, outUsed: BOOLEAN ; (* @@ -71,8 +70,8 @@ BEGIN END ; IF SFIO.Exists(s) THEN - in := SFIO.OpenToRead(s) ; - Done := FIO.IsNoError(in) ; + inFile := SFIO.OpenToRead(s) ; + Done := FIO.IsNoError(inFile) ; inUsed := TRUE ELSE Done := FALSE ; @@ -91,8 +90,8 @@ PROCEDURE CloseInput ; BEGIN IF inUsed THEN - FIO.Close(in) ; - in := StdIn ; + FIO.Close(inFile) ; + inFile := StdIn ; inUsed := FALSE END END CloseInput ; @@ -116,8 +115,8 @@ BEGIN END ; IF SFIO.Exists(s) THEN - out := SFIO.OpenToWrite(s) ; - Done := FIO.IsNoError(out) ; + outFile := SFIO.OpenToWrite(s) ; + Done := FIO.IsNoError(outFile) ; outUsed := TRUE ELSE Done := FALSE ; @@ -136,8 +135,8 @@ PROCEDURE CloseOutput ; BEGIN IF outUsed THEN - FIO.Close(out) ; - out := StdOut ; + FIO.Close(outFile) ; + outFile := StdOut ; outUsed := FALSE END END CloseOutput ; @@ -149,8 +148,8 @@ END CloseOutput ; PROCEDURE LocalRead (VAR ch: CHAR) ; BEGIN - ch := FIO.ReadChar(in) ; - Done := FIO.IsNoError(in) AND (NOT FIO.EOF(in)) + ch := FIO.ReadChar(inFile) ; + Done := FIO.IsNoError(inFile) AND (NOT FIO.EOF(inFile)) END LocalRead ; @@ -246,8 +245,8 @@ END ReadString ; PROCEDURE WriteString (s: ARRAY OF CHAR) ; BEGIN - FIO.WriteString(out, s) ; - Done := FIO.IsNoError(out) + FIO.WriteString(outFile, s) ; + Done := FIO.IsNoError(outFile) END WriteString ; @@ -257,13 +256,13 @@ END WriteString ; PROCEDURE LocalWrite (ch: CHAR) ; BEGIN - FIO.WriteChar(out, ch) ; - Done := FIO.IsNoError(out) + FIO.WriteChar(outFile, ch) ; + Done := FIO.IsNoError(outFile) (* IF outUsed THEN - FIO.WriteChar(out, ch) ; - Done := FIO.IsNoError(out) + FIO.WriteChar(outFile, ch) ; + Done := FIO.IsNoError(outFile) ELSE Done := (write(stdout, ADR(ch), 1) = 1) END @@ -308,8 +307,8 @@ PROCEDURE WriteLn ; BEGIN IF outUsed THEN - FIO.WriteLine(out) ; - Done := FIO.IsNoError(out) + FIO.WriteLine(outFile) ; + Done := FIO.IsNoError(outFile) ELSE Terminal.WriteLn END @@ -366,7 +365,7 @@ END ReadCard ; PROCEDURE WriteCard (x, n: CARDINAL) ; BEGIN - IF KillString(SFIO.WriteS(out, ctos(x, n, ' ')))=NIL + IF KillString(SFIO.WriteS(outFile, ctos(x, n, ' ')))=NIL THEN END END WriteCard ; @@ -380,7 +379,7 @@ END WriteCard ; PROCEDURE WriteInt (x: INTEGER; n: CARDINAL) ; BEGIN - IF KillString(SFIO.WriteS(out, itos(x, n, ' ', FALSE)))=NIL + IF KillString(SFIO.WriteS(outFile, itos(x, n, ' ', FALSE)))=NIL THEN END END WriteInt ; @@ -394,7 +393,7 @@ END WriteInt ; PROCEDURE WriteOct (x, n: CARDINAL) ; BEGIN - IF KillString(SFIO.WriteS(out, CardinalToString(x, n, ' ', 8, FALSE)))=NIL + IF KillString(SFIO.WriteS(outFile, CardinalToString(x, n, ' ', 8, FALSE)))=NIL THEN END END WriteOct ; @@ -408,7 +407,7 @@ END WriteOct ; PROCEDURE WriteHex (x, n: CARDINAL) ; BEGIN - IF KillString(SFIO.WriteS(out, CardinalToString(x, n, ' ', 16, TRUE)))=NIL + IF KillString(SFIO.WriteS(outFile, CardinalToString(x, n, ' ', 16, TRUE)))=NIL THEN END END WriteHex ; @@ -420,8 +419,8 @@ END WriteHex ; PROCEDURE Init ; BEGIN - in := FIO.StdIn ; - out := FIO.StdOut ; + inFile := FIO.StdIn ; + outFile := FIO.StdOut ; inUsed := FALSE ; outUsed := FALSE ; AssignRead(LocalRead, LocalStatus, Done) ;