changeset 550:cfb21030b240

Minor tweaks for building on a 64-bit host, and remove an unnecessary local variable.
author Rob Landley <rob@landley.net>
date Thu, 17 Jan 2008 22:59:03 -0600
parents 26c8edc8b79f
children d8b3fa09ca5d
files tcc.c tcc.h
diffstat 2 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/tcc.c	Mon Jan 14 22:38:23 2008 -0600
+++ b/tcc.c	Thu Jan 17 22:59:03 2008 -0600
@@ -808,7 +808,7 @@
 }
 
 /* push, without hashing */
-static Sym *sym_push2(Sym **ps, int v, int t, int c)
+static Sym *sym_push2(Sym **ps, int v, int t, long c)
 {
     Sym *s;
     s = sym_malloc();
@@ -1584,7 +1584,7 @@
 {
     Sym *s;
 
-    s = sym_push2(&define_stack, v, macro_type, (int)str);
+    s = sym_push2(&define_stack, v, macro_type, (long)str);
     s->next = first_arg;
     table_ident[v - TOK_IDENT]->sym_define = s;
 }
@@ -3226,7 +3226,7 @@
                     next_nomacro();
                 }
                 tok_str_add(&str, 0, 0);
-                sym_push2(&args, sa->v & ~SYM_FIELD, sa->type.t, (int)str.str);
+                sym_push2(&args, sa->v & ~SYM_FIELD, sa->type.t, (long)str.str);
                 sa = sa->next;
                 if (tok == ')') {
                     /* special case for gcc var args: add an empty
@@ -7132,8 +7132,7 @@
         skip(')');
         a = gtst(1, 0);
         block(bsym, csym, case_sym, def_sym, case_reg, 0);
-        c = tok;
-        if (c == TOK_ELSE) {
+        if (tok == TOK_ELSE) {
             next();
             d = gjmp(0);
             gsym(a);
--- a/tcc.h	Mon Jan 14 22:38:23 2008 -0600
+++ b/tcc.h	Thu Jan 17 22:59:03 2008 -0600
@@ -166,7 +166,7 @@
 typedef struct Sym {
     int v;    /* symbol token */
     int r;    /* associated register */
-    int c;    /* associated number */
+    long c;    /* associated number */
     CType type;    /* associated type */
     struct Sym *next; /* next related symbol */
     struct Sym *prev; /* prev symbol in stack */