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;
(void)::ftime(&tp);
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);
}

View File

@ -95,7 +95,7 @@ std::string CBoot::GenerateMapFilename()
{
u64 TitleID = Loader.GetTitleID();
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";
}
}

View File

@ -23,8 +23,7 @@
#include "MemoryUtil.h"
// english
SRAM sram_dump = {
0x04, 0x6B, 0xFB, 0x91, 0x00, 0x00, 0x00, 0x00,
SRAM sram_dump= {{0x04, 0x6B, 0xFB, 0x91, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0x40,
0x05, 0x00, 0x00, 0x2C, 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,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x86, 0x00, 0xFF, 0x4A, 0x00, 0x00, 0x00, 0x00
};
}};
// german
SRAM sram_dump_german = {
SRAM sram_dump_german = {{
0x1F, 0x66, 0xE0, 0x96, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x04, 0xEA, 0x19, 0x40,
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, 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)

View File

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

View File

@ -52,7 +52,8 @@ distribution.
#pragma pack(push,1)
union SRAM
{
{
u8 p_SRAM[64];
struct _syssram { // Stored configuration value from the system SRAM area
u8 checksum[2]; // holds the 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 __padding1[2]; // padding - libogc has this as [4]? I have it as 2 to make it 64
}syssram;
u8 p_SRAM[64];
};
#pragma pack(pop)
#endif

View File

@ -269,4 +269,5 @@ const CAttribTable& GetAttribTable()
}
return m_AttribTable;
}
}

View File

@ -37,4 +37,5 @@ const CAttribTable& GetAttribTable();
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);
if (untouched_op.OPCD == 1) // Do handle HLE instructions.
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].branchTo = -1;
code[i].branchToIndex = -1;
@ -321,7 +321,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
GekkoOPInfo *opinfo = GetOpInfo(inst);
if (opinfo)
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;
u32 destination;
if (inst.OPCD == 18)
@ -381,7 +381,7 @@ bool Flatten(u32 address, int *realsize, BlockStats *st, BlockRegStats *gpa, Blo
code[i].wantsPS1 = false;
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;
if (flags & FL_TIMER)

View File

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

View File

@ -71,7 +71,7 @@ bool SectorReader::Read(u64 offset, u64 size, u8* out_ptr)
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.
if (positionInBlock == 0 && remain > m_blocksize)
if (positionInBlock == 0 && remain > (u64)m_blocksize)
{
u64 num_blocks = remain / m_blocksize;
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)
{
for (int i = 0; i < num_blocks; i++)
for (u64 i = 0; i < num_blocks; i++)
{
const u8 *data = GetBlockData(block_num + i);
if (!data)

View File

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

View File

@ -76,4 +76,5 @@ private:
}
#endif
#endif

View File

@ -531,4 +531,5 @@ void ConfigDialog::DoRecordMovement(int _x, int _y, int _z, const u8 *_IR, int _
UpdateGUI();
}
}
/////////////////////////////////
/////////////////////////////////

View File

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

View File

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