1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-01-25 19:46:21 +00:00

Correct integer type warnings (#405)

* Correct warning: cast to smaller integer type -- X_init/lispbitmap

* Fixes to INTRSAFE, INTRSAFE0 and ensure TIMEOUT, TIMEOUT0 used appropriately

INTRSAFE and INTRSAFE0 must clear errno before executing the library or system
call because not all library calls set errno on success.
Avoid casting pointers or larger integer values down to smaller ints before
comparing to 0 or -1, and use NULL (a pointer) rather than 0.

Fix cases where the result of the library call is a pointer rather than an int
to use TIMEOUT0 instead of TIMEOUT, testing for NULL rather than -1
on timeout (errno == EINTR)

* Remove useless validity check of LASTVMEMFILEPAGE_word pointer

* Convert pointer arithmetic type in drawline from int to ptrdiff_t

* Add NOTE warning about a 32-bit vs 64-bit issue affecting currently unused GET_NATIVE_ADDR_FROM_LISP_PTR
This commit is contained in:
Nick Briggs
2021-11-04 09:08:55 -07:00
committed by GitHub
parent 6c241f1eaa
commit de5ea2110f
11 changed files with 26 additions and 31 deletions

View File

@@ -659,7 +659,7 @@ int makepathname(char *src, char *dst)
#ifdef DOS
pwd = 0;
#else
TIMEOUT(pwd = getpwuid(getuid()));
TIMEOUT0(pwd = getpwuid(getuid()));
#endif /* DOS */
if (pwd == NULL) {
*Lisp_errno = errno;
@@ -678,7 +678,7 @@ int makepathname(char *src, char *dst)
strncpy(name, base + 1, len);
name[len] = '\0';
#ifndef DOS
TIMEOUT(pwd = getpwnam(name));
TIMEOUT0(pwd = getpwnam(name));
#endif /* DOS */
if (pwd == NULL) {
*Lisp_errno = errno;