Removed all warnings from as and link
authormichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 28 Jun 2001 01:52:33 +0000 (01:52 +0000)
committermichaelh <michaelh@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Thu, 28 Jun 2001 01:52:33 +0000 (01:52 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@975 4a8a32a2-be11-0410-ad9d-d568d2c75423

as/z80/asexpr.c
as/z80/assym.c
as/z80/z80adr.c
link/Makefile
link/z80/aslink.h
link/z80/lkeval.c
link/z80/lklist.c
link/z80/lkmain.c
link/z80/lkrloc.c
link/z80/lksym.c

index e6fa421c69b3eda4a5102576711d2b622d1bf179..2664550db4d31b42763ae8ef2cb8eaabcf85c05b 100644 (file)
@@ -273,7 +273,7 @@ register struct expr *esp;
         char id[NCPS];
         struct sym  *sp;
         struct tsym *tp;
-        int r, v;
+        int r = 0, v;
 
         c = getnb();
        /*
@@ -347,7 +347,7 @@ register struct expr *esp;
         if (ctype[c] & DIGIT) {
                 esp->e_mode = S_USER;
                 jp = ip;
-                 while (ctype[*jp] & RAD10) {
+                 while (ctype[(unsigned char)(*jp)] & RAD10) {
                         jp++;
                 }
                 if (*jp == '$') {
index f57f5f994519c5ef33c51b556b5003b57bc3ed4f..1ef7cc7675e9fdee89a542ec5a994e0c571c1f92 100644 (file)
@@ -353,7 +353,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
 
@@ -396,7 +396,7 @@ register char *p;
 #if    CASE_SENSITIVE
                h += *p++;
 #else
-               h += ccase[*p++];
+               h += ccase[(unsigned char)(*p++)];
 #endif
 
        } while (--n);
index f0d428ec931aeb4318662e398fba807ed0b6d788..d47b8eba4c105f1b820d7e088c7a50753d85e5b9 100644 (file)
@@ -37,7 +37,7 @@ int
 addr(esp)
 register struct expr *esp;
 {
-       register int c, mode, indx;
+       register int c, mode = 0, indx;
 
        if ((c = getnb()) == '#') {
                expr(esp, 0);
@@ -62,7 +62,7 @@ register struct expr *esp;
                        esp->e_mode = S_INDM;
                }
                if (indx) {
-                       esp->e_mode = mode + indx&0xFF;
+                       esp->e_mode = (mode + indx)&0xFF;
                        esp->e_base.e_ap = NULL;
                }
                if ((c = getnb()) != RTIND)
@@ -159,12 +159,12 @@ register char *str;
        }
 #else
        while (*ptr && *str) {
-               if (ccase[*ptr] != ccase[*str])
+               if (ccase[(unsigned char)(*ptr)] != ccase[(unsigned char)(*str)])
                        break;
                ptr++;
                str++;
        }
-       if (ccase[*ptr] == ccase[*str]) {
+       if (ccase[(unsigned char)(*ptr)] == ccase[(unsigned char)(*str)]) {
                ip = ptr;
                return(1);
        }
index 1b9ce6524f5d1299832e6f1fc558dc243880f27d..213d609529149bd7a21dec5f65ed496bb8c2084c 100644 (file)
@@ -10,6 +10,5 @@ all:
 clean:
        $(MAKE) -C z80 clean
 
-
 # dummy install target to prevent warnings
 install:
index 47a03a482f4b3dce6c856f173c672a4ed139695d..9ef08c54ea233d437aadf8567f6c0a101109b9f3 100644 (file)
 /*
  * File types
  */
+#define F_INV  0               /* invalid */
 #define        F_STD   1               /* stdin */
 #define        F_LNK   2               /* File.lnk */
 #define        F_REL   3               /* File.rel */
@@ -712,3 +713,8 @@ extern      VOID            s19();
 
 /* lkihx.c */
 extern VOID            ihx();
+
+/* lkgb.h */
+VOID gb(int in);
+VOID gg(int in);
+
index 183e54b2d8e601478da81fc639c1b10146ace9ce..2dff89bee6853237d8f5a680ba1f8052398c55d1 100644 (file)
@@ -303,6 +303,8 @@ term()
                        return(symval(sp));
                }
        }
+        /* Shouldn't get here. */
+        return 0;
 }
 
 /*)Function    int     digit(c, r)
index ff892b1b1c5cbe683730f31206b2a23708bb83b8..6b9b1c587ec3e5c68121c76579bcadb5c2b0fb18 100644 (file)
@@ -337,7 +337,7 @@ VOID lstarea(struct area *xp)
        register struct areax *oxp;
        register int i, j;
        int nmsym;
-       Addr_T a0, ai, aj;
+       Addr_T a0, ai = 0, aj = 0;
        struct sym *sp;
        struct sym **p;
 
@@ -1263,7 +1263,7 @@ char *str;
        int i;
 
        for (i=0; i<n; i++) {
-               if ((ctype[*str++] & rdx) == 0)
+               if ((ctype[(unsigned char)(*str++)] & rdx) == 0)
                        return(0);
        }
        return(1);
index 681c790200afed5bad43d4e19eaa7a7de6e2cab3..745504b8495c52eac4e17914b8c009e08610c404 100644 (file)
@@ -16,6 +16,7 @@
 #include <string.h>
 //#include <alloc.h>
 #include "aslink.h"
+#include <stdlib.h>
 
 #ifndef SDK_VERSION_STRING
 #define SDK_VERSION_STRING     "3.0.0"
@@ -243,7 +244,7 @@ char *argv[];
                        }
                }
        }
-       if (startp->f_type == NULL)
+       if (startp->f_type == F_INV)
                usage();
        if (startp->f_type == F_LNK && startp->f_idp == NULL)
                usage();
@@ -261,7 +262,7 @@ char *argv[];
                        break;
                if (pflag && sfp != stdin)
                        fprintf(stdout, "%s\n", ip);
-               if (*ip == NULL || parse())
+               if (*ip == '\0' || parse())
                        break;
        }
        if (sfp)
@@ -376,6 +377,9 @@ char *argv[];
                }
        }
        lkexit(lkerr);
+
+        /* Never get here. */
+        return 0;
 }
 
 /*)Function    VOID    lkexit(i)
@@ -771,6 +775,9 @@ VOID map()
 #endif /* MLH_MAP */
 
 #ifdef SDK
+/* PENDING */
+VOID lstareatosym(struct area *xp);
+
 VOID sym()
 {
        /*
@@ -886,8 +893,6 @@ parse()
                                                        while(get() != '"')
                                                                ;
                                        } else if(c == 'P' || c == 'p') {
-                                               unsigned int addr;
-                                               unsigned char value;
                                                patch *p = patches;
 
                                                patches = (patch *)malloc(sizeof(patch));
index 0f2d6ad0238af3358f6e82ede26e64edc4440885..0746dbbebefa4df0de7719734ea31505a169a2c3 100644 (file)
@@ -15,7 +15,9 @@
 
 #include <stdio.h>
 #include <string.h>
+#include <stdlib.h>
 //#include <alloc.h>
+#include <ctype.h>
 #include "aslink.h"
 
 /*)Module      lkrloc.c
@@ -251,7 +253,7 @@ relr()
        register int mode;
        register Addr_T reli, relv;
        int aindex, rindex, rtp, error;
-       Addr_T r, rtbase, rtofst, paga, pags, pc;
+       Addr_T r, rtbase, rtofst, paga = 0, pags = 0, pc;
        struct areax **a;
        struct sym **s;
 
index 19c80ee16f9525428f2e5b6e2a983a0d9e7266ea..8699da8e0844a407102401424689e2faca4155b5 100644 (file)
@@ -175,7 +175,9 @@ newsym()
        }
        fprintf(stderr, "Header symbol list overflow\n");
        lkexit(1);
+
        /* Never reached */
+        return 0;
 }
 
 /*)Function    sym *   lkpsym(id,f)
@@ -401,7 +403,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
 
@@ -445,7 +447,7 @@ register char *p;
 #if    CASE_SENSITIVE
                h += *p++;
 #else
-               h += ccase[*p++];
+               h += ccase[(unsigned char)(*p++)];
 #endif
 
        } while (--n);