Fix some sprintf warnings.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@1489 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-12-10 21:24:07 +00:00
parent ff776ce7cf
commit 4d013ec5df
2 changed files with 13 additions and 13 deletions

View File

@ -48,7 +48,7 @@ namespace PPCDisasm
/* typedefs */ /* typedefs */
typedef unsigned long ppc_word; typedef unsigned int ppc_word;
#undef BIGENDIAN #undef BIGENDIAN
#undef LITTTLEENDIAN #undef LITTTLEENDIAN
@ -281,7 +281,7 @@ namespace PPCDisasm
static void ill(struct DisasmPara_PPC *dp,ppc_word in) static void ill(struct DisasmPara_PPC *dp,ppc_word in)
{ {
// strcpy(dp->opcode,".word"); // strcpy(dp->opcode,".word");
// sprintf(dp->operands,"0x%08lx",(unsigned long)in); // sprintf(dp->operands,"0x%08lx",(unsigned int)in);
strcpy(dp->opcode,""); strcpy(dp->opcode,"");
sprintf(dp->operands,""); sprintf(dp->operands,"");
@ -480,7 +480,7 @@ namespace PPCDisasm
static void bc(struct DisasmPara_PPC *dp,ppc_word in) static void bc(struct DisasmPara_PPC *dp,ppc_word in)
{ {
unsigned long d = (int)(in & 0xfffc); unsigned int d = (int)(in & 0xfffc);
int offs; int offs;
char *oper = dp->operands; char *oper = dp->operands;
@ -491,9 +491,9 @@ namespace PPCDisasm
*oper++ = ','; *oper++ = ',';
} }
if (in & 2) /* AA ? */ if (in & 2) /* AA ? */
sprintf(dp->operands,"->0x%.8X",(unsigned long)d); sprintf(dp->operands,"->0x%.8X",(unsigned int)d);
else else
sprintf(oper,"->0x%.8X",(unsigned long)(*dp->iaddr) + d); sprintf(oper,"->0x%.8X",(unsigned int)(*dp->iaddr) + d);
dp->type = PPCINSTR_BRANCH; dp->type = PPCINSTR_BRANCH;
dp->displacement = (ppc_word)d; dp->displacement = (ppc_word)d;
} }
@ -501,15 +501,15 @@ namespace PPCDisasm
static void bli(struct DisasmPara_PPC *dp,ppc_word in) static void bli(struct DisasmPara_PPC *dp,ppc_word in)
{ {
unsigned long d = (unsigned long)(in & 0x3fffffc); unsigned int d = (unsigned int)(in & 0x3fffffc);
if(d & 0x02000000) d |= 0xfc000000; if(d & 0x02000000) d |= 0xfc000000;
sprintf(dp->opcode,"b%s",b_ext[in&3]); sprintf(dp->opcode,"b%s",b_ext[in&3]);
if (in & 2) /* AA ? */ if (in & 2) /* AA ? */
sprintf(dp->operands,"->0x%.8X",(unsigned long)d); sprintf(dp->operands,"->0x%.8X",(unsigned int)d);
else else
sprintf(dp->operands,"->0x%.8X",(unsigned long)(*dp->iaddr) + d); sprintf(dp->operands,"->0x%.8X",(unsigned int)(*dp->iaddr) + d);
dp->type = PPCINSTR_BRANCH; dp->type = PPCINSTR_BRANCH;
dp->displacement = (ppc_word)d; dp->displacement = (ppc_word)d;
} }
@ -813,7 +813,7 @@ namespace PPCDisasm
sprintf(dp->operands,"%s, %s, %d",regnames[a],regnames[s],bsh); sprintf(dp->operands,"%s, %s, %d",regnames[a],regnames[s],bsh);
} }
static const char *ldst_offs(unsigned long val) static const char *ldst_offs(unsigned int val)
{ {
static char buf[8]; static char buf[8];

View File

@ -73,10 +73,10 @@ CUCode_AX::~CUCode_AX()
// ---------------- // ----------------
void CUCode_AX::SaveLogFile(std::string f, int resizeTo, bool type, bool Wii) void CUCode_AX::SaveLogFile(std::string f, int resizeTo, bool type, bool Wii)
{ {
if(gpName.length() > 0) // thios is currently off in the Release build if (gpName.length() > 0) // this is currently off in the Release build
{ {
std::ostringstream ci; std::ostringstream ci;
std::ostringstream cType; std::ostringstream cType;
ci << (resizeTo - 1); // write ci ci << (resizeTo - 1); // write ci
cType << type; // write cType cType << type; // write cType
@ -86,7 +86,7 @@ void CUCode_AX::SaveLogFile(std::string f, int resizeTo, bool type, bool Wii)
FileName += Wii ? "_sepWii_sep" : "_sepGC_sep"; FileName += ".log"; FileName += Wii ? "_sepWii_sep" : "_sepGC_sep"; FileName += ".log";
FILE* fhandle = fopen(FileName.c_str(), "w"); FILE* fhandle = fopen(FileName.c_str(), "w");
fprintf(fhandle, f.c_str()); fprintf(fhandle, "%s", f.c_str());
fflush(fhandle); fhandle = NULL; fflush(fhandle); fhandle = NULL;
} }
} }