* sim/ucsim/cmd.src/newcmdposix.cc, sim/ucsim/cmd.src/newcmdposixcl.h,
[fw/sdcc] / link / z80 / lksym.c
index dac3479cd51b1702acffd8aed392e622ca8e7775..33cc6ffb9b097a98f084bda491a9151f29aac59b 100644 (file)
@@ -11,7 +11,7 @@
 
 #include <stdio.h>
 #include <string.h>
-//#include <alloc.h>
+#include <stdlib.h>
 #include "aslink.h"
 
 /*)Module      lksym.c
@@ -56,7 +56,6 @@
 VOID
 syminit()
 {
-       register int h;
        struct sym **spp;
 
        spp = &symhash[0];
@@ -124,7 +123,9 @@ syminit()
 struct sym *
 newsym()
 {
-       register int c, i, nglob;
+    register unsigned i ;
+    register unsigned nglob ;
+       register int c ;
        struct sym *tsp;
        struct sym **s;
        char id[NCPS];
@@ -176,7 +177,9 @@ newsym()
        }
        fprintf(stderr, "Header symbol list overflow\n");
        lkexit(1);
+
        /* Never reached */
+        return 0;
 }
 
 /*)Function    sym *   lkpsym(id,f)
@@ -348,7 +351,7 @@ symmod(fp, tsp)
 FILE *fp;
 struct sym *tsp;
 {
-       register int i, j;
+    register int i;
        struct sym **p;
 
        if ((hp = headp) != NULL) {
@@ -402,7 +405,7 @@ register char *p1, *p2;
                if (*p1++ != *p2++)
                        return (0);
 #else
-               if (ccase[*p1++] != ccase[*p2++])
+               if (ccase[(unsigned char)(*p1++)] != ccase[(unsigned char)(*p2++)])
                        return (0);
 #endif
 
@@ -446,7 +449,7 @@ register char *p;
 #if    CASE_SENSITIVE
                h += *p++;
 #else
-               h += ccase[*p++];
+               h += ccase[(unsigned char)(*p++)];
 #endif
 
        } while (--n);