PR-108136 modula-2 meets cppcheck part 2
authorGaius Mulley <gaiusmod2@gmail.com>
Fri, 20 Jan 2023 23:39:35 +0000 (23:39 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Fri, 20 Jan 2023 23:39:35 +0000 (23:39 +0000)
commit5c4122be854c135a1f66f2db68ec9cde6d5993dc
treeb6c3b98597b6314a7349e750d8817c570d4a50e0
parent0c193cabe1d8f209359f3ccb8e74cf87b38fc4bc
PR-108136 modula-2 meets cppcheck part 2

R-108136 modula-2 meets cppcheck part 2

This patch addresses the style warnings mentioned in the PR.
The array high style fixes to mc/keyc.mod and
gm2-libs/M2Dependent.mod provoke a rebuild of pge and mc.

gcc/m2/ChangeLog:

* gm2-libs/Args.mod (GetArg): Check index before
accessing array.
* gm2-libs/M2Dependent.mod (toCString): Check index
before accessing array.
* mc-boot/GArgs.c: Rebuilt.
* mc-boot/GM2Dependent.c: Rebuilt.
* mc-boot/Gkeyc.c: Rebuilt.
* mc/keyc.mod (seenUIntMin): Initialize once.
(seenUIntMax): Initialize once.
(checkLimits): Only test seenUIntMin and seenUIntMax
once.
* pge-boot/GArgs.c:  Rebuilt.
* pge-boot/GM2Dependent.c: Rebuilt.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-libs/Args.mod
gcc/m2/gm2-libs/M2Dependent.mod
gcc/m2/mc-boot/GArgs.c
gcc/m2/mc-boot/GM2Dependent.c
gcc/m2/mc-boot/Gkeyc.c
gcc/m2/mc/keyc.mod
gcc/m2/pge-boot/GArgs.c
gcc/m2/pge-boot/GM2Dependent.c