lisp: Clean up compiler warnings

Mainly a 64bit port to support sizeof(int) != sizeof(void*)
This commit is contained in:
Darryl L. Miles 2025-07-18 15:35:06 +01:00 committed by R. Timothy Edwards
parent a7fed2b744
commit be83d2954d
2 changed files with 18 additions and 18 deletions

View File

@ -90,11 +90,11 @@ char *LispNewString (s)
h = HashLookOnly (&Strings, s); h = HashLookOnly (&Strings, s);
if (h) if (h)
i = (int) HashGetValue(h); i = (int) (pointertype) HashGetValue(h);
else { else {
i = nstrings++; i = nstrings++;
h = HashFind (&Strings, s); h = HashFind (&Strings, s);
HashSetValue (h, i); HashSetValue (h, (pointertype) i);
} }
return h->h_key.h_name; return h->h_key.h_name;
} }
@ -126,7 +126,7 @@ LispStringId (s)
if (!h) if (!h)
i = -1; i = -1;
else else
i = (int)HashGetValue (h); i = (int) (pointertype) HashGetValue (h);
return i; return i;
} }

View File

@ -92,9 +92,9 @@ _LispPrint (fp,l)
HashEntry *h; HashEntry *h;
int i; int i;
if (SigInterruptPending) return; if (SigInterruptPending) return;
h = HashLookOnly (&PrintTable, l); h = HashLookOnly (&PrintTable, (const char *)l);
if (h) { if (h) {
i = (int) HashGetValue (h); i = (int) (pointertype) HashGetValue (h);
if (i) { if (i) {
/* i > 0 */ /* i > 0 */
if (fp == stdout) TxPrintf ("#%d", i); if (fp == stdout) TxPrintf ("#%d", i);
@ -103,7 +103,7 @@ _LispPrint (fp,l)
} }
else { else {
/* not printed; set the print tag */ /* not printed; set the print tag */
HashSetValue (h, ++num_refs); HashSetValue (h, (pointertype) ++num_refs);
if (fp == stdout) TxPrintf ("#%d:", num_refs); if (fp == stdout) TxPrintf ("#%d:", num_refs);
else fprintf (fp, "#%d:", num_refs); else fprintf (fp, "#%d:", num_refs);
} }
@ -141,9 +141,9 @@ _LispPrint (fp,l)
while ((LTYPE(CDR(s)) == S_LIST) && LLIST(CDR(s))) { while ((LTYPE(CDR(s)) == S_LIST) && LLIST(CDR(s))) {
if (fp == stdout) TxPrintf (" "); if (fp == stdout) TxPrintf (" ");
else fprintf (fp, " "); else fprintf (fp, " ");
h = HashLookOnly (&PrintTable, CDR(s)); h = HashLookOnly (&PrintTable, (const char *) CDR(s));
if (h) { if (h) {
i = (int) HashGetValue (h); i = (int) (pointertype) HashGetValue (h);
if (i) { if (i) {
/* i > 0 */ /* i > 0 */
if (fp == stdout) TxPrintf ("#%d", i); if (fp == stdout) TxPrintf ("#%d", i);
@ -152,7 +152,7 @@ _LispPrint (fp,l)
} }
else { else {
/* not printed; set the print tag */ /* not printed; set the print tag */
HashSetValue (h, ++num_refs); HashSetValue (h, (pointertype) ++num_refs);
if (fp == stdout) TxPrintf ("#%d:", num_refs); if (fp == stdout) TxPrintf ("#%d:", num_refs);
else fprintf (fp, "#%d:", num_refs); else fprintf (fp, "#%d:", num_refs);
} }
@ -198,14 +198,14 @@ _LispGenTable (l)
HashEntry *h; HashEntry *h;
int i; int i;
if (SigInterruptPending) return; if (SigInterruptPending) return;
h = HashLookOnly (&GenTable, l); h = HashLookOnly (&GenTable, (const char *) l);
if (h) { if (h) {
i = (int) HashGetValue (h); i = (int) (pointertype) HashGetValue (h);
i++; i++;
HashSetValue (h, i); HashSetValue (h, (pointertype) i);
return; return;
} }
h = HashFind (&GenTable, l); h = HashFind (&GenTable, (const char *) l);
HashSetValue (h, 0); HashSetValue (h, 0);
switch (LTYPE(l)) { switch (LTYPE(l)) {
case S_INT: case S_INT:
@ -222,14 +222,14 @@ _LispGenTable (l)
s = LLIST(l); s = LLIST(l);
_LispGenTable (CAR(s)); _LispGenTable (CAR(s));
while ((LTYPE(CDR(s)) == S_LIST) && LLIST(CDR(s))) { while ((LTYPE(CDR(s)) == S_LIST) && LLIST(CDR(s))) {
h = HashLookOnly (&GenTable, CDR(s)); h = HashLookOnly (&GenTable, (const char *) CDR(s));
if (h) { if (h) {
i = (int) HashGetValue (h); i = (int) (pointertype) HashGetValue (h);
i++; i++;
HashSetValue (h, i); HashSetValue (h, (pointertype) i);
return; return;
} }
h = HashFind (&GenTable, CDR(s)); h = HashFind (&GenTable, (const char *) CDR(s));
HashSetValue (h, 0); HashSetValue (h, 0);
s = LLIST(CDR(s)); s = LLIST(CDR(s));
_LispGenTable (CAR(s)); _LispGenTable (CAR(s));
@ -264,7 +264,7 @@ LispPrint (fp, l)
_LispGenTable (l); _LispGenTable (l);
HashStartSearch (&hs); HashStartSearch (&hs);
while (h = HashNext (&GenTable, &hs)) { while (h = HashNext (&GenTable, &hs)) {
i = (int) HashGetValue (h); i = (int) (pointertype) HashGetValue (h);
if (i) { if (i) {
h = HashFind (&PrintTable, h->h_key.h_ptr); h = HashFind (&PrintTable, h->h_key.h_ptr);
HashSetValue (h, 0); HashSetValue (h, 0);