Fix some cases of variables being used uninitialized. Also some unused

variables, writeable strings and dangerously shadowed variables.

index(), gamma(), exp() and y0() are POSIX functions and using those
names can cause namespace confusion.

A number of C files were missing the final newline required by ANSI C
and some versions of GCC are pedantic enough to complain about this.

These changes simply the scons build, allowing us to get rid of
filterWarnings which is simply more trouble than it's worth.


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5574 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2010-06-02 20:35:12 +00:00
parent 03d1438be8
commit 30e437f9e3
85 changed files with 212 additions and 284 deletions

View File

@ -389,7 +389,7 @@ typedef unsigned int ppc_word;
{
const char *cnd;
if (cnd = trap_condition[PPCGETD(in)]) {
if ((cnd = trap_condition[PPCGETD(in)]) != NULL) {
dp->flags |= dmode;
sprintf(dp->opcode,"t%c%s",dmode?'d':'w',cnd);
imm(dp,in,0,2,0);
@ -408,7 +408,7 @@ typedef unsigned int ppc_word;
if (i)
dp->flags |= PPCF_64;
sprintf(dp->opcode,"%si",cmpname[uimm*2+i]);
if (i = (int)PPCGETCRD(in)) {
if ((i = (int)PPCGETCRD(in))) {
sprintf(oper,"cr%c,",'0'+i);
dp->operands += 4;
}
@ -491,7 +491,7 @@ typedef unsigned int ppc_word;
if (d & 0x8000) d |= 0xffff0000;
if (offs = branch(dp,in,"",(in&2)?1:0,d)) {
if ((offs = branch(dp,in,"",(in&2)?1:0,d))) {
oper += offs;
*oper++ = ',';
}
@ -619,7 +619,7 @@ typedef unsigned int ppc_word;
if (i)
dp->flags |= PPCF_64;
strcpy(dp->opcode,cmpname[((in&PPCIDX2MASK)?2:0)+i]);
if (i = (int)PPCGETCRD(in))
if ((i = (int)PPCGETCRD(in)))
oper += sprintf(oper,"cr%c,",'0'+i);
ra_rb(oper,in);
}
@ -633,7 +633,7 @@ typedef unsigned int ppc_word;
const char *cnd;
int to = (int)PPCGETD(in);
if (cnd = trap_condition[to]) {
if ((cnd = trap_condition[to])) {
dp->flags |= dmode;
sprintf(dp->opcode,"t%c%s",dmode?'d':'w',cnd);
ra_rb(dp->operands,in);
@ -991,7 +991,6 @@ typedef unsigned int ppc_word;
static void ps(struct DisasmPara_PPC *dp,ppc_word inst)
{
ppc_word pc = *dp->iaddr;
char *op = dp->opcode;
char *pr = dp->operands;
switch ((inst>>1)&0x1F)
@ -1015,7 +1014,7 @@ typedef unsigned int ppc_word;
return;
case 23:
strcpy(op, "ps_sel");
sprintf(pr, "p%u>=0?p%u:p%u", FD, FA, FC, FB);
sprintf(pr, "p%u>=0?p%u:p%u", FD, FA, FC);
return;
case 24:
strcpy(op, "ps_res");
@ -1094,19 +1093,19 @@ typedef unsigned int ppc_word;
return;
case 0:
strcpy(op, "ps_cmpu0");
sprintf(pr, "ps_cmpu0", FD);
sprintf(pr, "ps_cmpu0");
return;
case 32:
strcpy(op,"ps_cmpq0");
sprintf(pr, "ps_cmpo0", FD);
sprintf(pr, "ps_cmpo0");
return;
case 64:
strcpy(op,"ps_cmpu1");
sprintf(pr, "ps_cmpu1", FD);
sprintf(pr, "ps_cmpu1");
return;
case 96:
strcpy(op,"ps_cmpo1");
sprintf(pr, "ps_cmpo1", FD);
sprintf(pr, "ps_cmpo1");
return;
case 528:
strcpy(op,"ps_merge00");
@ -1126,7 +1125,7 @@ typedef unsigned int ppc_word;
return;
case 1014:
strcpy(op,"dcbz_l");
sprintf(pr, "");
*pr = '\0';
return;
}
@ -1138,7 +1137,6 @@ typedef unsigned int ppc_word;
static void ps_mem(struct DisasmPara_PPC *dp,ppc_word inst)
{
ppc_word pc = *dp->iaddr;
char *op = dp->opcode;
char *pr = dp->operands;
switch (PPCGETIDX(inst))
@ -1149,7 +1147,7 @@ typedef unsigned int ppc_word;
break;
case 57:
strcpy(op,"psq_lu");
sprintf(pr, "", FD);
*pr = '\0';
break;
case 60:
strcpy(op,"psq_st");

View File

@ -14,9 +14,4 @@ files = [
if sys.platform == 'win32':
files += [ "stdafx.cpp" ]
env_bochs = env.Clone(
CCFLAGS = env.filterWarnings(env['CCFLAGS']),
CXXFLAGS = env.filterWarnings(env['CXXFLAGS']),
)
env_bochs.StaticLibrary(env['local_libs'] + "bdisasm", files)
env.StaticLibrary(env['local_libs'] + "bdisasm", files)