Commits

ecsv committed 530b074

Fix some -Wformat related warnings

  • Participants
  • Parent commits 4069614

Comments (0)

Files changed (4)

 extern std::ofstream loga;
 #define LOG(x) loga.open("log.txt",ios::app); loga << x; loga.flush(); loga.close();
 #else
-#define LOG(x) WriteLog(M64MSG_VERBOSE, x);
+#define LOG(x) WriteLog(M64MSG_VERBOSE, "%s", x);
 #endif
 
 

src/wrapper/combiner.cpp

         if(!log_length)
         {
             glGetInfoLogARB(fragment_shader_object, 2048, &log_length, shader_log);
-            if(log_length) display_warning(shader_log);
+            if(log_length) display_warning("%s", shader_log);
             glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
-            if(log_length) display_warning(shader_log);
+            if(log_length) display_warning("%s", shader_log);
             glGetInfoLogARB(program_object, 2048, &log_length, shader_log);
-            if(log_length) display_warning(shader_log);
+            if(log_length) display_warning("%s", shader_log);
         }
 
         texture0_location = glGetUniformLocationARB(program_object, "texture0");
         if(!log_length)
         {
             glGetInfoLogARB(fragment_shader_object, 2048, &log_length, shader_log);
-            if(log_length) display_warning(shader_log);
+            if(log_length) display_warning("%s", shader_log);
             glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
-            if(log_length) display_warning(shader_log);
+            if(log_length) display_warning("%s", shader_log);
             glGetInfoLogARB(program_object, 2048, &log_length, shader_log);
-            if(log_length) display_warning(shader_log);
+            if(log_length) display_warning("%s", shader_log);
         }
 
         texture0_location = glGetUniformLocationARB(program_object, "texture0");
     {
         glGetInfoLogARB(shader_programs[number_of_programs].fragment_shader_object, 
             2048, &log_length, shader_log);
-        if(log_length) display_warning(shader_log);
+        if(log_length) display_warning("%s", shader_log);
         glGetInfoLogARB(vertex_shader_object, 2048, &log_length, shader_log);
-        if(log_length) display_warning(shader_log);
+        if(log_length) display_warning("%s", shader_log);
         glGetInfoLogARB(program_object, 
             2048, &log_length, shader_log);
-        if(log_length) display_warning(shader_log);
+        if(log_length) display_warning("%s", shader_log);
     }
 
     texture0_location = glGetUniformLocationARB(program_object, "texture0");

src/wrapper/main.cpp

         vsprintf((char*)buf, (char*)text, ap);
         va_end(ap);
 
-        WriteLog(M64MSG_WARNING, buf);
+        WriteLog(M64MSG_WARNING, "%s", buf);
         first_message--;
     }
 }
 
     // nothing changed, don't update the texture
     if (!buffer_cleared) {
-      WriteLog(M64MSG_VERBOSE, "update cancelled\n", pBufferAddress);
+      WriteLog(M64MSG_VERBOSE, "update cancelled\n");
       return;
     }
     

src/wrapper/textures.cpp

                    float detail_max
                    )
 {
-    WriteLog(M64MSG_VERBOSE, "grTexDetailControl(%d,%d,%d,%d)\r\n", tmu, lod_bias, detail_scale, detail_max);
+    WriteLog(M64MSG_VERBOSE, "grTexDetailControl(%d,%d,%d,%f)\r\n", tmu, lod_bias, detail_scale, detail_max);
     if (lod_bias != 31 && detail_scale != 7)
     {
         if (!lod_bias && !detail_scale && !detail_max) return;