diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2024-01-24 13:11:46 +0000 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2024-01-24 13:11:46 +0000 |
commit | 3de031c96f28f19a68ea2080260d8fd2c78828ee (patch) | |
tree | 1d3fbf5b0c956bd6ca6d915170b5d0dc03eb256f /gcc | |
parent | b8f54195edbecd7151095f137f9ff27e1ddc8e36 (diff) | |
download | gcc-3de031c96f28f19a68ea2080260d8fd2c78828ee.zip gcc-3de031c96f28f19a68ea2080260d8fd2c78828ee.tar.gz gcc-3de031c96f28f19a68ea2080260d8fd2c78828ee.tar.bz2 |
PR modula2/113559 FIO.mod lseek requires cssize_t rather than longint
This patch fixes a bug in gcc/m2/gm2-libs/FIO.mod which failed to cast the
whence parameter into the correct type. The patch casts the whence
parameter for lseek to SYSTEM.CSSIZE_T.
gcc/m2/ChangeLog:
PR modula2/113559
* gm2-libs/FIO.mod (SetPositionFromBeginning): Convert pos into
CSSIZE_T during call to lseek.
(SetPositionFromEnd): Convert pos into CSSIZE_T during call to
lseek.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/m2/gm2-libs/FIO.mod | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gcc/m2/gm2-libs/FIO.mod b/gcc/m2/gm2-libs/FIO.mod index 7e0aebe..6755d3d 100644 --- a/gcc/m2/gm2-libs/FIO.mod +++ b/gcc/m2/gm2-libs/FIO.mod @@ -36,7 +36,7 @@ IMPLEMENTATION MODULE FIO ; provides a simple buffered file input/output library. *) -FROM SYSTEM IMPORT ADR, TSIZE, WORD ; +FROM SYSTEM IMPORT ADR, TSIZE, WORD, CSSIZE_T ; FROM ASCII IMPORT nl, nul, tab ; FROM StrLib IMPORT StrLen, StrConCat, StrCopy ; FROM Storage IMPORT ALLOCATE, DEALLOCATE ; @@ -1448,7 +1448,7 @@ BEGIN filled := 0 END END ; - offset := lseek(unixfd, pos, SEEK_SET) ; + offset := lseek (unixfd, VAL (CSSIZE_T, pos), SEEK_SET) ; IF (offset>=0) AND (pos=offset) THEN abspos := pos @@ -1497,7 +1497,7 @@ BEGIN filled := 0 END END ; - offset := lseek(unixfd, pos, SEEK_END) ; + offset := lseek (unixfd, VAL (CSSIZE_T, pos), SEEK_END) ; IF offset>=0 THEN abspos := offset ; |