Fix some minor warnings.

This commit is contained in:
Unknown W. Brackets 2014-03-03 00:08:32 -08:00
parent 705658b8e4
commit c7437bbe8e
8 changed files with 24 additions and 19 deletions

View File

@ -521,7 +521,7 @@ void CWCheatEngine::Run() {
case 0xC: // Code stopper
if (Memory::IsValidAddress(addr)) {
value = Memory::Read_U32(addr);
if (value != arg) {
if ((u32)value != arg) {
SkipAllCodes();
}
}

View File

@ -418,11 +418,11 @@ int GetReplacementFuncIndex(u64 hash, int funcSize) {
}
// TODO: Build a lookup and keep it around
for (int i = 0; i < ARRAY_SIZE(entries); i++) {
for (size_t i = 0; i < ARRAY_SIZE(entries); i++) {
if (!entries[i].name)
continue;
if (!strcmp(name, entries[i].name)) {
return i;
return (int)i;
}
}
return -1;

View File

@ -546,27 +546,30 @@ int initNetwork(SceNetAdhocctlAdhocId *adhoc_id){
server_addr.sin_family = AF_INET;
server_addr.sin_port = htons(27312); // Maybe read this from config too
// Resolve dns
addrinfo * resultAddr;
// Resolve dns
addrinfo * resultAddr;
addrinfo * ptr;
in_addr serverIp;
iResult = getaddrinfo(g_Config.proAdhocServer.c_str(),0,NULL,&resultAddr);
if(iResult != 0){
ERROR_LOG(SCENET, "Dns error\n");
return iResult;
serverIp.s_addr = INADDR_NONE;
iResult = getaddrinfo(g_Config.proAdhocServer.c_str(),0,NULL,&resultAddr);
if (iResult != 0) {
ERROR_LOG(SCENET, "Dns error\n");
return iResult;
}
for(ptr = resultAddr; ptr != NULL; ptr = ptr->ai_next){
switch(ptr->ai_family){
for (ptr = resultAddr; ptr != NULL; ptr = ptr->ai_next) {
switch (ptr->ai_family) {
case AF_INET:
serverIp = ((sockaddr_in *)ptr->ai_addr)->sin_addr;
break;
}
}
server_addr.sin_addr = serverIp;
iResult = connect(metasocket,(sockaddr *)&server_addr,sizeof(server_addr));
if(iResult == SOCKET_ERROR){
if (iResult == SOCKET_ERROR) {
ERROR_LOG(SCENET,"Socket error");
return iResult;
}
return iResult;
}
memset(&parameter,0,sizeof(parameter));
strcpy((char *)&parameter.nickname.data, g_Config.sNickName.c_str());
parameter.channel = 1; // Fake Channel 1

View File

@ -181,7 +181,7 @@ int sceMp3Decode(u32 mp3, u32 outPcmPtr) {
break;
if (packet.stream_index == ctx->audio_stream_index) {
avcodec_get_frame_defaults(&frame);
av_frame_unref(&frame);
got_frame = 0;
ret = avcodec_decode_audio4(ctx->decoder_context, &frame, &got_frame, &packet);
if (ret < 0) {

View File

@ -121,7 +121,7 @@ bool SimpleAT3::Decode(void* inbuf, int inbytes, uint8_t *outbuf, int *outbytes)
*outbytes = 0;
int got_frame = 0;
avcodec_get_frame_defaults(frame_);
av_frame_unref(frame_);
int len = avcodec_decode_audio4(codecCtx_, frame_, &got_frame, &packet);
if (len < 0) {

View File

@ -588,7 +588,7 @@ skip:
const char *LookupHash(u64 hash, int funcsize) {
for (auto it = hashMap.begin(), end = hashMap.end(); it != end; ++it) {
if (it->hash == hash && it->size == funcsize) {
if (it->hash == hash && (int)it->size == funcsize) {
return it->name;
}
}

View File

@ -150,7 +150,7 @@ bool Load_PSP_ISO(const char *filename, std::string *error_string)
std::string bootpath("disc0:/PSP_GAME/SYSDIR/EBOOT.BIN");
// Bypass Chinese translation patches, see comment above.
for (int i = 0; i < ARRAY_SIZE(altBootNames); i++) {
for (size_t i = 0; i < ARRAY_SIZE(altBootNames); i++) {
if (pspFileSystem.GetFileInfo(altBootNames[i]).exists) {
bootpath = altBootNames[i];
}

View File

@ -1130,6 +1130,7 @@ void TextureCache::SetTexture(bool force) {
break;
}
#ifndef USING_GLES2
if (i > 0) {
int tw = gstate.getTextureWidth(i);
int th = gstate.getTextureWidth(i);
@ -1138,6 +1139,7 @@ void TextureCache::SetTexture(bool force) {
else if (th != 1 && th != (gstate.getTextureHeight(i - 1) >> 1))
badMipSizes = true;
}
#endif
}
// In addition, simply don't load more than level 0 if g_Config.bMipMap is false.
@ -1181,7 +1183,7 @@ void TextureCache::SetTexture(bool force) {
#ifndef USING_GLES2
if (badMipSizes) {
glGenerateMipmap(GL_TEXTURE_2D);
} else {
} else {
for (int i = 1; i <= maxLevel; i++) {
LoadTextureLevel(*entry, i, replaceImages, dstFmt);
}