fix some gcc warnings

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2590 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
LPFaint99 2009-03-07 08:07:11 +00:00
parent 251179b00b
commit f0431631a8
15 changed files with 33 additions and 20 deletions

View File

@ -196,7 +196,7 @@ std::string Timer::GetTimeFormatted()
struct timeb tp; struct timeb tp;
(void)::ftime(&tp); (void)::ftime(&tp);
char temp[32]; char temp[32];
sprintf(temp, "%02hi:%02i:%03i", tp.time/60, tp.time%60, tp.millitm); sprintf(temp, "%02ld:%02ld:%03i", tp.time/60, tp.time%60, tp.millitm);
return std::string(temp); return std::string(temp);
} }

View File

@ -95,7 +95,7 @@ std::string CBoot::GenerateMapFilename()
{ {
u64 TitleID = Loader.GetTitleID(); u64 TitleID = Loader.GetTitleID();
char tmpBuffer[32]; char tmpBuffer[32];
sprintf(tmpBuffer, "%08x_%08x", TitleID>32, TitleID); sprintf(tmpBuffer, "%08x_%08x", (u32)(TitleID >> 32) & 0xFFFFFFFF , (u32)TitleID & 0xFFFFFFFF );
return FULL_MAPS_DIR + std::string(tmpBuffer) + ".map"; return FULL_MAPS_DIR + std::string(tmpBuffer) + ".map";
} }
} }

View File

@ -23,8 +23,7 @@
#include "MemoryUtil.h" #include "MemoryUtil.h"
// english // english
SRAM sram_dump = { SRAM sram_dump= {{0x04, 0x6B, 0xFB, 0x91, 0x00, 0x00, 0x00, 0x00,
0x04, 0x6B, 0xFB, 0x91, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x40, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x40,
0x05, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x2C, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@ -32,10 +31,10 @@ SRAM sram_dump = {
0x21, 0x27, 0xD1, 0x53, 0x00, 0x00, 0x00, 0x00, 0x21, 0x27, 0xD1, 0x53, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x86, 0x00, 0xFF, 0x4A, 0x00, 0x00, 0x00, 0x00 0x86, 0x00, 0xFF, 0x4A, 0x00, 0x00, 0x00, 0x00
}; }};
// german // german
SRAM sram_dump_german = { SRAM sram_dump_german = {{
0x1F, 0x66, 0xE0, 0x96, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x66, 0xE0, 0x96, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x04, 0xEA, 0x19, 0x40, 0x00, 0x00, 0x00, 0x00, 0x04, 0xEA, 0x19, 0x40,
0x00, 0x00, 0x01, 0x3C, 0x12, 0xD5, 0xEA, 0xD3, 0x00, 0x00, 0x01, 0x3C, 0x12, 0xD5, 0xEA, 0xD3,
@ -44,7 +43,7 @@ SRAM sram_dump_german = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x84, 0xFF, 0x00, 0x00, 0x00, 0x00 0x00, 0x00, 0x84, 0xFF, 0x00, 0x00, 0x00, 0x00
}; }};
// We should provide an option to choose from the above, or figure out the checksum (the algo in yagcd seems wrong) // We should provide an option to choose from the above, or figure out the checksum (the algo in yagcd seems wrong)

View File

@ -94,6 +94,10 @@ ISIDevice* SIDevice_Create(TSIDevices _SIDevice, int _iDeviceNumber)
case SI_GBA: case SI_GBA:
return new CSIDevice_GBA(_iDeviceNumber); return new CSIDevice_GBA(_iDeviceNumber);
break; break;
default:
return new CSIDevice_Dummy(_iDeviceNumber);
break;
} }
return NULL; return NULL;

View File

@ -53,6 +53,7 @@ distribution.
#pragma pack(push,1) #pragma pack(push,1)
union SRAM union SRAM
{ {
u8 p_SRAM[64];
struct _syssram { // Stored configuration value from the system SRAM area struct _syssram { // Stored configuration value from the system SRAM area
u8 checksum[2]; // holds the block checksum. u8 checksum[2]; // holds the block checksum.
u8 checksum_inv[2]; // holds the inverse block checksum u8 checksum_inv[2]; // holds the inverse block checksum
@ -73,7 +74,6 @@ union SRAM
u8 flashID_chksum[4]; // 16bit checksum of unlock flash ID u8 flashID_chksum[4]; // 16bit checksum of unlock flash ID
u8 __padding1[2]; // padding - libogc has this as [4]? I have it as 2 to make it 64 u8 __padding1[2]; // padding - libogc has this as [4]? I have it as 2 to make it 64
}syssram; }syssram;
u8 p_SRAM[64];
}; };
#pragma pack(pop) #pragma pack(pop)
#endif #endif

View File

@ -270,3 +270,4 @@ const CAttribTable& GetAttribTable()
return m_AttribTable; return m_AttribTable;
} }

View File

@ -38,3 +38,4 @@ const CAttribTable& GetAttribTable();
const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size); const u8* GetAttribPacket(u32 serviceHandle, u32 cont, u32& _size);
#endif #endif

View File

@ -313,7 +313,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
UGeckoInstruction untouched_op = Memory::ReadUnchecked_U32(code[i].address); UGeckoInstruction untouched_op = Memory::ReadUnchecked_U32(code[i].address);
if (untouched_op.OPCD == 1) // Do handle HLE instructions. if (untouched_op.OPCD == 1) // Do handle HLE instructions.
inst = untouched_op; inst = untouched_op;
_assert_msg_(GEKKO, inst.hex != 0, "Zero Op - Error flattening %08x op %08x", address + i*4, inst); _assert_msg_(GEKKO, inst.hex != 0, "Zero Op - Error flattening %08x op %08x", address + i*4, inst.hex);
code[i].inst = inst; code[i].inst = inst;
code[i].branchTo = -1; code[i].branchTo = -1;
code[i].branchToIndex = -1; code[i].branchToIndex = -1;
@ -321,7 +321,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
GekkoOPInfo *opinfo = GetOpInfo(inst); GekkoOPInfo *opinfo = GetOpInfo(inst);
if (opinfo) if (opinfo)
numCycles += opinfo->numCyclesMinusOne + 1; numCycles += opinfo->numCyclesMinusOne + 1;
_assert_msg_(GEKKO, opinfo != 0, "Invalid Op - Error flattening %08x op %08x", address + i*4, inst); _assert_msg_(GEKKO, opinfo != 0, "Invalid Op - Error flattening %08x op %08x", address + i*4, inst.hex);
bool follow = false; bool follow = false;
u32 destination; u32 destination;
if (inst.OPCD == 18) if (inst.OPCD == 18)
@ -381,7 +381,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
code[i].wantsPS1 = false; code[i].wantsPS1 = false;
const GekkoOPInfo *opinfo = GetOpInfo(code[i].inst); const GekkoOPInfo *opinfo = GetOpInfo(code[i].inst);
_assert_msg_(GEKKO, opinfo != 0, "Invalid Op - Error scanning %08x op %08x",address+i*4,inst); _assert_msg_(GEKKO, opinfo != 0, "Invalid Op - Error scanning %08x op %08x",address+i*4,inst.hex);
int flags = opinfo->flags; int flags = opinfo->flags;
if (flags & FL_TIMER) if (flags & FL_TIMER)

View File

@ -131,6 +131,8 @@ CBannerLoaderGC::GetName(std::string _rName[])
} }
break; break;
default:
break;
} }
return returnCode; return returnCode;
@ -196,6 +198,8 @@ CBannerLoaderGC::GetDescription(std::string* _rDescription)
returnCode = true; returnCode = true;
} }
break; break;
default:
break;
} }
return returnCode; return returnCode;
} }

View File

@ -71,7 +71,7 @@ bool SectorReader::Read(u64 offset, u64 size, u8* out_ptr)
while (remain > 0) while (remain > 0)
{ {
// Check if we are ready to do a large block read. > instead of >= so we don't bother if remain is only one block. // Check if we are ready to do a large block read. > instead of >= so we don't bother if remain is only one block.
if (positionInBlock == 0 && remain > m_blocksize) if (positionInBlock == 0 && remain > (u64)m_blocksize)
{ {
u64 num_blocks = remain / m_blocksize; u64 num_blocks = remain / m_blocksize;
ReadMultipleAlignedBlocks(block, num_blocks, out_ptr); ReadMultipleAlignedBlocks(block, num_blocks, out_ptr);
@ -110,7 +110,7 @@ bool SectorReader::Read(u64 offset, u64 size, u8* out_ptr)
bool SectorReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *out_ptr) bool SectorReader::ReadMultipleAlignedBlocks(u64 block_num, u64 num_blocks, u8 *out_ptr)
{ {
for (int i = 0; i < num_blocks; i++) for (u64 i = 0; i < num_blocks; i++)
{ {
const u8 *data = GetBlockData(block_num + i); const u8 *data = GetBlockData(block_num + i);
if (!data) if (!data)

View File

@ -100,9 +100,9 @@ namespace DiscIO
void DriveReader::GetBlock(u64 block_num, u8 *out_ptr) void DriveReader::GetBlock(u64 block_num, u8 *out_ptr)
{ {
u32 NotUsed;
u8 * lpSector = new u8[m_blocksize]; u8 * lpSector = new u8[m_blocksize];
#ifdef _WIN32 #ifdef _WIN32
u32 NotUsed;
u64 offset = m_blocksize * block_num; u64 offset = m_blocksize * block_num;
LONG off_low = (LONG)offset & 0xFFFFFFFF; LONG off_low = (LONG)offset & 0xFFFFFFFF;
LONG off_high = (LONG)(offset >> 32); LONG off_high = (LONG)(offset >> 32);

View File

@ -77,3 +77,4 @@ private:
} }
#endif #endif

View File

@ -532,3 +532,4 @@ void ConfigDialog::DoRecordMovement(int _x, int _y, int _z, const u8 *_IR, int _
} }
} }
///////////////////////////////// /////////////////////////////////

View File

@ -74,3 +74,4 @@ KeyboardClassicController g_Cc;
} // namespace } // namespace
#endif //_EMU_DECLARATIONS_ #endif //_EMU_DECLARATIONS_

View File

@ -64,3 +64,4 @@ bool IRDataOK(struct wiimote_t* wm);
}; // WiiMoteReal }; // WiiMoteReal
#endif #endif