Merge pull request #733 from unknownbrackets/warnings

Warning fixes
This commit is contained in:
Henrik Rydgård 2013-02-18 10:15:21 -08:00
commit 6c479eb7ab
14 changed files with 32 additions and 30 deletions

View File

@ -625,7 +625,7 @@ public:
u8 *uncomp_buffer = new u8[header.UncompressedSize];
size_t uncomp_size = header.UncompressedSize;
snappy_uncompress((const char *)buffer, sz, (char *)uncomp_buffer, &uncomp_size);
if (uncomp_size != header.UncompressedSize) {
if ((int)uncomp_size != header.UncompressedSize) {
ERROR_LOG(COMMON,"Size mismatch: file: %i calc: %i", (int)header.UncompressedSize, (int)uncomp_size);
}
ptr = uncomp_buffer;

View File

@ -1080,7 +1080,7 @@ bool SavedataParam::CreatePNGIcon(u8* pngData, int pngSize, SaveFileInfo& info)
u32 atlasPtr;
if (success)
atlasPtr = kernelMemory.Alloc(texSize, true, "SaveData Icon");
if (success && atlasPtr != -1)
if (success && atlasPtr != (u32)-1)
{
info.textureData = atlasPtr;
Memory::Memcpy(atlasPtr, textureData, texSize);

View File

@ -217,7 +217,7 @@ bool ElfReader::LoadInto(u32 loadAddress)
vaddr = userMemory.Alloc(totalSize, false, "ELF");
}
if (vaddr == -1) {
if (vaddr == (u32)-1) {
ERROR_LOG(LOADER, "Failed to allocate memory for ELF!");
return false;
}

View File

@ -297,7 +297,7 @@ bool hleExecuteDebugBreak(const HLEFunction &func)
// Never break on these, they're noise.
u32 blacklistedNIDs[] = {NID_SUSPEND_INTR, NID_RESUME_INTR, NID_IDLE};
for (int i = 0; i < ARRAY_SIZE(blacklistedNIDs); ++i)
for (size_t i = 0; i < ARRAY_SIZE(blacklistedNIDs); ++i)
{
if (func.ID == blacklistedNIDs[i])
return false;

View File

@ -187,7 +187,7 @@ u32 sceAtracDecodeData(int atracID, u32 outAddr, u32 numSamplesAddr, u32 finishF
ret = ATRAC_ERROR_ALL_DATA_DECODED;
} else {
// TODO: This isn't at all right, but at least it makes the music "last" some time.
int numSamples = (atrac->decodeEnd - atrac->decodePos) / (sizeof(s16) * 2);
u32 numSamples = (atrac->decodeEnd - atrac->decodePos) / (sizeof(s16) * 2);
if (atrac->decodePos >= atrac->decodeEnd) {
numSamples = 0;
} else if (numSamples > ATRAC_MAX_SAMPLES) {
@ -554,7 +554,7 @@ int sceAtracLowLevelInitDecoder(int atracID, u32 paramsAddr)
int sceAtracLowLevelDecode(int atracID, u32 sourceAddr, u32 sourceBytesConsumedAddr, u32 samplesAddr, u32 sampleBytesAddr)
{
ERROR_LOG(HLE, "UNIMPL sceAtracLowLevelDecode(%i, %i, %08x, %08x, %08x, %08x)", atracID, sourceAddr, sourceBytesConsumedAddr, samplesAddr, sampleBytesAddr);
ERROR_LOG(HLE, "UNIMPL sceAtracLowLevelDecode(%i, %08x, %08x, %08x, %08x)", atracID, sourceAddr, sourceBytesConsumedAddr, samplesAddr, sampleBytesAddr);
return 0;
}

View File

@ -35,7 +35,7 @@
const int PSP_CTRL_ERROR_INVALID_MODE = 0x80000107;
const int PSP_CTRL_ERROR_INVALID_IDLE_PTR = 0x80000023;
const int NUM_CTRL_BUFFERS = 64;
const u32 NUM_CTRL_BUFFERS = 64;
enum
{
@ -68,8 +68,8 @@ static u32 ctrlOldButtons = 0;
static _ctrl_data ctrlBufs[NUM_CTRL_BUFFERS];
static _ctrl_data ctrlCurrent;
static int ctrlBuf = 0;
static int ctrlBufRead = 0;
static u32 ctrlBuf = 0;
static u32 ctrlBufRead = 0;
static CtrlLatch latch;
static int ctrlIdleReset = -1;
@ -189,7 +189,7 @@ int __CtrlReadBuffer(u32 ctrlDataPtr, u32 nBufs, bool negative, bool peek)
if (nBufs > NUM_CTRL_BUFFERS)
return SCE_KERNEL_ERROR_INVALID_SIZE;
int resetRead = ctrlBufRead;
u32 resetRead = ctrlBufRead;
u32 availBufs;
// Peeks always work, they just go go from now X buffers.

View File

@ -237,10 +237,10 @@ u32 sceGeSetCallback(u32 structAddr)
DEBUG_LOG(HLE, "sceGeSetCallback(struct=%08x)", structAddr);
int cbID = -1;
for (int i = 0; i < ARRAY_SIZE(ge_used_callbacks); ++i)
for (size_t i = 0; i < ARRAY_SIZE(ge_used_callbacks); ++i)
if (!ge_used_callbacks[i])
{
cbID = i;
cbID = (int) i;
break;
}

View File

@ -213,7 +213,7 @@ void __InterruptsInit()
{
interruptsEnabled = 1;
inInterrupt = false;
for(int i = 0; i < ARRAY_SIZE(intrHandlers); ++i)
for (size_t i = 0; i < ARRAY_SIZE(intrHandlers); ++i)
intrHandlers[i] = new IntrHandler(i);
intState.clear();
}
@ -246,11 +246,11 @@ void __InterruptsDoStateLate(PointerWrap &p)
void __InterruptsShutdown()
{
for (int i = 0; i < ARRAY_SIZE(intrHandlers); ++i)
for (size_t i = 0; i < ARRAY_SIZE(intrHandlers); ++i)
intrHandlers[i]->clear();
for(int i = 0; i < ARRAY_SIZE(intrHandlers); ++i)
for (size_t i = 0; i < ARRAY_SIZE(intrHandlers); ++i)
{
if(intrHandlers[i])
if (intrHandlers[i])
{
delete intrHandlers[i];
intrHandlers[i] = 0;

View File

@ -430,7 +430,7 @@ u32 __sceSasSetVoiceATRAC3(u32 core, int voice, int atrac3Context) {
}
u32 __sceSasConcatenateATRAC3(u32 core, int voice, u32 atrac3DataAddr, int atrac3DataLength) {
ERROR_LOG(HLE,"UNIMPL __sceSasConcatenateATRAC3(%08x, %i, %i)", core, voice, atrac3DataAddr, atrac3DataLength);
ERROR_LOG(HLE,"UNIMPL __sceSasConcatenateATRAC3(%08x, %i, %08x, %i)", core, voice, atrac3DataAddr, atrac3DataLength);
return 0;
}

View File

@ -548,8 +548,8 @@ static int getExpCurveAt(int index, int duration) {
}
ADSREnvelope::ADSREnvelope()
: steps_(0),
state_(STATE_OFF),
: state_(STATE_OFF),
steps_(0),
height_(0) {
memset(this, 0, sizeof(*this));
}

View File

@ -98,7 +98,7 @@ namespace MIPSAnalyst
"slt", "sltu",
};
const char *opName = MIPSGetName(op);
for (int i = 0; i < ARRAY_SIZE(safeOps); ++i)
for (size_t i = 0; i < ARRAY_SIZE(safeOps); ++i)
{
if (!strcmp(safeOps[i], opName))
return true;

View File

@ -684,6 +684,8 @@ void TextureCache::SetTexture() {
clutformat = gstate.clutformat & 3;
clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2);
cachekey |= (u64)clutaddr << 32;
} else {
clutaddr = 0;
}
int maxLevel = ((gstate.texmode >> 16) & 0x7);
@ -725,7 +727,7 @@ void TextureCache::SetTexture() {
entry->hash != texhash ||
entry->format != format ||
entry->maxLevel != maxLevel ||
((format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) &&
(hasClut &&
(entry->clutformat != clutformat ||
entry->clutaddr != clutaddr ||
entry->cluthash != Memory::Read_U32(entry->clutaddr))))
@ -810,9 +812,9 @@ void TextureCache::SetTexture() {
entry->lodBias = 0.0f;
if (format >= GE_TFMT_CLUT4 && format <= GE_TFMT_CLUT32) {
if (hasClut) {
entry->clutformat = clutformat;
entry->clutaddr = GetClutAddr(clutformat == GE_CMODE_32BIT_ABGR8888 ? 4 : 2);
entry->clutaddr = clutaddr;
entry->cluthash = Memory::Read_U32(entry->clutaddr);
} else {
entry->clutaddr = 0;
@ -1173,8 +1175,6 @@ bool TextureCache::DecodeTexture(u8* output, GPUgstate state)
// TODO: Look into using BGRA for 32-bit textures when the GL_EXT_texture_format_BGRA8888 extension is available, as it's faster than RGBA on some chips.
// TODO: Actually decode the mipmaps.
switch (format)
{
case GE_TFMT_CLUT4:

View File

@ -66,8 +66,8 @@ private:
int numFrames;
u32 framesUntilNextFullHash;
u8 format;
u8 clutformat;
u16 dim;
u8 clutformat;
u32 clutaddr;
u32 cluthash;
u32 texture; //GLuint
@ -102,7 +102,7 @@ private:
u32 *clutBuf32;
u16 *clutBuf16;
int lastBoundTexture;
u32 lastBoundTexture;
float maxAnisotropyLevel;
};

View File

@ -53,12 +53,14 @@ enum {
};
TransformDrawEngine::TransformDrawEngine()
: numDrawCalls(0),
collectedVerts(0),
: collectedVerts(0),
prevPrim_(-1),
lastVType_(-1),
curVbo_(0),
shaderManager_(0) {
shaderManager_(0),
textureCache_(0),
framebufferManager_(0),
numDrawCalls(0) {
// Allocate nicely aligned memory. Maybe graphics drivers will
// appreciate it.
// All this is a LOT of memory, need to see if we can cut down somehow.