From e85438cba05c88d088a26572e88e3996b38d88ed Mon Sep 17 00:00:00 2001 From: Glenn Rice Date: Mon, 10 Dec 2012 00:40:28 -0600 Subject: [PATCH] Clean up gcc/g++ compiler warnings that have accumulated. --- Source/Core/AudioCommon/Src/OpenALStream.cpp | 3 +-- Source/Core/Common/Src/CPUDetect.cpp | 2 -- Source/Core/Common/Src/x64Analyzer.cpp | 6 ------ Source/Core/Common/Src/x64Emitter.cpp | 2 -- Source/Core/Core/Src/ActionReplay.cpp | 2 -- Source/Core/Core/Src/CoreTiming.cpp | 4 ++-- Source/Core/Core/Src/DSP/Jit/DSPJitRegCache.cpp | 4 ++-- Source/Core/Core/Src/GeckoCode.cpp | 2 +- Source/Core/Core/Src/GeckoCodeConfig.cpp | 3 --- Source/Core/Core/Src/HW/AudioInterface.cpp | 6 ------ Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp | 4 ++-- .../Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXWii.cpp | 8 ++++---- Source/Core/Core/Src/HW/GCMemcard.cpp | 14 ++++++-------- Source/Core/Core/Src/HW/Memmap.cpp | 2 ++ Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp | 4 ---- .../Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp | 2 +- .../Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp | 2 -- Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp | 2 +- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp | 8 ++++---- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp | 3 ++- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp | 2 +- .../Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp | 8 ++++---- Source/Core/Core/Src/Movie.cpp | 6 +++--- Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp | 8 ++++---- Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp | 4 ++-- Source/Core/Core/Src/State.cpp | 2 +- Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp | 4 ++-- Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp | 1 - Source/Core/DolphinWX/Src/FrameTools.cpp | 3 +-- Source/Core/DolphinWX/Src/GameListCtrl.cpp | 2 +- Source/Core/DolphinWX/Src/ISOFile.cpp | 2 +- Source/Core/DolphinWX/Src/ISOProperties.cpp | 3 +-- Source/Core/DolphinWX/Src/Main.cpp | 6 +++--- Source/Core/DolphinWX/Src/X11Utils.cpp | 2 +- .../Src/ControllerInterface/Xlib/Xlib.cpp | 4 +++- Source/Core/VideoCommon/Src/DLCache.cpp | 8 ++++---- Source/Core/VideoCommon/Src/PixelShaderGen.cpp | 5 +++-- Source/Core/VideoCommon/Src/PixelShaderManager.cpp | 1 + Source/Core/VideoCommon/Src/VertexLoader.cpp | 10 +++++----- .../Core/VideoCommon/Src/VertexLoaderManager.cpp | 9 +++++---- .../Core/VideoCommon/Src/VertexShaderManager.cpp | 1 + .../Plugin_VideoSoftware/Src/SWVertexLoader.cpp | 14 +++++++------- 42 files changed, 82 insertions(+), 106 deletions(-) diff --git a/Source/Core/AudioCommon/Src/OpenALStream.cpp b/Source/Core/AudioCommon/Src/OpenALStream.cpp index 99220f0ed2..2abd357782 100644 --- a/Source/Core/AudioCommon/Src/OpenALStream.cpp +++ b/Source/Core/AudioCommon/Src/OpenALStream.cpp @@ -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; diff --git a/Source/Core/Common/Src/CPUDetect.cpp b/Source/Core/Common/Src/CPUDetect.cpp index 93e9d25087..65cd6dbd0b 100644 --- a/Source/Core/Common/Src/CPUDetect.cpp +++ b/Source/Core/Common/Src/CPUDetect.cpp @@ -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; } diff --git a/Source/Core/Common/Src/x64Analyzer.cpp b/Source/Core/Common/Src/x64Analyzer.cpp index 2ea3e9a512..66a2fe217f 100644 --- a/Source/Core/Common/Src/x64Analyzer.cpp +++ b/Source/Core/Common/Src/x64Analyzer.cpp @@ -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 diff --git a/Source/Core/Common/Src/x64Emitter.cpp b/Source/Core/Common/Src/x64Emitter.cpp index d4bd1adabf..19e96478d1 100644 --- a/Source/Core/Common/Src/x64Emitter.cpp +++ b/Source/Core/Common/Src/x64Emitter.cpp @@ -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"); diff --git a/Source/Core/Core/Src/ActionReplay.cpp b/Source/Core/Core/Src/ActionReplay.cpp index 1ef6ca81bc..77f5778061 100644 --- a/Source/Core/Core/Src/ActionReplay.cpp +++ b/Source/Core/Core/Src/ActionReplay.cpp @@ -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 diff --git a/Source/Core/Core/Src/CoreTiming.cpp b/Source/Core/Core/Src/CoreTiming.cpp index bccadf30cc..525f7165f2 100644 --- a/Source/Core/Core/Src/CoreTiming.cpp +++ b/Source/Core/Core/Src/CoreTiming.cpp @@ -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)) { diff --git a/Source/Core/Core/Src/DSP/Jit/DSPJitRegCache.cpp b/Source/Core/Core/Src/DSP/Jit/DSPJitRegCache.cpp index 6bcbeca35e..ee5908889a 100644 --- a/Source/Core/Core/Src/DSP/Jit/DSPJitRegCache.cpp +++ b/Source/Core/Core/Src/DSP/Jit/DSPJitRegCache.cpp @@ -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); diff --git a/Source/Core/Core/Src/GeckoCode.cpp b/Source/Core/Core/Src/GeckoCode.cpp index 35b2f53392..2d5f694ded 100644 --- a/Source/Core/Core/Src/GeckoCode.cpp +++ b/Source/Core/Core/Src/GeckoCode.cpp @@ -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); } diff --git a/Source/Core/Core/Src/GeckoCodeConfig.cpp b/Source/Core/Core/Src/GeckoCodeConfig.cpp index a23d531f7e..10c2068e3e 100644 --- a/Source/Core/Core/Src/GeckoCodeConfig.cpp +++ b/Source/Core/Core/Src/GeckoCodeConfig.cpp @@ -42,8 +42,6 @@ void LoadCodes(const IniFile& inifile, std::vector& 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& gcodes) gcode.name = StripSpaces(gcode.name); // read the code creator name std::getline(ss, gcode.creator, ']'); - read_state = 0; break; // notes diff --git a/Source/Core/Core/Src/HW/AudioInterface.cpp b/Source/Core/Core/Src/HW/AudioInterface.cpp index f4141818ae..0a33e7c773 100644 --- a/Source/Core/Core/Src/HW/AudioInterface.cpp +++ b/Source/Core/Core/Src/HW/AudioInterface.cpp @@ -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; diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp index 74c9d24db4..9524882a45 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AX.cpp @@ -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; diff --git a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXWii.cpp b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXWii.cpp index bc50269037..1bbf8a9838 100644 --- a/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXWii.cpp +++ b/Source/Core/Core/Src/HW/DSPHLE/UCodes/UCode_AXWii.cpp @@ -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; diff --git a/Source/Core/Core/Src/HW/GCMemcard.cpp b/Source/Core/Core/Src/HW/GCMemcard.cpp index 9b72a0313c..dd15a32914 100644 --- a/Source/Core/Core/Src/HW/GCMemcard.cpp +++ b/Source/Core/Core/Src/HW/GCMemcard.cpp @@ -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 & 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 &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 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); } diff --git a/Source/Core/Core/Src/HW/Memmap.cpp b/Source/Core/Core/Src/HW/Memmap.cpp index 1156d456ad..2da999eeac 100644 --- a/Source/Core/Core/Src/HW/Memmap.cpp +++ b/Source/Core/Core/Src/HW/Memmap.cpp @@ -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; diff --git a/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp b/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp index 897b6d1227..3537ed3747 100644 --- a/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp +++ b/Source/Core/Core/Src/HW/SI_DeviceAMBaseboard.cpp @@ -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; diff --git a/Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp b/Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp index 91882b2cb7..5c34fff9ac 100644 --- a/Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp +++ b/Source/Core/Core/Src/HW/WiimoteEmu/EmuSubroutines.cpp @@ -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 diff --git a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp index c5dedba409..28ce6106c7 100644 --- a/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp +++ b/Source/Core/Core/Src/HW/WiimoteReal/WiimoteReal.cpp @@ -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", diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp index afa2b2ceb0..9508762742 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE.cpp @@ -321,7 +321,7 @@ void ExecuteCommand(u32 _Address) bool CmdSuccess = false; ECommandType Command = static_cast(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; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp index 15214317d2..6b490a1922 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_FileIO.cpp @@ -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; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp index fe53d46b0c..f409c88c83 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_es.cpp @@ -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); diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp index df058a470d..0ac752e867 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_net.cpp @@ -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; diff --git a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp index 47a6712b68..af10e98d60 100644 --- a/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp +++ b/Source/Core/Core/Src/IPC_HLE/WII_IPC_HLE_Device_usb.cpp @@ -1467,9 +1467,9 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::CommandWriteLinkPolicy(u8* _Input) DEBUG_LOG(WII_IPC_WIIMOTE, " ConnectionHandle: 0x%04x", pLinkPolicy->con_handle); DEBUG_LOG(WII_IPC_WIIMOTE, " Policy: 0x%04x", pLinkPolicy->settings); - hci_write_link_policy_settings_rp Reply; - Reply.status = 0x00; - Reply.con_handle = pLinkPolicy->con_handle; + //hci_write_link_policy_settings_rp Reply; + //Reply.status = 0x00; + //Reply.con_handle = pLinkPolicy->con_handle; SendEventCommandStatus(HCI_CMD_WRITE_LINK_POLICY_SETTINGS); @@ -1878,4 +1878,4 @@ void CWII_IPC_HLE_Device_usb_oh1_57e_305::LOG_LinkKey(const u8* _pLinkKey) , _pLinkKey[0], _pLinkKey[1], _pLinkKey[2], _pLinkKey[3], _pLinkKey[4], _pLinkKey[5], _pLinkKey[6], _pLinkKey[7] , _pLinkKey[8], _pLinkKey[9], _pLinkKey[10], _pLinkKey[11], _pLinkKey[12], _pLinkKey[13], _pLinkKey[14], _pLinkKey[15]); -} \ No newline at end of file +} diff --git a/Source/Core/Core/Src/Movie.cpp b/Source/Core/Core/Src/Movie.cpp index e4f3fb3f29..69120b2b9b 100644 --- a/Source/Core/Core/Src/Movie.cpp +++ b/Source/Core/Core/Src/Movie.cpp @@ -663,19 +663,19 @@ void ReadHeader() } videoBackend.resize(ARRAYSIZE(tmpHeader.videoBackend)); - for (int i = 0; i < ARRAYSIZE(tmpHeader.videoBackend);i++) + for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.videoBackend);i++) { videoBackend[i] = tmpHeader.videoBackend[i]; } g_discChange.resize(ARRAYSIZE(tmpHeader.discChange)); - for (int i = 0; i < ARRAYSIZE(tmpHeader.discChange);i++) + for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.discChange);i++) { g_discChange[i] = tmpHeader.discChange[i]; } author.resize(ARRAYSIZE(tmpHeader.author)); - for (int i = 0; i < ARRAYSIZE(tmpHeader.author);i++) + for (unsigned int i = 0; i < ARRAYSIZE(tmpHeader.author);i++) { author[i] = tmpHeader.author[i]; } diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp index 5aaf4b99f1..3d88d687e0 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp @@ -1097,7 +1097,7 @@ void Jit64::mulli(UGeckoInstruction inst) gpr.BindToRegister(d, (d == a), true); if (imm == 0) XOR(32, gpr.R(d), gpr.R(d)); - else if(imm == -1) + else if(imm == (u32)-1) { if (d != a) MOV(32, gpr.R(d), gpr.R(a)); @@ -1147,7 +1147,7 @@ void Jit64::mullwx(UGeckoInstruction inst) int src = gpr.R(a).IsImm() ? b : a; if (imm == 0) XOR(32, gpr.R(d), gpr.R(d)); - else if(imm == -1) + else if(imm == (u32)-1) { if (d != src) MOV(32, gpr.R(d), gpr.R(src)); @@ -1263,7 +1263,7 @@ void Jit64::divwux(UGeckoInstruction inst) while(!(divisor & (1 << shift))) shift--; - if (divisor == (1 << shift)) + if (divisor == (u32)(1 << shift)) { gpr.Lock(a, b, d); gpr.BindToRegister(d, d == a, true); @@ -1387,7 +1387,7 @@ void Jit64::divwx(UGeckoInstruction inst) if (gpr.R(a).IsImm() && gpr.R(b).IsImm()) { s32 i = (s32)gpr.R(a).offset, j = (s32)gpr.R(b).offset; - if( j == 0 || i == 0x80000000 && j == -1) + if( j == 0 || (i == (s32)0x80000000 && j == -1)) { gpr.SetImmediate32(d, (i >> 31) ^ j); if (inst.OE) diff --git a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp index e91291fa90..ce47e2c3ac 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64IL/IR_X86.cpp @@ -472,10 +472,10 @@ static OpArg regBuildMemAddress(RegInfo& RI, InstLoc I, InstLoc AI, #else // 64-bit if (Profiled) { - RI.Jit->LEA(32, EAX, M((void*)addr)); + RI.Jit->LEA(32, EAX, M((void*)(u64)addr)); return MComplex(RBX, EAX, SCALE_1, 0); } - return M((void*)addr); + return M((void*)(u64)addr); #endif } } diff --git a/Source/Core/Core/Src/State.cpp b/Source/Core/Core/Src/State.cpp index d9ad3c6b5c..a532ace217 100644 --- a/Source/Core/Core/Src/State.cpp +++ b/Source/Core/Core/Src/State.cpp @@ -71,7 +71,7 @@ static Common::Event g_compressAndDumpStateSyncEvent; static std::thread g_save_thread; // Don't forget to increase this after doing changes on the savestate system -static const int STATE_VERSION = 10; +static const u32 STATE_VERSION = 10; struct StateHeader { diff --git a/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp b/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp index 0b6b366c88..2917f1637d 100644 --- a/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp +++ b/Source/Core/DolphinWX/Src/Debugger/CodeWindow.cpp @@ -319,7 +319,7 @@ void CCodeWindow::UpdateLists() { int idx = callers->Append(wxString::FromAscii(StringFromFormat ("< %s (%08x)", caller_symbol->name.c_str(), caller_addr).c_str())); - callers->SetClientData(idx, (void*)caller_addr); + callers->SetClientData(idx, (void*)(u64)caller_addr); } } @@ -332,7 +332,7 @@ void CCodeWindow::UpdateLists() { int idx = calls->Append(wxString::FromAscii(StringFromFormat ("> %s (%08x)", call_symbol->name.c_str(), call_addr).c_str())); - calls->SetClientData(idx, (void*)call_addr); + calls->SetClientData(idx, (void*)(u64)call_addr); } } } diff --git a/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp b/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp index 4579af762a..b5caf139d6 100644 --- a/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp +++ b/Source/Core/DolphinWX/Src/FifoPlayerDlg.cpp @@ -624,7 +624,6 @@ void FifoPlayerDlg::OnObjectListSelectionChanged(wxCommandEvent& event) int cmd = *objectdata++; int stream_size = Common::swap16(objectdata); objectdata += 2; - int vertex_size = (objectdata_end - objectdata) / stream_size; wxString newLabel = wxString::Format(wxT("%08X: %02X %04X "), obj_offset, cmd, stream_size); if ((objectdata_end - objectdata) % stream_size) newLabel += _("NOTE: Stream size doesn't match actual data length\n"); while (objectdata < objectdata_end) diff --git a/Source/Core/DolphinWX/Src/FrameTools.cpp b/Source/Core/DolphinWX/Src/FrameTools.cpp index 9011d5e844..98649be181 100644 --- a/Source/Core/DolphinWX/Src/FrameTools.cpp +++ b/Source/Core/DolphinWX/Src/FrameTools.cpp @@ -1320,9 +1320,8 @@ void CFrame::StatusBarMessage(const char * Text, ...) const int MAX_BYTES = 1024*10; char Str[MAX_BYTES]; va_list ArgPtr; - int Cnt; va_start(ArgPtr, Text); - Cnt = vsnprintf(Str, MAX_BYTES, Text, ArgPtr); + vsnprintf(Str, MAX_BYTES, Text, ArgPtr); va_end(ArgPtr); if (this->GetStatusBar()->IsEnabled()) this->GetStatusBar()->SetStatusText(wxString::FromAscii(Str),0); diff --git a/Source/Core/DolphinWX/Src/GameListCtrl.cpp b/Source/Core/DolphinWX/Src/GameListCtrl.cpp index 5a24f6726e..5312c4fabd 100644 --- a/Source/Core/DolphinWX/Src/GameListCtrl.cpp +++ b/Source/Core/DolphinWX/Src/GameListCtrl.cpp @@ -652,7 +652,7 @@ void CGameListCtrl::ScanForISOs() for (std::vector::const_iterator iter = drives.begin(); iter != drives.end(); ++iter) { - std::auto_ptr gli(new GameListItem(*iter)); + std::unique_ptr gli(new GameListItem(*iter)); if (gli->IsValid()) m_ISOFiles.push_back(gli.release()); diff --git a/Source/Core/DolphinWX/Src/ISOFile.cpp b/Source/Core/DolphinWX/Src/ISOFile.cpp index 9734e97131..a3d3761e62 100644 --- a/Source/Core/DolphinWX/Src/ISOFile.cpp +++ b/Source/Core/DolphinWX/Src/ISOFile.cpp @@ -285,7 +285,7 @@ bool GameListItem::GetName(std::wstring& wName, int index) const index++; if ((index >=0) && (index < 10)) { - if (m_wNames.size() > index) + if (m_wNames.size() > (size_t)index) { wName = m_wNames[index]; return true; diff --git a/Source/Core/DolphinWX/Src/ISOProperties.cpp b/Source/Core/DolphinWX/Src/ISOProperties.cpp index f004989055..61139d985f 100644 --- a/Source/Core/DolphinWX/Src/ISOProperties.cpp +++ b/Source/Core/DolphinWX/Src/ISOProperties.cpp @@ -687,14 +687,13 @@ void CISOProperties::OnExtractFile(wxCommandEvent& WXUNUSED (event)) void CISOProperties::ExportDir(const char* _rFullPath, const char* _rExportFolder, const int partitionNum) { char exportName[512]; - u32 index[2] = {0, 0}, offsetShift = 0; + u32 index[2] = {0, 0}; std::vector fst; DiscIO::IFileSystem *FS = 0; if (DiscIO::IsVolumeWiiDisc(OpenISO)) { FS = WiiDisc.at(partitionNum).FileSystem; - offsetShift = 2; } else FS = pFileSystem; diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 59c77f1e32..8236513304 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -105,7 +105,7 @@ bool DolphinApp::OnInit() bool UseDebugger = false; bool UseLogger = false; bool selectVideoBackend = false; - bool selectAudioEmulation = false; + //bool selectAudioEmulation = false; wxString videoBackendName; wxString audioEmulationName; @@ -167,8 +167,8 @@ bool DolphinApp::OnInit() selectVideoBackend = parser.Found(wxT("video_backend"), &videoBackendName); // TODO: This currently has no effect. Implement or delete. - selectAudioEmulation = parser.Found(wxT("audio_emulation"), - &audioEmulationName); + //selectAudioEmulation = parser.Found(wxT("audio_emulation"), + // &audioEmulationName); #endif // wxUSE_CMDLINE_PARSER #if defined _DEBUG && defined _WIN32 diff --git a/Source/Core/DolphinWX/Src/X11Utils.cpp b/Source/Core/DolphinWX/Src/X11Utils.cpp index fe4cd70829..da21c41cb2 100644 --- a/Source/Core/DolphinWX/Src/X11Utils.cpp +++ b/Source/Core/DolphinWX/Src/X11Utils.cpp @@ -225,7 +225,7 @@ void XRRConfiguration::Update() } else sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.strFullscreenResolution.c_str(), - "%a[^:]: %ux%u", &output_name, &fullWidth, &fullHeight); + "%m[^:]: %ux%u", &output_name, &fullWidth, &fullHeight); for (int i = 0; i < screenResources->noutput; i++) { diff --git a/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp b/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp index 450080bfd2..c2030a059d 100644 --- a/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp +++ b/Source/Core/InputCommon/Src/ControllerInterface/Xlib/Xlib.cpp @@ -1,5 +1,7 @@ #include "Xlib.h" +#include + namespace ciface { namespace Xlib @@ -93,7 +95,7 @@ KeyboardMouse::Key::Key(Display* const display, KeyCode keycode, const char* key KeySym keysym = 0; do { - keysym = XKeycodeToKeysym(m_display, keycode, i); + keysym = XkbKeycodeToKeysym(m_display, keycode, i, 0); i++; } while (keysym == NoSymbol && i < 8); diff --git a/Source/Core/VideoCommon/Src/DLCache.cpp b/Source/Core/VideoCommon/Src/DLCache.cpp index 5499fa26f1..c828ea3a03 100644 --- a/Source/Core/VideoCommon/Src/DLCache.cpp +++ b/Source/Core/VideoCommon/Src/DLCache.cpp @@ -361,9 +361,9 @@ u32 AnalyzeAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl) (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, numVertices); num_draw_call++; - const int tc[12] = { + const u32 tc[12] = { g_VtxDesc.Position, g_VtxDesc.Normal, g_VtxDesc.Color0, g_VtxDesc.Color1, g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord, - g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3) + g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3) }; for(int i = 0; i < 12; i++) { @@ -563,9 +563,9 @@ void CompileAndRunDisplayList(u32 address, u32 size, CachedDisplayList *dl) dl->InsertRegion(NewRegion); memcpy(NewRegion->start_address, StartAddress, Vdatasize); emitter.ABI_CallFunctionCCCP((void *)&VertexLoaderManager::RunCompiledVertices, cmd_byte & GX_VAT_MASK, (cmd_byte & GX_PRIMITIVE_MASK) >> GX_PRIMITIVE_SHIFT, numVertices, NewRegion->start_address); - const int tc[12] = { + const u32 tc[12] = { g_VtxDesc.Position, g_VtxDesc.Normal, g_VtxDesc.Color0, g_VtxDesc.Color1, g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord, - g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3) + g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3) }; for(int i = 0; i < 12; i++) { diff --git a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp index bc7a12304f..bb4d833034 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderGen.cpp @@ -131,6 +131,8 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo for (unsigned int i = 0; i < bpmem.genMode.numtexgens; ++i) { + // TODO: This is all wrong. i in the else clause will always be out of range as a + // subscript for xfregs.texMtxInfo. NeoBrain?? if (18+i < 32) uid->values[0] |= xfregs.texMtxInfo[i].projection << (18+i); // 1 else @@ -158,7 +160,7 @@ void GetPixelShaderId(PIXELSHADERUID *uid, DSTALPHA_MODE dstAlphaMode, u32 compo } u32* ptr = &uid->values[2]; - for (unsigned int i = 0; i < bpmem.genMode.numtevstages+1; ++i) + for (int i = 0; i < bpmem.genMode.numtevstages+1; ++i) { StageHash(i, ptr); ptr += 4; // max: ptr = &uid->values[66] @@ -626,7 +628,6 @@ const char *GeneratePixelShaderCode(DSTALPHA_MODE dstAlphaMode, API_TYPE ApiType } WRITE(p, " ) {\n"); - char* pmainstart = p; int Pretest = AlphaPreTest(); if(Pretest >= 0 && !DepthTextureEnable) { diff --git a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp index 1533f9348e..f195cd805b 100644 --- a/Source/Core/VideoCommon/Src/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/PixelShaderManager.cpp @@ -302,6 +302,7 @@ void PixelShaderManager::SetConstants() float GC_ALIGNED16(material[4]); float NormalizationCoef = 1 / 255.0f; + // TODO: This code is wrong. i goes out of range for xfregs.ambColor. for (int i = 0; i < 4; ++i) { if (nMaterialsChanged & (1 << i)) diff --git a/Source/Core/VideoCommon/Src/VertexLoader.cpp b/Source/Core/VideoCommon/Src/VertexLoader.cpp index fb34ce1bc1..5bffab8ee7 100644 --- a/Source/Core/VideoCommon/Src/VertexLoader.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoader.cpp @@ -224,14 +224,14 @@ void VertexLoader::CompileVertexTranslator() #endif // Colors - const int col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1}; + const u32 col[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1}; // TextureCoord // Since m_VtxDesc.Text7Coord is broken across a 32 bit word boundary, retrieve its value manually. // If we didn't do this, the vertex format would be read as one bit offset from where it should be, making // 01 become 00, and 10/11 become 01 - const int tc[8] = { + const u32 tc[8] = { m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord, - m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (const int)((m_VtxDesc.Hex >> 31) & 3) + m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, (const u32)((m_VtxDesc.Hex >> 31) & 3) }; // Reset pipeline @@ -770,7 +770,7 @@ void VertexLoader::AppendToString(std::string *dest) const dest->append(StringFromFormat("Nrm: %i %s-%s ", m_VtxAttr.NormalElements, posMode[m_VtxDesc.Normal], posFormats[m_VtxAttr.NormalFormat])); } - int color_mode[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1}; + u32 color_mode[2] = {m_VtxDesc.Color0, m_VtxDesc.Color1}; for (int i = 0; i < 2; i++) { if (color_mode[i]) @@ -778,7 +778,7 @@ void VertexLoader::AppendToString(std::string *dest) const dest->append(StringFromFormat("C%i: %i %s-%s ", i, m_VtxAttr.color[i].Elements, posMode[color_mode[i]], colorFormat[m_VtxAttr.color[i].Comp])); } } - int tex_mode[8] = { + u32 tex_mode[8] = { m_VtxDesc.Tex0Coord, m_VtxDesc.Tex1Coord, m_VtxDesc.Tex2Coord, m_VtxDesc.Tex3Coord, m_VtxDesc.Tex4Coord, m_VtxDesc.Tex5Coord, m_VtxDesc.Tex6Coord, m_VtxDesc.Tex7Coord }; diff --git a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp index 316941a639..4afa6e941b 100644 --- a/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexLoaderManager.cpp @@ -20,8 +20,8 @@ #include using stdext::hash_map; #else -#include -using __gnu_cxx::hash_map; +#include +using std::unordered_map; #endif #include #include @@ -44,20 +44,21 @@ namespace stdext { return uid.GetHash(); } } +typedef hash_map VertexLoaderMap; #else -namespace __gnu_cxx { +namespace std { template<> struct hash { size_t operator()(const VertexLoaderUID& uid) const { return uid.GetHash(); } }; } +typedef unordered_map VertexLoaderMap; #endif namespace VertexLoaderManager { -typedef hash_map VertexLoaderMap; static VertexLoaderMap g_VertexLoaderMap; // TODO - change into array of pointers. Keep a map of all seen so far. diff --git a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp index 8d24402b49..12445f283a 100644 --- a/Source/Core/VideoCommon/Src/VertexShaderManager.cpp +++ b/Source/Core/VideoCommon/Src/VertexShaderManager.cpp @@ -251,6 +251,7 @@ void VertexShaderManager::SetConstants() float GC_ALIGNED16(material[4]); float NormalizationCoef = 1 / 255.0f; + // TODO: This code is wrong. i goes out of range for xfregs.ambColor. for (int i = 0; i < 4; ++i) { if (nMaterialsChanged & (1 << i)) diff --git a/Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp b/Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp index 0e2cc7f99f..cc5ee66772 100644 --- a/Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp +++ b/Source/Plugins/Plugin_VideoSoftware/Src/SWVertexLoader.cpp @@ -72,27 +72,27 @@ void SWVertexLoader::SetFormat(u8 attributeIndex, u8 primitiveType) tcScale[7] = 1.0f / float(1 << m_CurrentVat->g2.Tex7Frac); //TexMtx - const int tmDesc[8] = { + const u32 tmDesc[8] = { g_VtxDesc.Tex0MatIdx, g_VtxDesc.Tex1MatIdx, g_VtxDesc.Tex2MatIdx, g_VtxDesc.Tex3MatIdx, g_VtxDesc.Tex4MatIdx, g_VtxDesc.Tex5MatIdx, g_VtxDesc.Tex6MatIdx, g_VtxDesc.Tex7MatIdx }; // Colors - const int colDesc[2] = {g_VtxDesc.Color0, g_VtxDesc.Color1}; + const u32 colDesc[2] = {g_VtxDesc.Color0, g_VtxDesc.Color1}; colElements[0] = m_CurrentVat->g0.Color0Elements; colElements[1] = m_CurrentVat->g0.Color1Elements; - const int colComp[2] = {m_CurrentVat->g0.Color0Comp, m_CurrentVat->g0.Color1Comp}; + const u32 colComp[2] = {m_CurrentVat->g0.Color0Comp, m_CurrentVat->g0.Color1Comp}; // TextureCoord - const int tcDesc[8] = { + const u32 tcDesc[8] = { g_VtxDesc.Tex0Coord, g_VtxDesc.Tex1Coord, g_VtxDesc.Tex2Coord, g_VtxDesc.Tex3Coord, - g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const int)((g_VtxDesc.Hex >> 31) & 3) + g_VtxDesc.Tex4Coord, g_VtxDesc.Tex5Coord, g_VtxDesc.Tex6Coord, (const u32)((g_VtxDesc.Hex >> 31) & 3) }; - const int tcElements[8] = { + const u32 tcElements[8] = { m_CurrentVat->g0.Tex0CoordElements, m_CurrentVat->g1.Tex1CoordElements, m_CurrentVat->g1.Tex2CoordElements, m_CurrentVat->g1.Tex3CoordElements, m_CurrentVat->g1.Tex4CoordElements, m_CurrentVat->g2.Tex5CoordElements, m_CurrentVat->g2.Tex6CoordElements, m_CurrentVat->g2.Tex7CoordElements }; - const int tcFormat[8] = { + const u32 tcFormat[8] = { m_CurrentVat->g0.Tex0CoordFormat, m_CurrentVat->g1.Tex1CoordFormat, m_CurrentVat->g1.Tex2CoordFormat, m_CurrentVat->g1.Tex3CoordFormat, m_CurrentVat->g1.Tex4CoordFormat, m_CurrentVat->g2.Tex5CoordFormat, m_CurrentVat->g2.Tex6CoordFormat, m_CurrentVat->g2.Tex7CoordFormat