/* symbol management */
typedef struct Sym {
- int v; /* symbol token */
- int r; /* associated register */
- int c; /* associated number */
+ long v; /* symbol token */
+ long r; /* associated register */
+ long c; /* associated number */
CType type; /* associated type */
struct Sym *next; /* next related symbol */
struct Sym *prev; /* prev symbol in stack */
rsym: return symbol
anon_sym: anonymous symbol index
*/
-static int rsym, anon_sym, ind, loc;
+static long rsym, anon_sym, ind, loc;
/* expression generation modifiers */
static int const_wanted; /* true if constant wanted */
static int nocode_wanted; /* true if no code generation wanted for an expression */
static CType func_vt; /* current function return type (used by return
instruction) */
static int func_vc;
-static int last_line_num, last_ind, func_ind; /* debug last line number and pc */
+static long last_line_num, last_ind, func_ind; /* debug last line number and pc */
static int tok_ident;
static TokenSym **table_ident;
static TokenSym *hash_ident[TOK_HASH_SIZE];
}
/* generate a jump to a label */
-int gjmp(int t)
+long gjmp(int t)
{
return psym(0xe9, t);
}
}
/* push, without hashing */
-static Sym *sym_push2(Sym **ps, int v, int t, int c)
+static Sym *sym_push2(Sym **ps, long v, long t, long c)
{
Sym *s;
s = sym_malloc();
{
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;
}
next_nomacro();
}
tok_str_add(&str, 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
}
tok_str_add(&func_str, -1);
tok_str_add(&func_str, 0);
- sym->r = (int)func_str.str;
+ sym->r = (long)func_str.str;
} else {
/* compute text section */
cur_text_section = ad.section;
/* NOTE: the same name space as C labels is used to avoid using too
much memory when storing labels in TokenStrings */
static void asm_new_label1(TCCState *s1, int label, int is_local,
- int sh_num, int value)
+ int sh_num, long value)
{
Sym *sym;