Fix various minor warnings.

This commit is contained in:
Unknown W. Brackets 2016-03-20 14:17:51 -07:00
parent 87eadad326
commit ef1dc583a2
9 changed files with 15 additions and 10 deletions

View file

@ -215,8 +215,10 @@ u8* MemArena::Find4GBBase()
#ifdef _M_X64 #ifdef _M_X64
#ifdef _WIN32 #ifdef _WIN32
// 64 bit // 64 bit
u8* base = (u8*)VirtualAlloc(0, 0xE1000000, MEM_RESERVE, PAGE_READWRITE); u8 *base = (u8*)VirtualAlloc(0, 0xE1000000, MEM_RESERVE, PAGE_READWRITE);
if (base) {
VirtualFree(base, 0, MEM_RELEASE); VirtualFree(base, 0, MEM_RELEASE);
}
return base; return base;
#else #else
// Very precarious - mmap cannot return an error when trying to map already used pages. // Very precarious - mmap cannot return an error when trying to map already used pages.

View file

@ -34,7 +34,7 @@
namespace Gen namespace Gen
{ {
enum X64Reg enum X64Reg : u32
{ {
EAX = 0, EBX = 3, ECX = 1, EDX = 2, EAX = 0, EBX = 3, ECX = 1, EDX = 2,
ESI = 6, EDI = 7, EBP = 5, ESP = 4, ESI = 6, EDI = 7, EBP = 5, ESP = 4,

View file

@ -223,7 +223,7 @@ void RamCachingFileLoader::StartReadAhead(s64 pos) {
for (u32 i = cacheStartPos; i <= cacheEndPos; ++i) { for (u32 i = cacheStartPos; i <= cacheEndPos; ++i) {
if (blocks_[i] == 0) { if (blocks_[i] == 0) {
SaveIntoCache(i << BLOCK_SHIFT, BLOCK_SIZE * BLOCK_READAHEAD); SaveIntoCache((u64)i << BLOCK_SHIFT, BLOCK_SIZE * BLOCK_READAHEAD);
break; break;
} }
} }

View file

@ -477,7 +477,7 @@ static int Replace_dl_write_matrix() {
return 60; return 60;
} }
u32 matrix; u32 matrix = 0;
int count = 12; int count = 12;
switch (PARAM(1)) { switch (PARAM(1)) {
case 3: case 3:

View file

@ -180,6 +180,8 @@ void __sceAudiocodecDoState(PointerWrap &p){
// loadstate if audioList is nonempty // loadstate if audioList is nonempty
auto codec_ = new int[count]; auto codec_ = new int[count];
auto ctxPtr_ = new u32[count]; auto ctxPtr_ = new u32[count];
// These sizeof(pointers) are wrong, but kept to avoid breaking on old saves.
// They're not used in new savestates.
p.DoArray(codec_, s >= 2 ? count : (int)ARRAY_SIZE(codec_)); p.DoArray(codec_, s >= 2 ? count : (int)ARRAY_SIZE(codec_));
p.DoArray(ctxPtr_, s >= 2 ? count : (int)ARRAY_SIZE(ctxPtr_)); p.DoArray(ctxPtr_, s >= 2 ? count : (int)ARRAY_SIZE(ctxPtr_));
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {

View file

@ -1656,7 +1656,7 @@ static void __ReportThreadQueueEmpty() {
int idleStatus1 = -1; int idleStatus1 = -1;
if (idleThread1) { if (idleThread1) {
idleThread1->GetQuickInfo(idleDescription1, sizeof(idleDescription1)); idleThread1->GetQuickInfo(idleDescription1, sizeof(idleDescription1));
idleStatus1 = idleThread0->nt.status; idleStatus1 = idleThread1->nt.status;
} else { } else {
sprintf(idleDescription1, "DELETED"); sprintf(idleDescription1, "DELETED");
} }

View file

@ -35,9 +35,9 @@ namespace X64JitConstants {
const int NUM_MIPS_GPRS = 36; const int NUM_MIPS_GPRS = 36;
#ifdef _M_X64 #ifdef _M_X64
const int NUM_X_REGS = 16; const u32 NUM_X_REGS = 16;
#elif _M_IX86 #elif _M_IX86
const int NUM_X_REGS = 8; const u32 NUM_X_REGS = 8;
#endif #endif
} }

View file

@ -646,7 +646,8 @@ namespace SaveState
break; break;
case SAVESTATE_SAVE_SCREENSHOT: case SAVESTATE_SAVE_SCREENSHOT:
if (!TakeGameScreenshot(op.filename.c_str(), SCREENSHOT_JPG, SCREENSHOT_RENDER)) { callbackResult = TakeGameScreenshot(op.filename.c_str(), SCREENSHOT_JPG, SCREENSHOT_RENDER);
if (!callbackResult) {
ERROR_LOG(COMMON, "Failed to take a screenshot for the savestate! %s", op.filename.c_str()); ERROR_LOG(COMMON, "Failed to take a screenshot for the savestate! %s", op.filename.c_str());
} }
break; break;

View file

@ -81,7 +81,7 @@ uint32_t TextDrawer::SetFont(const char *fontName, int size, int flags) {
else else
fname = L"Tahoma"; fname = L"Tahoma";
uint32_t fontHash = hash::Fletcher((const uint8_t *)fontName, strlen(fontName)); uint32_t fontHash = fontName ? hash::Fletcher((const uint8_t *)fontName, strlen(fontName)) : 0;
fontHash ^= size; fontHash ^= size;
fontHash ^= flags << 10; fontHash ^= flags << 10;