Ticket #293: printfwarnings.patch
File printfwarnings.patch, 12.1 KB (added by , 15 years ago) |
---|
-
source/ps/ConfigDB.cpp
284 284 LibError ret = g_VFS->LoadFile(m_ConfigFile[ns], buffer, buflen); 285 285 if (ret != INFO::OK) 286 286 { 287 LOG(CLogger::Error, LOG_CATEGORY, "vfs_load for \"%s\" failed: return was %l ld", m_ConfigFile[ns].c_str(), ret);287 LOG(CLogger::Error, LOG_CATEGORY, "vfs_load for \"%s\" failed: return was %ld", m_ConfigFile[ns].c_str(), ret); 288 288 return false; 289 289 } 290 290 } -
source/ps/XML/XMLWriter.cpp
89 89 LibError ret = g_VFS->CreateFile(filename, data, size); 90 90 if (ret < 0) 91 91 { 92 LOG(CLogger::Error, "xml", "Error saving XML data through VFS: % d", ret);92 LOG(CLogger::Error, "xml", "Error saving XML data through VFS: %ld", ret); 93 93 return false; 94 94 } 95 95 return true; -
source/ps/Filesystem.cpp
57 57 LibError ret = g_VFS->LoadFile(filename, m_Buffer, m_BufferSize); 58 58 if (ret != INFO::OK) 59 59 { 60 LOG(CLogger::Error, LOG_CATEGORY, "CVFSFile: file %s couldn't be opened (vfs_load: % d)", filename.string().c_str(), ret);60 LOG(CLogger::Error, LOG_CATEGORY, "CVFSFile: file %s couldn't be opened (vfs_load: %ld)", filename.string().c_str(), ret); 61 61 return PSRETURN_CVFSFile_LoadFailed; 62 62 } 63 63 -
source/ps/Interact.cpp
982 982 Handle tmp = ogl_tex_load(name.c_str()); 983 983 if (tmp <= 0) 984 984 { 985 LOG(CLogger::Error, LOG_CATEGORY, " Rank Textures", "loadRankTextures failed on \"%s\"", name.c_str());985 LOG(CLogger::Error, LOG_CATEGORY, "loadRankTextures failed on \"%s\"", name.c_str()); 986 986 return INFO::CB_CONTINUE; 987 987 } 988 988 name.Remove("art/textures/ui/session/icons/"); //Names are relative to this directory -
source/gui/CGUI.cpp
1108 1108 } 1109 1109 catch (PSERROR_GUI& e) 1110 1110 { 1111 LOG(CLogger::Error, LOG_CATEGORY, "Errors loading GUI file %s (% s)", Filename.c_str(), e.getCode());1111 LOG(CLogger::Error, LOG_CATEGORY, "Errors loading GUI file %s (%d)", Filename.c_str(), e.getCode()); 1112 1112 return; 1113 1113 } 1114 1114 … … 1395 1395 // Try making the object read the tag. 1396 1396 if (!object->HandleAdditionalChildren(child, pFile)) 1397 1397 { 1398 LOG(CLogger::Error, LOG_CATEGORY, "(object: %s) Reading unknown children for its type" );1398 LOG(CLogger::Error, LOG_CATEGORY, "(object: %s) Reading unknown children for its type", object->GetPresentableName().c_str()); 1399 1399 } 1400 1400 } 1401 1401 } -
source/simulation/Technology.cpp
297 297 JSFunction* fn = JS_ValueToFunction( g_ScriptingHost.GetContext(), fnval ); 298 298 if( !fn ) 299 299 { 300 LOG(CLogger::Error, LOG_CATEGORY, "CTechnology::LoadXml: Function does not exist for % hs in file %s. Load failed.", funcName.c_str(), filename.c_str() );300 LOG(CLogger::Error, LOG_CATEGORY, "CTechnology::LoadXml: Function does not exist for %s in file %s. Load failed.", CStr(funcName).c_str(), filename.c_str() ); 301 301 return false; 302 302 } 303 303 m_effectFunction.SetFunction( fn ); -
source/simulation/EntityTemplate.cpp
317 317 JSFunction* fn = JS_ValueToFunction( g_ScriptingHost.GetContext(), fnval ); 318 318 if( !fn ) 319 319 { 320 LOG(CLogger::Error, LOG_CATEGORY, "CEntityTemplate::LoadXml: Function does not exist for event % hs in file %s. Load failed.", EventName.c_str(), filename.c_str() );320 LOG(CLogger::Error, LOG_CATEGORY, "CEntityTemplate::LoadXml: Function does not exist for event %ls in file %s. Load failed.", EventName.c_str(), filename.c_str() ); 321 321 break; 322 322 } 323 323 m_EventHandlers[eventID].SetFunction( fn ); -
source/network/NetSession.cpp
394 394 // Is this our session? 395 395 if ( it->pPeer == event.peer ) 396 396 { 397 NET_LOG2( "% xdisconnected", event.peer->data );397 NET_LOG2( "%p disconnected", event.peer->data ); 398 398 399 399 // Successfully handled? 400 400 if ( !HandleDisconnect( it->pSession ) ) return false; … … 420 420 CNetMessage* pNewMessage = CNetMessageFactory::CreateMessage( event.packet->data, event.packet->dataLength ); 421 421 if ( !pNewMessage ) return false; 422 422 423 NET_LOG4( "Message %s of size %u was received from % x", pNewMessage->ToString().c_str(), pNewMessage->GetSerializedLength(), event.peer->data );423 NET_LOG4( "Message %s of size %u was received from %p", pNewMessage->ToString().c_str(), pNewMessage->GetSerializedLength(), event.peer->data ); 424 424 425 425 // Successfully handled? 426 426 if ( !HandleMessageReceive( pNewMessage, it->pSession ) ) { … … 526 526 } 527 527 else 528 528 { 529 NET_LOG4( "Message %s of size %u was sent to % x",529 NET_LOG4( "Message %s of size %u was sent to %p", 530 530 pMessage->ToString().c_str(), pMessage->GetSerializedLength(), pSession->m_Peer->data ); 531 531 } 532 532 -
source/scripting/ScriptGlue.cpp
1065 1065 switch(mode) 1066 1066 { 1067 1067 case -1: 1068 sprintf_s(buf, ARRAY_SIZE(buf), "%s %s (% ws)", __DATE__, __TIME__, svn_revision);1068 sprintf_s(buf, ARRAY_SIZE(buf), "%s %s (%ls)", __DATE__, __TIME__, svn_revision); 1069 1069 break; 1070 1070 case 0: 1071 1071 sprintf_s(buf, ARRAY_SIZE(buf), "%s", __DATE__); … … 1074 1074 sprintf_s(buf, ARRAY_SIZE(buf), "%s", __TIME__); 1075 1075 break; 1076 1076 case 2: 1077 sprintf_s(buf, ARRAY_SIZE(buf), "% ws", svn_revision);1077 sprintf_s(buf, ARRAY_SIZE(buf), "%ls", svn_revision); 1078 1078 break; 1079 1079 } 1080 1080 … … 1376 1376 *rval = ToJSVal( g_TriggerManager.m_TriggerMap[name] ); 1377 1377 else 1378 1378 { 1379 debug_printf("Invalid trigger name % ws", name.c_str());1379 debug_printf("Invalid trigger name %ls", name.c_str()); 1380 1380 *rval = JSVAL_NULL; 1381 1381 } 1382 1382 return JS_TRUE; -
source/lib/sysdep/os/unix/x/x.cpp
169 169 &len, &bytes_left, 170 170 &data); 171 171 if (result != Success) 172 debug_printf("clipboard_get: result: %d type:% d len:%d format:%d bytes_left:%d\n",173 result, (int)type, len, format, bytes_left);172 debug_printf("clipboard_get: result: %d type:%lu len:%lu format:%d bytes_left:%lu\n", 173 result, type, len, format, bytes_left); 174 174 if (result == Success && bytes_left > 0) 175 175 { 176 176 result = XGetWindowProperty (disp, selOwner, … … 181 181 if (result == Success) 182 182 { 183 183 debug_printf("clipboard_get: XGetWindowProperty succeeded, returning data\n"); 184 debug_printf("clipboard_get: data was: \"%s\", type was % d, XA_STRING atom is %d\n", data, type, XA_STRING);184 debug_printf("clipboard_get: data was: \"%s\", type was %lu, XA_STRING atom is %lu\n", data, type, XA_STRING); 185 185 186 186 if (type == XA_STRING) //Latin-1: Just copy into low byte of wchar_t 187 187 { -
source/lib/tests/test_secure_crt.h
60 60 #else 61 61 class SuppressErrors 62 62 { 63 SuppressErrors() 64 { 65 } 63 66 }; 64 67 #endif 65 68 -
source/lib/ogl.cpp
273 273 E(GL_STACK_UNDERFLOW) 274 274 E(GL_OUT_OF_MEMORY) 275 275 E(GL_INVALID_FRAMEBUFFER_OPERATION_EXT) 276 default: debug_printf(" GL error: %04f\n", err); break;276 default: debug_printf("Unknown GL error: %04x\n", err); break; 277 277 } 278 278 #undef E 279 279 } -
source/lib/res/graphics/ogl_shader.cpp
151 151 152 152 pglGetShaderInfoLog(shdr->id, log_length, 0, infolog); 153 153 154 debug_printf("Compile log for shader % hs (type %hs):\n%hs",154 debug_printf("Compile log for shader %s (type %s):\n%s", 155 155 pathname.string().c_str(), 156 156 shader_type_to_string(shdr->type, typenamebuf, ARRAY_SIZE(typenamebuf)), 157 157 infolog); … … 168 168 ogl_WarnIfError(); 169 169 170 170 char typenamebuf[32]; 171 debug_printf("Failed to compile shader % hs (type %hs)\n",171 debug_printf("Failed to compile shader %s (type %s)\n", 172 172 pathname.string().c_str(), 173 173 shader_type_to_string(shdr->type, typenamebuf, ARRAY_SIZE(typenamebuf))); 174 174 … … 276 276 277 277 if (Type.empty()) 278 278 { 279 LOG(CLogger::Error, LOG_CATEGORY, "% hs: Missing attribute \"type\" in element \"Shader\".", pathname.string().c_str());279 LOG(CLogger::Error, LOG_CATEGORY, "%s: Missing attribute \"type\" in element \"Shader\".", pathname.string().c_str()); 280 280 WARN_RETURN(ERR::CORRUPTED); 281 281 } 282 282 … … 284 284 285 285 if (!shadertype) 286 286 { 287 LOG(CLogger::Error, LOG_CATEGORY, "% hs: Unknown shader type \"%hs\" (valid are: VERTEX_SHADER, FRAGMENT_SHADER).", pathname.string().c_str(), Type.c_str());287 LOG(CLogger::Error, LOG_CATEGORY, "%s: Unknown shader type \"%s\" (valid are: VERTEX_SHADER, FRAGMENT_SHADER).", pathname.string().c_str(), Type.c_str()); 288 288 WARN_RETURN(ERR::CORRUPTED); 289 289 } 290 290 … … 292 292 293 293 if (Name.empty()) 294 294 { 295 LOG(CLogger::Error, LOG_CATEGORY, "% hs: Missing shader name.", pathname.string().c_str());295 LOG(CLogger::Error, LOG_CATEGORY, "%s: Missing shader name.", pathname.string().c_str()); 296 296 WARN_RETURN(ERR::CORRUPTED); 297 297 } 298 298 … … 345 345 346 346 if (Root.GetNodeName() != el_program) 347 347 { 348 LOG(CLogger::Error, LOG_CATEGORY, "% hs: XML root was not \"Program\".", pathname);348 LOG(CLogger::Error, LOG_CATEGORY, "%s: XML root was not \"Program\".", pathname); 349 349 WARN_RETURN(ERR::CORRUPTED); 350 350 } 351 351 … … 366 366 367 367 if (Shader.GetNodeName() != el_shader) 368 368 { 369 LOG(CLogger::Error, LOG_CATEGORY, "% hs: Only \"Shader\" may be child of \"Shaders\".", pathname);369 LOG(CLogger::Error, LOG_CATEGORY, "%s: Only \"Shader\" may be child of \"Shaders\".", pathname); 370 370 WARN_RETURN(ERR::CORRUPTED); 371 371 } 372 372 … … 375 375 } 376 376 else 377 377 { 378 LOG(CLogger::Warning, LOG_CATEGORY, "% hs: Unknown child of \"Program\".", pathname);378 LOG(CLogger::Warning, LOG_CATEGORY, "%s: Unknown child of \"Program\".", pathname); 379 379 } 380 380 } 381 381 … … 391 391 char* infolog = new char[log_length]; 392 392 pglGetProgramInfoLog(p->id, log_length, 0, infolog); 393 393 394 debug_printf("Linker log for % hs:\n%hs\n", pathname, infolog);394 debug_printf("Linker log for %s:\n%s\n", pathname, infolog); 395 395 delete[] infolog; 396 396 } 397 397 398 398 if (!linked) 399 399 { 400 debug_printf("Link failed for % hs\n", pathname);400 debug_printf("Link failed for %s\n", pathname); 401 401 WARN_RETURN(ERR::SHDR_LINK); 402 402 } 403 403 -
source/renderer/Renderer.cpp
710 710 if (name == "default") 711 711 return RP_DEFAULT; 712 712 713 LOG(CLogger::Warning, LOG_CATEGORY, "Unknown render path name '% hs', assuming 'default'", name.c_str());713 LOG(CLogger::Warning, LOG_CATEGORY, "Unknown render path name '%s', assuming 'default'", name.c_str()); 714 714 return RP_DEFAULT; 715 715 } 716 716