modula2: iso library SysClock.mod and wrapclock.cc fixes.
commit5f2408712a4e3994ad903c2f72af19c5a473ef5d
authorGaius Mulley <gaiusmod2@gmail.com>
Fri, 29 Sep 2023 16:18:16 +0000 (29 17:18 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Fri, 29 Sep 2023 16:18:16 +0000 (29 17:18 +0100)
treed2b7758a72547e03abff9957f8b363e8f9f81dee
parent0f184b4141e9d285c19b3a3d02bffa45bc0d8f07
modula2: iso library SysClock.mod and wrapclock.cc fixes.

This patch corrects the C equivalent of m2 LONGINT parameters
in wrapclock.cc and corrects the SysClock.mod module.
wrapclock.cc uses a typedef long long int longint_t to match
m2 LONGINT (rather than unsigned long).  These fixes
prevent calls to SysClock hanging spinning on an (incorrect)
large day count from the epoch.

gcc/m2/ChangeLog:

* gm2-compiler/M2Quads.mod (EndBuildFor): Improve
block comments.
* gm2-libs-iso/SysClock.mod (ExtractDate): Replace
testDays with yearOfDays.  New local variable monthOfDays.

libgm2/ChangeLog:

* libm2iso/wrapclock.cc (longint_t): New declaration.
(GetTimespec): Replace types for sec and nano with
longint_t.
(SetTimespec): Replace types for sec and nano with
longint_t.

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2Quads.mod
gcc/m2/gm2-libs-iso/SysClock.mod
libgm2/libm2iso/wrapclock.cc