Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Clean up gcc/g++ compiler warnings that have accumulated.
  • Loading branch information
glennricster committed Dec 10, 2012
1 parent 43d673b commit e85438c
Show file tree
Hide file tree
Showing 42 changed files with 82 additions and 106 deletions.
3 changes: 1 addition & 2 deletions Source/Core/AudioCommon/Src/OpenALStream.cpp
Expand Up @@ -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));
Expand All @@ -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;
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Common/Src/CPUDetect.cpp
Expand Up @@ -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;
}

Expand Down
6 changes: 0 additions & 6 deletions Source/Core/Common/Src/x64Analyzer.cpp
Expand Up @@ -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;

Expand All @@ -47,7 +44,6 @@ bool DisassembleMov(const unsigned char *codePtr, InstructionInfo &info, int acc
}
else if (*codePtr == 0x67)
{
addressSize = 4;
codePtr++;
}

Expand Down Expand Up @@ -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
{
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Common/Src/x64Emitter.cpp
Expand Up @@ -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");
Expand Down Expand Up @@ -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");
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Core/Src/ActionReplay.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -394,7 +393,6 @@ bool RunCode(const ARCode &arcode)
{
LogInfo("ZCode: Memory Copy");
doMemoryCopy = true;
addr_last = addr;
val_last = data;
}
else
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/CoreTiming.cpp
Expand Up @@ -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))
{
Expand Down Expand Up @@ -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))
{
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/DSP/Jit/DSPJitRegCache.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/GeckoCode.cpp
Expand Up @@ -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);
}
Expand Down
3 changes: 0 additions & 3 deletions Source/Core/Core/Src/GeckoCodeConfig.cpp
Expand Up @@ -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])
{

Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions Source/Core/Core/Src/HW/AudioInterface.cpp
Expand Up @@ -354,19 +354,13 @@ 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)
{
frac &= 0xffff;

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;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXWii.cpp
Expand Up @@ -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;

/*
Expand All @@ -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;

Expand Down Expand Up @@ -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;

Expand Down
14 changes: 6 additions & 8 deletions Source/Core/Core/Src/HW/GCMemcard.cpp
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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);

Expand All @@ -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))
{
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
}
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Core/Src/HW/Memmap.cpp
Expand Up @@ -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;

Expand Down
4 changes: 0 additions & 4 deletions Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp
Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp
Expand Up @@ -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())
Expand All @@ -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;
Expand All @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp
Expand Up @@ -285,7 +285,7 @@ bool CWII_IPC_HLE_Device_net_ncd_manage::IOCtlV(u32 _CommandAddress)
{
int x = 0;
int tmpaddress[6];
for (int i = 0; i < SConfig::GetInstance().m_WirelessMac.length() && x < 6; i++)
for (unsigned int i = 0; i < SConfig::GetInstance().m_WirelessMac.length() && x < 6; i++)
{
if (SConfig::GetInstance().m_WirelessMac[i] == ':' || SConfig::GetInstance().m_WirelessMac[i] == '-')
continue;
Expand Down

0 comments on commit e85438c

Please sign in to comment.