diff --git a/Common/FixedSizeUnorderedSet.h b/Common/FixedSizeUnorderedSet.h index 87552f2baa..f7746629ea 100644 --- a/Common/FixedSizeUnorderedSet.h +++ b/Common/FixedSizeUnorderedSet.h @@ -10,7 +10,7 @@ class FixedSizeUnorderedSet public: bool insert(T item) { - if (count_ < maxCount - 1) + if (count_ < (int)maxCount - 1) { data_[count_++] = item; return true; @@ -41,7 +41,7 @@ public: size_t size() { - return count_; + return (size_t)count_; } T &operator[](size_t index) { diff --git a/Core/HLE/sceAudio.cpp b/Core/HLE/sceAudio.cpp index ab3cc9a0dd..5c1725aa41 100644 --- a/Core/HLE/sceAudio.cpp +++ b/Core/HLE/sceAudio.cpp @@ -149,14 +149,14 @@ u32 sceAudioOutputPanned(u32 chan, u32 leftVol, u32 rightVol, u32 samplePtr) int sceAudioGetChannelRestLen(u32 chan) { int sz = (int)chans[chan].sampleQueue.size() / 2; - DEBUG_LOG(HLE,"UNTESTED %i = sceAudioGetChannelRestLen(%i)", PARAM(0)); + DEBUG_LOG(HLE,"UNTESTED %i = sceAudioGetChannelRestLen(%i)", sz, chan); return sz; } int sceAudioGetChannelRestLength(u32 chan) { int sz = (int)chans[chan].sampleQueue.size() / 2; - DEBUG_LOG(HLE,"UNTESTED %i = sceAudioGetChannelRestLen(%i)", PARAM(0)); + DEBUG_LOG(HLE,"UNTESTED %i = sceAudioGetChannelRestLen(%i)", sz, chan); return sz; } diff --git a/Core/HLE/sceKernelInterrupt.cpp b/Core/HLE/sceKernelInterrupt.cpp index de3cef99bb..70a8008cf0 100644 --- a/Core/HLE/sceKernelInterrupt.cpp +++ b/Core/HLE/sceKernelInterrupt.cpp @@ -199,10 +199,12 @@ public: { return subIntrHandlers.find(subIntrNum) != subIntrHandlers.end(); } - SubIntrHandler &get(int subIntrNum) + SubIntrHandler *get(int subIntrNum) { if (has(subIntrNum)) - return subIntrHandlers[subIntrNum]; + return &subIntrHandlers[subIntrNum]; + else + return 0; // what to do, what to do... } @@ -365,7 +367,7 @@ u32 sceKernelEnableSubIntr(u32 intrNumber, u32 subIntrNumber) if (!intrHandlers[intrNumber].has(subIntrNumber)) return -1; - intrHandlers[intrNumber].get(subIntrNumber).enabled = true; + intrHandlers[intrNumber].get(subIntrNumber)->enabled = true; return 0; } @@ -378,7 +380,7 @@ u32 sceKernelDisableSubIntr(u32 intrNumber, u32 subIntrNumber) if (!intrHandlers[intrNumber].has(subIntrNumber)) return -1; - intrHandlers[intrNumber].get(subIntrNumber).enabled = false; + intrHandlers[intrNumber].get(subIntrNumber)->enabled = false; return 0; } diff --git a/Core/HLE/sceKernelThread.cpp b/Core/HLE/sceKernelThread.cpp index e2b8105325..436ab4db3e 100644 --- a/Core/HLE/sceKernelThread.cpp +++ b/Core/HLE/sceKernelThread.cpp @@ -1170,7 +1170,7 @@ void sceKernelWakeupThread() } } else { - ERROR_LOG(HLE,"sceKernelWakeupThread(%i) - bad thread id"); + ERROR_LOG(HLE,"sceKernelWakeupThread(%i) - bad thread id", uid); RETURN(error); } } @@ -1189,7 +1189,7 @@ void sceKernelCancelWakeupThread() RETURN(wCount); } else { - ERROR_LOG(HLE,"sceKernelCancelWakeupThread(%i) - bad thread id"); + ERROR_LOG(HLE,"sceKernelCancelWakeupThread(%i) - bad thread id", uid); RETURN(error); } } diff --git a/Core/HLE/scePower.cpp b/Core/HLE/scePower.cpp index 4f6f178bcd..f9dd533d8c 100644 --- a/Core/HLE/scePower.cpp +++ b/Core/HLE/scePower.cpp @@ -140,12 +140,12 @@ int sceKernelPowerLock(int lockType) } int sceKernelPowerUnlock(int lockType) { - DEBUG_LOG(HLE,"UNIMPL 0=sceKernelPowerUnlock(%i)"); + DEBUG_LOG(HLE,"UNIMPL 0=sceKernelPowerUnlock(%i)", lockType); return 0; } int sceKernelPowerTick(int flag) { - DEBUG_LOG(HLE,"UNIMPL 0=sceKernelPowerTick()"); + DEBUG_LOG(HLE,"UNIMPL 0=sceKernelPowerTick(%i)", flag); return 0; } diff --git a/Core/MIPS/ARM/JitCache.cpp b/Core/MIPS/ARM/JitCache.cpp index 4cb912afe8..5df0381fa1 100644 --- a/Core/MIPS/ARM/JitCache.cpp +++ b/Core/MIPS/ARM/JitCache.cpp @@ -365,7 +365,7 @@ void JitBlockCache::DestroyBlock(int block_num, bool invalidate) #ifdef JIT_UNLIMITED_ICACHE Memory::Write_Opcode_JIT(b.originalAddress, b.originalFirstOpcode?b.originalFirstOpcode:JIT_ICACHE_INVALID_WORD); #else - if (Memory::ReadUnchecked_U32(b.originalAddress) == block_num) + if ((int)Memory::ReadUnchecked_U32(b.originalAddress) == block_num) Memory::WriteUnchecked_U32(b.originalFirstOpcode, b.originalAddress); #endif diff --git a/Core/MIPS/ARM/RegCache.cpp b/Core/MIPS/ARM/RegCache.cpp index 5c64fca2a0..e562f78411 100644 --- a/Core/MIPS/ARM/RegCache.cpp +++ b/Core/MIPS/ARM/RegCache.cpp @@ -282,7 +282,7 @@ void GPRRegCache::BindToRegister(int i, bool doLoad, bool makeDirty) { if (i != j && regs[j].location.IsSimpleReg() && regs[j].location.GetSimpleReg() == xr) { - PanicAlert(""); + PanicAlert("bad"); } } regs[i].away = true; @@ -318,7 +318,8 @@ void GPRRegCache::StoreFromRegister(int i) doStore = true; } Location newLoc = GetDefaultLocation(i); - //if (doStore) + if (doStore) + ; // emit->MOV(32, newLoc, regs[i].location); regs[i].location = newLoc; regs[i].away = false; diff --git a/Core/MIPS/MIPSDisVFPU.cpp b/Core/MIPS/MIPSDisVFPU.cpp index 8fabb7e5d3..782d0b57d1 100644 --- a/Core/MIPS/MIPSDisVFPU.cpp +++ b/Core/MIPS/MIPSDisVFPU.cpp @@ -431,6 +431,7 @@ namespace MIPSDis break; default: // invalid + name = "???"; break; } int vd = _VD; diff --git a/Core/MIPS/MIPSInt.cpp b/Core/MIPS/MIPSInt.cpp index fcd623fed7..6e254ef687 100644 --- a/Core/MIPS/MIPSInt.cpp +++ b/Core/MIPS/MIPSInt.cpp @@ -311,7 +311,7 @@ namespace MIPSInt switch (op >> 26) { case 48: // ll - R(rt) = Memory::Read_U32(addr); + R(rt) = Memory::Read_U32(addr); currentMIPS->llBit = 1; break; case 56: // sc @@ -580,7 +580,7 @@ namespace MIPSInt { s32 a = (s32)R(rs); s32 b = (s32)R(rt); - if (a == 0x80000000 && b == -1) { + if (a == (s32)0x80000000 && b == -1) { LO = 0x80000000; } else if (b != 0) { LO = (u32)(a / b); @@ -768,10 +768,10 @@ namespace MIPSInt case 36: switch (currentMIPS->fcr31 & 3) { - case 0: FsI(fd) = roundf(F(fs)); break; // RINT_0 // TODO: rintf or roundf? + case 0: FsI(fd) = (int)roundf(F(fs)); break; // RINT_0 // TODO: rintf or roundf? case 1: FsI(fd) = (int)F(fs); break; // CAST_1 - case 2: FsI(fd) = ceilf(F(fs)); break; // CEIL_2 - case 3: FsI(fd) = floorf(F(fs)); break; // FLOOR_3 + case 2: FsI(fd) = (int)ceilf(F(fs)); break; // CEIL_2 + case 3: FsI(fd) = (int)floorf(F(fs)); break; // FLOOR_3 } break; //cvt.w.s default: @@ -815,6 +815,7 @@ namespace MIPSInt default: _dbg_assert_msg_(CPU,0,"Trying to interpret FPUComp instruction that can't be interpreted"); + cond = false; break; } currentMIPS->fpcond = cond; diff --git a/Core/MIPS/MIPSIntVFPU.cpp b/Core/MIPS/MIPSIntVFPU.cpp index 3dde0cb4c4..51264ba65c 100644 --- a/Core/MIPS/MIPSIntVFPU.cpp +++ b/Core/MIPS/MIPSIntVFPU.cpp @@ -1206,6 +1206,7 @@ namespace MIPSInt for (int i = 0; i < n; i++) { int c; + // These set c to 0 or 1, nothing else. switch (cond) { case VC_EQ: c = s[i] == t[i]; break; @@ -1230,8 +1231,9 @@ namespace MIPSInt affected_bits |= 1 << i; } // Use masking to only change the affected bits - currentMIPS->vfpuCtrl[VFPU_CTRL_CC] = (currentMIPS->vfpuCtrl[VFPU_CTRL_CC] & ~affected_bits) | - (cc | (or_val << 4) | (and_val << 5)) & affected_bits; + currentMIPS->vfpuCtrl[VFPU_CTRL_CC] = + (currentMIPS->vfpuCtrl[VFPU_CTRL_CC] & ~affected_bits) | + ((cc | (or_val << 4) | (and_val << 5)) & affected_bits); PC += 4; EatPrefixes(); } diff --git a/GPU/GLES/TextureCache.cpp b/GPU/GLES/TextureCache.cpp index 680d004427..7b97e2d342 100644 --- a/GPU/GLES/TextureCache.cpp +++ b/GPU/GLES/TextureCache.cpp @@ -497,8 +497,8 @@ void PSPSetTexture() if (!texaddr) return; u8 level = 0; - int format = gstate.texformat & 0xF; - int clutformat = gstate.clutformat & 3; + u32 format = gstate.texformat & 0xF; + u32 clutformat = gstate.clutformat & 3; DEBUG_LOG(G3D,"Texture at %08x",texaddr); u8 *texptr = Memory::GetPointer(texaddr); @@ -513,26 +513,23 @@ void PSPSetTexture() bool match = true; //TODO: Check more texture parameters, compute real texture hash - if(dim != entry.dim || entry.hash != *(u32*)texptr || entry.format != format) + if (dim != entry.dim || entry.hash != *(u32*)texptr || entry.format != format) match = false; //TODO: Check more clut parameters, compute clut hash - if(match && (format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) && - (entry.clutformat != clutformat || - entry.clutaddr != GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2) || - entry.cluthash != Memory::Read_U32(entry.clutaddr))) + if (match && (format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) && + (entry.clutformat != clutformat || + entry.clutaddr != GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2) || + entry.cluthash != Memory::Read_U32(entry.clutaddr))) match = false; - if (match) - { + if (match) { //got one! glBindTexture(GL_TEXTURE_2D, entry.texture); UpdateSamplingParams(); DEBUG_LOG(G3D,"Texture at %08x Found in Cache, applying", texaddr); return; //Done! - } - else - { + } else { NOTICE_LOG(G3D,"Texture different or overwritten, reloading at %08x", texaddr); //Damnit, got overwritten. @@ -785,7 +782,7 @@ void PSPSetTexture() } else { write = (u8 *)finalBuf; } - for (int y = 0; y < h; y++) { + for (u32 y = 0; y < h; y++) { memmove(write, read, outRowBytes); read += inRowBytes; write += outRowBytes; diff --git a/android/jni/Android.mk b/android/jni/Android.mk index 53a379946b..ceb060ab29 100644 --- a/android/jni/Android.mk +++ b/android/jni/Android.mk @@ -24,8 +24,8 @@ LOCAL_MODULE := ppsspp_jni NATIVE := ../../native SRC := ../.. -LOCAL_CFLAGS := -DUSE_PROFILER -DGL_GLEXT_PROTOTYPES -O2 -fsigned-char -Wall -Wno-multichar -Wno-psabi -std=gnu++0x -Wno-unused-variable -fno-strict-aliasing -ffast-math -LOCAL_CPPFLAGS := +LOCAL_CFLAGS := -DUSE_PROFILER -DGL_GLEXT_PROTOTYPES -O2 -fsigned-char -Wall -Wno-multichar -Wno-psabi -Wno-unused-variable -fno-strict-aliasing -ffast-math +LOCAL_CPPFLAGS := -std=gnu++0x LOCAL_C_INCLUDES := \ $(LOCAL_PATH)/../../Common \ $(LOCAL_PATH)/../.. \