removed warnings

This commit is contained in:
bellard 2004-11-07 15:43:15 +00:00
parent 1d0e5e8b01
commit 6bbfb8f610
3 changed files with 18 additions and 9 deletions

View file

@ -136,7 +136,8 @@ void o(unsigned long i)
static unsigned long stuff_const(unsigned long op,unsigned long c) static unsigned long stuff_const(unsigned long op,unsigned long c)
{ {
int try_neg=0; int try_neg=0;
unsigned long nc,negop; unsigned long nc = 0,negop = 0;
switch(op&0x1F00000) switch(op&0x1F00000)
{ {
case 0x800000: //add case 0x800000: //add
@ -901,8 +902,8 @@ int gtst(int inv, int t)
/* generate an integer binary operation */ /* generate an integer binary operation */
void gen_opi(int op) void gen_opi(int op)
{ {
int c, func; int c, func = 0;
unsigned long opc,r,fr; unsigned long opc = 0,r,fr;
c=0; c=0;
switch(op) { switch(op) {
@ -989,6 +990,7 @@ void gen_opi(int op)
default: default:
opc = 0x15; opc = 0x15;
c=1; c=1;
break;
} }
switch(c) { switch(c) {
case 1: case 1:

View file

@ -1551,7 +1551,7 @@ void C67_SHR(int r, int v)
/* load 'r' from value 'sv' */ /* load 'r' from value 'sv' */
void load(int r, SValue * sv) void load(int r, SValue * sv)
{ {
int v, t, ft, fc, fr, size, element; int v, t, ft, fc, fr, size = 0, element;
BOOL Unsigned = false; BOOL Unsigned = false;
SValue v1; SValue v1;
@ -1873,7 +1873,7 @@ static void gcall_or_jmp(int is_jmp)
context. Stack entry is popped */ context. Stack entry is popped */
void gfunc_call(int nb_args) void gfunc_call(int nb_args)
{ {
int i, r, size; int i, r, size = 0;
int args_sizes[NoCallArgsPassedOnStack]; int args_sizes[NoCallArgsPassedOnStack];
if (nb_args > NoCallArgsPassedOnStack) { if (nb_args > NoCallArgsPassedOnStack) {
@ -2518,12 +2518,14 @@ void gen_cvt_ftof(int t)
r = vtop->r; r = vtop->r;
if (r == TREG_EAX) // make sure the paired reg is avail if (r == TREG_EAX) { // make sure the paired reg is avail
r2 = get_reg(RC_ECX); r2 = get_reg(RC_ECX);
else if (r == TREG_EDX) } else if (r == TREG_EDX) {
r2 = get_reg(RC_ST0); r2 = get_reg(RC_ST0);
else } else {
ALWAYS_ASSERT(FALSE); ALWAYS_ASSERT(FALSE);
r2 = 0; /* avoid warning */
}
C67_SPDP(r, r); // convert it to DP same register C67_SPDP(r, r); // convert it to DP same register
C67_NOP(1); C67_NOP(1);

View file

@ -448,9 +448,12 @@ static void relocate_section(TCCState *s1, Section *s)
Section *sr; Section *sr;
Elf32_Rel *rel, *rel_end, *qrel; Elf32_Rel *rel, *rel_end, *qrel;
Elf32_Sym *sym; Elf32_Sym *sym;
int type, sym_index, esym_index; int type, sym_index;
unsigned char *ptr; unsigned char *ptr;
unsigned long val, addr; unsigned long val, addr;
#if defined(TCC_TARGET_I386)
int esym_index;
#endif
sr = s->reloc; sr = s->reloc;
rel_end = (Elf32_Rel *)(sr->data + sr->data_offset); rel_end = (Elf32_Rel *)(sr->data + sr->data_offset);
@ -662,10 +665,12 @@ static void put32(unsigned char *p, uint32_t val)
p[3] = val >> 24; p[3] = val >> 24;
} }
#if defined(TCC_TARGET_I386) || defined(TCC_TARGET_ARM)
static uint32_t get32(unsigned char *p) static uint32_t get32(unsigned char *p)
{ {
return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24); return p[0] | (p[1] << 8) | (p[2] << 16) | (p[3] << 24);
} }
#endif
static void build_got(TCCState *s1) static void build_got(TCCState *s1)
{ {