Clean up gcc/g++ compiler warnings that have accumulated.

This commit is contained in:
Glenn Rice
2012-12-10 00:40:28 -06:00
parent 43d673b576
commit e85438cba0
42 changed files with 82 additions and 106 deletions
+1 -2
View File
@@ -123,7 +123,6 @@ void OpenALStream::SoundLoop()
{
Common::SetCurrentThreadName("Audio thread - openal");
ALenum err;
u32 ulFrequency = m_mixer->GetSampleRate();
memset(uiBuffers, 0, OAL_NUM_BUFFERS * sizeof(ALuint));
@@ -144,8 +143,8 @@ void OpenALStream::SoundLoop()
// Set the default sound volume as saved in the config file.
alSourcef(uiSource, AL_GAIN, fVolume);
err = alGetError();
// TODO: Error handling
//ALenum err = alGetError();
ALint iBuffersFilled = 0;
ALint iBuffersProcessed = 0;
-2
View File
@@ -173,9 +173,7 @@ void CPUInfo::Detect()
if (max_ex_fn >= 0x80000001) {
// Check for more features.
__cpuid(cpu_id, 0x80000001);
bool cmp_legacy = false;
if (cpu_id[2] & 1) bLAHFSAHF64 = true;
if (cpu_id[2] & 2) cmp_legacy = true; //wtf is this?
if ((cpu_id[3] >> 29) & 1) bLongMode = true;
}
-6
View File
@@ -31,12 +31,9 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
info.hasImmediate = false;
info.isMemoryWrite = false;
int addressSize = 8;
u8 modRMbyte = 0;
u8 sibByte = 0;
bool hasModRM = false;
bool hasSIBbyte = false;
bool hasDisplacement = false;
int displacementSize = 0;
@@ -47,7 +44,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
}
else if (*codePtr == 0x67)
{
addressSize = 4;
codePtr++;
}
@@ -113,7 +109,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
info.otherReg = (sibByte & 7);
if (rex & 2) info.scaledReg += 8;
if (rex & 1) info.otherReg += 8;
hasSIBbyte = true;
}
else
{
@@ -122,7 +117,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
}
if (mrm.mod == 1 || mrm.mod == 2)
{
hasDisplacement = true;
if (mrm.mod == 1)
displacementSize = 1;
else
-2
View File
@@ -870,7 +870,6 @@ void XEmitter::BTC(int bits, OpArg dest, OpArg index) {WriteBitTest(bits, dest,
//shift can be either imm8 or cl
void XEmitter::SHRD(int bits, OpArg dest, OpArg src, OpArg shift)
{
bool writeImm = false;
if (dest.IsImm())
{
_assert_msg_(DYNA_REC, 0, "SHRD - can't use imms as destination");
@@ -901,7 +900,6 @@ void XEmitter::SHRD(int bits, OpArg dest, OpArg src, OpArg shift)
void XEmitter::SHLD(int bits, OpArg dest, OpArg src, OpArg shift)
{
bool writeImm = false;
if (dest.IsImm())
{
_assert_msg_(DYNA_REC, 0, "SHLD - can't use imms as destination");
-2
View File
@@ -285,7 +285,6 @@ bool RunCode(const ARCode &arcode)
// used for conditional codes
int skip_count = 0;
u32 addr_last = 0;
u32 val_last = 0;
current_code = &arcode;
@@ -394,7 +393,6 @@ bool RunCode(const ARCode &arcode)
{
LogInfo("ZCode: Memory Copy");
doMemoryCopy = true;
addr_last = addr;
val_last = data;
}
else
+2 -2
View File
@@ -119,7 +119,7 @@ int RegisterEvent(const char *name, TimedCallback callback)
// check for existing type with same name.
// we want event type names to remain unique so that we can use them for serialization.
for (int i = 0; i < event_types.size(); ++i)
for (unsigned int i = 0; i < event_types.size(); ++i)
{
if (!strcmp(name, event_types[i].name))
{
@@ -188,7 +188,7 @@ void EventDoState(PointerWrap &p, BaseEvent* ev)
if (p.GetMode() == PointerWrap::MODE_READ)
{
bool foundMatch = false;
for (int i = 0; i < event_types.size(); ++i)
for (unsigned int i = 0; i < event_types.size(); ++i)
{
if (!strcmp(name.c_str(), event_types[i].name))
{
@@ -220,8 +220,8 @@ void DSPJitRegCache::flushRegs(DSPJitRegCache &cache, bool emit)
for(i = 0; i <= DSP_REG_MAX_MEM_BACKED; i++) {
if (cache.regs[i].loc.GetSimpleReg() !=
regs[i].loc.GetSimpleReg() &&
xregs[cache.regs[i].loc.GetSimpleReg()].guest_reg ==
DSP_REG_NONE) {
xregs[cache.regs[i].loc.GetSimpleReg()].guest_reg == DSP_REG_NONE)
{
movToHostReg(i,
cache.regs[i].loc.GetSimpleReg(),
true);
+1 -1
View File
@@ -171,7 +171,7 @@ bool InstallCodeHandler()
Memory::Write_U8(1, 0x80001807);
// Invalidate the icache
for (int i = 0; i < data.length(); i += 32)
for (unsigned int i = 0; i < data.length(); i += 32)
{
PowerPC::ppcState.iCache.Invalidate(0x80001800 + i);
}
-3
View File
@@ -42,8 +42,6 @@ void LoadCodes(const IniFile& inifile, std::vector<GeckoCode>& gcodes)
std::istringstream ss(*lines_iter);
int read_state = 0;
switch ((*lines_iter)[0])
{
@@ -61,7 +59,6 @@ void LoadCodes(const IniFile& inifile, std::vector<GeckoCode>& gcodes)
gcode.name = StripSpaces(gcode.name);
// read the code creator name
std::getline(ss, gcode.creator, ']');
read_state = 0;
break;
// notes
@@ -354,9 +354,6 @@ unsigned int Callback_GetStreaming(short* _pDestBuffer, unsigned int _numSamples
static s16 l1 = 0;
static s16 l2 = 0;
static s16 r1 = 0;
static s16 r2 = 0;
if ( frac >= 0x10000 || frac == 0)
{
@@ -364,9 +361,6 @@ unsigned int Callback_GetStreaming(short* _pDestBuffer, unsigned int _numSamples
l1 = l2; //current
l2 = pcm[pos * 2]; //next
r1 = r2; //current
r2 = pcm[pos * 2 + 1]; //next
}
pcm_l = ((l1 << 16) + (l2 - l1) * (u16)frac) >> 16;
@@ -281,7 +281,7 @@ bool CUCode_AX::AXTask(u32& _uMail)
u32 Addr__AXOutSBuffer_1;
u32 Addr__AXOutSBuffer_2;
u32 Addr__A;
u32 Addr__12;
//u32 Addr__12;
u32 Addr__4_1;
u32 Addr__4_2;
//u32 Addr__4_3;
@@ -429,7 +429,7 @@ bool CUCode_AX::AXTask(u32& _uMail)
break;
case 0x0012:
Addr__12 = HLEMemory_Read_U16(uAddress);
//Addr__12 = HLEMemory_Read_U16(uAddress);
uAddress += 2;
break;
@@ -159,8 +159,8 @@ void CUCode_AXWii::Update(int cycles)
bool CUCode_AXWii::AXTask(u32& _uMail)
{
u32 uAddress = _uMail;
u32 Addr__AXStudio;
u32 Addr__AXOutSBuffer;
//u32 Addr__AXStudio;
//u32 Addr__AXOutSBuffer;
bool bExecuteList = true;
/*
@@ -178,7 +178,7 @@ bool CUCode_AXWii::AXTask(u32& _uMail)
switch (iCommand)
{
case 0x0000:
Addr__AXStudio = HLEMemory_Read_U32(uAddress);
//Addr__AXStudio = HLEMemory_Read_U32(uAddress);
uAddress += 4;
break;
@@ -209,7 +209,7 @@ bool CUCode_AXWii::AXTask(u32& _uMail)
break;
case 0x0007: // AXLIST_SBUFFER
Addr__AXOutSBuffer = HLEMemory_Read_U32(uAddress);
//Addr__AXOutSBuffer = HLEMemory_Read_U32(uAddress);
uAddress += 10;
break;
+6 -8
View File
@@ -265,7 +265,7 @@ bool GCMemcard::Save()
mcdFile.WriteBytes(&dir_backup, BLOCK_SIZE);
mcdFile.WriteBytes(&bat, BLOCK_SIZE);
mcdFile.WriteBytes(&bat_backup, BLOCK_SIZE);
for (int i = 0; i < maxBlock - MC_FST_BLOCKS; ++i)
for (unsigned int i = 0; i < maxBlock - MC_FST_BLOCKS; ++i)
{
mcdFile.WriteBytes(mc_data_blocks[i].block, BLOCK_SIZE);
}
@@ -587,7 +587,7 @@ u16 GCMemcard::BlockAlloc::NextFreeBlock(u16 StartingBlock) const
for (u16 i = StartingBlock; i < BAT_SIZE; ++i)
if (Map[i-MC_FST_BLOCKS] == 0)
return i;
for (u16 i = 0; i < StartingBlock; ++i)
for (u16 i = MC_FST_BLOCKS; i < StartingBlock; ++i)
if (Map[i-MC_FST_BLOCKS] == 0)
return i;
}
@@ -609,7 +609,7 @@ bool GCMemcard::BlockAlloc::ClearBlocks(u16 FirstBlock, u16 BlockCount)
{
return false;
}
for (int i = 0; i < length; ++i)
for (unsigned int i = 0; i < length; ++i)
Map[blocks.at(i)-MC_FST_BLOCKS] = 0;
FreeBlocks = BE16(BE16(FreeBlocks) + BlockCount);
@@ -625,7 +625,7 @@ u32 GCMemcard::GetSaveData(u8 index, std::vector<GCMBlock> & Blocks) const
u16 block = DEntry_FirstBlock(index);
u16 BlockCount = DEntry_BlockCount(index);
u16 memcardSize = BE16(hdr.SizeMb) * MBIT_TO_BLOCKS;
//u16 memcardSize = BE16(hdr.SizeMb) * MBIT_TO_BLOCKS;
if ((block == 0xFFFF) || (BlockCount == 0xFFFF))
{
@@ -669,12 +669,10 @@ u32 GCMemcard::ImportFile(DEntry& direntry, std::vector<GCMBlock> &saveBlocks)
Directory UpdatedDir = *CurrentDir;
// find first free dir entry
int index = -1;
for (int i=0; i < DIRLEN; i++)
{
if (BE32(UpdatedDir.Dir[i].Gamecode) == 0xFFFFFFFF)
{
index = i;
UpdatedDir.Dir[i] = direntry;
*(u16*)&UpdatedDir.Dir[i].FirstBlock = BE16(firstBlock);
UpdatedDir.Dir[i].CopyCounter = UpdatedDir.Dir[i].CopyCounter+1;
@@ -887,7 +885,7 @@ u32 GCMemcard::ImportGciInternal(FILE* gcih, const char *inputFile, const std::s
std::vector<GCMBlock> saveData;
saveData.reserve(size);
for (int i = 0; i < size; ++i)
for (unsigned int i = 0; i < size; ++i)
{
GCMBlock b;
gci.ReadBytes(b.block, BLOCK_SIZE);
@@ -1000,7 +998,7 @@ u32 GCMemcard::ExportGci(u8 index, const char *fileName, const std::string &dire
return NOMEMCARD;
}
gci.Seek(DENTRY_SIZE + offset, SEEK_SET);
for (int i = 0; i < size; ++i)
for (unsigned int i = 0; i < size; ++i)
{
gci.WriteBytes(saveData[i].block, BLOCK_SIZE);
}
+2
View File
@@ -656,8 +656,10 @@ u8 *GetPointer(const u32 _Address)
case 0x9:
case 0xd:
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bWii)
{
if ((_Address & 0xfffffff) < EXRAM_SIZE)
return m_pPhysicalEXRAM + (_Address & EXRAM_MASK);
}
else
break;
@@ -262,7 +262,6 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
{
int cmd = *jvs_io++;
int unknown = 0;
DEBUG_LOG(AMBASEBOARDDEBUG, "JVS IO, node=%d, cmd=%02x", node, cmd);
switch (cmd)
@@ -362,10 +361,7 @@ int CSIDevice_AMBaseboard::RunBuffer(u8* _pBuffer, int _iLength)
}
case 0xf0:
if (*jvs_io++ == 0xD9)
{
ERROR_LOG(AMBASEBOARDDEBUG, "JVS RESET");
} else
unknown = 1;
msg.addData(1);
d10_1 |= 1;
@@ -621,7 +621,7 @@ void Wiimote::DoState(PointerWrap& p)
//Do 'm_read_requests' queue
{
u32 size;
u32 size = 0;
if (p.mode == PointerWrap::MODE_READ)
{
//clear
@@ -512,8 +512,6 @@ void StateChange(EMUSTATE_CHANGE newState)
// TODO: disable/enable auto reporting, maybe
}
#define ARRAYSIZE(_arr) (sizeof(_arr)/(sizeof(_arr[0])))
bool IsValidBluetoothName(const char* name) {
static const char* kValidWiiRemoteBluetoothNames[] = {
"Nintendo RVL-CNT-01",
+1 -1
View File
@@ -321,7 +321,7 @@ void ExecuteCommand(u32 _Address)
bool CmdSuccess = false;
ECommandType Command = static_cast<ECommandType>(Memory::Read_U32(_Address));
volatile int DeviceID = Memory::Read_U32(_Address + 8);
volatile u32 DeviceID = Memory::Read_U32(_Address + 8);
IWII_IPC_HLE_Device* pDevice = (DeviceID >= 0 && DeviceID < IPC_MAX_FDS) ? g_FdMap[DeviceID] : NULL;
@@ -183,8 +183,8 @@ void CWII_IPC_HLE_Device_FileIO::CloseFile()
bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
{
u32 ReturnValue = FS_RESULT_FATAL;
const s32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC);
const s32 Mode = Memory::Read_U32(_CommandAddress + 0x10);
const u32 SeekPosition = Memory::Read_U32(_CommandAddress + 0xC);
const u32 Mode = Memory::Read_U32(_CommandAddress + 0x10);
if (OpenFile())
@@ -205,7 +205,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
}
case 1:
{
s32 wantedPos = SeekPosition+m_SeekPos;
u32 wantedPos = SeekPosition+m_SeekPos;
if (wantedPos >=0 && wantedPos <= fileSize)
{
m_SeekPos = wantedPos;
@@ -215,7 +215,7 @@ bool CWII_IPC_HLE_Device_FileIO::Seek(u32 _CommandAddress)
}
case 2:
{
s32 wantedPos = fileSize+m_SeekPos;
u64 wantedPos = fileSize+m_SeekPos;
if (wantedPos >=0 && wantedPos <= fileSize)
{
m_SeekPos = wantedPos;
@@ -789,7 +789,8 @@ bool CWII_IPC_HLE_Device_es::IOCtlV(u32 _CommandAddress)
{
static CWII_IPC_HLE_Device_usb_oh1_57e_305* s_Usb = GetUsbPointer();
bool* wiiMoteConnected = new bool[s_Usb->m_WiiMotes.size()];
for(int i = 0; i < s_Usb->m_WiiMotes.size(); i++) wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected();
for(unsigned int i = 0; i < s_Usb->m_WiiMotes.size();
i++) wiiMoteConnected[i] = s_Usb->m_WiiMotes[i].IsConnected();
std::string tContentFile(m_ContentFile.c_str());
WII_IPC_HLE_Interface::Reset(true);

Some files were not shown because too many files have changed in this diff Show More