* as/hc08/asmain.c, as/mcs51/asmain.c:
[fw/sdcc] / as / z80 / asexpr.c
index 4490cdc3f80fa261be93154a2513a7c08dcc18f2..2664550db4d31b42763ae8ef2cb8eaabcf85c05b 100644 (file)
 #include <setjmp.h>
 #include <string.h>
 
-#if !defined(_MSC_VER)
-#include <alloc.h>
-#endif
-
 #include "asm.h"
 
 /*)Module      asexpr.c
@@ -32,7 +28,7 @@
  *
  *     asexpr.c contains the following functions:
  *             VOID    abscheck()
- *             addr_t  absexpr()
+ *             Addr_T  absexpr()
  *             VOID    clrexpr()
  *             int     digit()
  *             VOID    expr()
@@ -88,7 +84,7 @@ expr(esp, n)
 register struct expr *esp;
 int n;
 {
-        register int c, d, p;
+        register int c, p;
         struct area *ap;
         struct expr re;
 
@@ -190,7 +186,7 @@ int n;
         unget(c);
 }
 
-/*)Function    addr_t  absexpr()
+/*)Function    Addr_T  absexpr()
  *
  *     The function absexpr() evaluates an expression, verifies it
  *     is absolute (i.e. not position dependent or relocatable), and
@@ -212,7 +208,7 @@ int n;
  *             a 'r' error is reported.
  */
 
-addr_t
+Addr_T
 absexpr()
 {
         struct expr e;
@@ -277,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();
        /*
@@ -299,7 +295,7 @@ register struct expr *esp;
         if (c == '-') {
                 expr(esp, 100);
                 abscheck(esp);
-                esp->e_addr = -esp->e_addr;
+                esp->e_addr = 0 - esp->e_addr;
                 return;
         }
         if (c == '~') {
@@ -351,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 == '$') {