[mupen64plus-video-glide64] 30/172: Correct usage of printf format strings

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:11:43 UTC 2015


This is an automated email from the git hooks/post-receive script.

ecsv-guest pushed a commit to branch master
in repository mupen64plus-video-glide64.

commit 5ba413f759d5a0b9460cefc07d0ad382d8cec8e4
Author: Sven Eckelmann <sven.eckelmann at gmx.de>
Date:   Thu Sep 9 12:56:04 2010 +0200

    Correct usage of printf format strings
---
 debian/changelog                  |   1 +
 debian/patches/printf_fixup.patch | 163 ++++++++++++++++++++++++++++++++++++++
 debian/patches/series             |   1 +
 3 files changed, 165 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 1700741..0f91407 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -21,6 +21,7 @@ mupen64plus-video-glide64 (1.99.4~hg20100511-1) UNRELEASED; urgency=low
     - Rebase default-optimisations.patch, path_max.patch and glide64_hurd.patch
       against 1.99.4~hg20100511
     - Add hurd_os.patch, Add GNU/Hurd as operating system with "linux" userland
+    - Add printf_fixup.patch, Correct usage of printf format strings
   * Convert to 3.0 (quilt) source format
   * debian/control:
     - Remove unneeded build dependency to quilt
diff --git a/debian/patches/printf_fixup.patch b/debian/patches/printf_fixup.patch
new file mode 100644
index 0000000..03a2244
--- /dev/null
+++ b/debian/patches/printf_fixup.patch
@@ -0,0 +1,163 @@
+
+
+---
+diff --git a/src/Debugger.cpp b/src/Debugger.cpp
+index 88b2faad4394909c2bf9f99b23929e7ff68cb6ba..1dd50d683258449572d648acbe894b99c8f48f34 100644
+--- a/src/Debugger.cpp
++++ b/src/Debugger.cpp
+@@ -1013,7 +1013,6 @@ void debug_keys ()
+ //
+ // output - output debugger text
+ //
+-
+ void output (float x, float y, BOOL scale, const char *fmt, ...)
+ {
+   va_list ap;
+diff --git a/src/Debugger.h b/src/Debugger.h
+index 15539be4f59a8b0f3d87bb8a8c6287b40c7068c4..875c6deeeacd17fc2c1c66647646b89920737fa0 100644
+--- a/src/Debugger.h
++++ b/src/Debugger.h
+@@ -133,5 +133,5 @@ void debug_capture ();
+ void debug_cacheviewer ();
+ void debug_mouse ();
+ void debug_keys ();
+-void output (float x, float y, BOOL scale, const char *fmt, ...);
++void output (float x, float y, BOOL scale, const char *fmt, ...) __attribute__ ((format (printf, 4, 5)));
+ 
+diff --git a/src/Gfx1.3.h b/src/Gfx1.3.h
+index e76d54ad45b3b2eea7087de20038151b5bcc3c40..9e5463b3ffa5d8244e423058a6e04e94ca2a0550 100644
+--- a/src/Gfx1.3.h
++++ b/src/Gfx1.3.h
+@@ -233,7 +233,7 @@ extern __int64 perf_next;
+ 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
+ 
+ 
+@@ -273,6 +273,7 @@ extern std::ofstream rdp_err;
+ 
+ 
+ #ifdef RDP_LOGGING
++__inline void FRDP (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+ __inline void FRDP (const char *fmt, ...)
+ {
+ #ifdef RDP_LOGGING
+@@ -289,6 +290,7 @@ __inline void FRDP (const char *fmt, ...)
+     va_end(ap);
+ #endif
+ }
++__inline void FRDP_E (const char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
+ __inline void FRDP_E (const char *fmt, ...)
+ {
+ #ifdef RDP_ERROR_LOG
+diff --git a/src/m64p.h b/src/m64p.h
+index fc22fbf157b7c9e1507c6a2430268afc71d4c4f8..af6e1bbb8be0772b38eeee282b9ee459c4a9815e 100644
+--- a/src/m64p.h
++++ b/src/m64p.h
+@@ -28,7 +28,7 @@
+ #include "m64p_vidext.h"
+ #include <stdio.h>
+ 
+-void WriteLog(m64p_msg_level level, const char *msg, ...);
++void WriteLog(m64p_msg_level level, const char *msg, ...) __attribute__ ((format (printf, 2, 3)));
+ 
+ //The Glide API originally used an integer to pick an enumerated resolution.
+ //To accomodate arbitrary resolutions, pack it into a 32-bit struct
+diff --git a/src/wrapper/combiner.cpp b/src/wrapper/combiner.cpp
+index 6f2f189083942180eb331d155ea84494ddbeb84f..484a880f4a0d07dfc55c64200d5487b22b7f90c1 100644
+--- a/src/wrapper/combiner.cpp
++++ b/src/wrapper/combiner.cpp
+@@ -371,11 +371,11 @@ void init_combiner()
+         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");
+@@ -421,11 +421,11 @@ void init_combiner()
+         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");
+@@ -661,12 +661,12 @@ void compile_shader()
+     {
+         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");
+diff --git a/src/wrapper/main.cpp b/src/wrapper/main.cpp
+index bbffe11a7a3522d1dd77aa6cb76b88c7eb712dca..12da5cb47ac58c7734c83c4a3b917a2202922a5a 100644
+--- a/src/wrapper/main.cpp
++++ b/src/wrapper/main.cpp
+@@ -230,7 +230,7 @@ void display_warning(const char *text, ...)
+         vsprintf((char*)buf, (char*)text, ap);
+         va_end(ap);
+ 
+-        WriteLog(M64MSG_WARNING, buf);
++        WriteLog(M64MSG_WARNING, "%s", buf);
+         first_message--;
+     }
+ }
+@@ -1283,7 +1283,7 @@ void updateTexture()
+ 
+     // nothing changed, don't update the texture
+     if (!buffer_cleared) {
+-      WriteLog(M64MSG_VERBOSE, "update cancelled\n", pBufferAddress);
++      WriteLog(M64MSG_VERBOSE, "update cancelled\n");
+       return;
+     }
+     
+diff --git a/src/wrapper/main.h b/src/wrapper/main.h
+index a5333f27162b89703241bf126f0c61b6125d8026..28c045a3fef9a03741199a1bc66016aa5df44b37 100644
+--- a/src/wrapper/main.h
++++ b/src/wrapper/main.h
+@@ -92,8 +92,7 @@ extern int buffer_cleared; // mark that the buffer has been cleared, used to che
+ 
+ #include "glide.h"
+ 
+-void display_warning(const unsigned char *text, ...);
+-void display_warning(const char *text, ...);
++void display_warning(const char *text, ...) __attribute__ ((format (printf, 1, 2)));
+ void init_geometry();
+ void init_textures();
+ void init_combiner();
+@@ -283,7 +282,7 @@ grConstantColorValueExt(GrChipID_t    tmu,
+ #ifdef LOGGING
+ void OPEN_LOG();
+ void CLOSE_LOG();
+-void LOG(char *text, ...);
++void LOG(char *text, ...) __attribute__ ((format (printf, 1, 2)));
+ #else // LOGGING
+ #define OPEN_LOG()
+ #define CLOSE_LOG()
diff --git a/debian/patches/series b/debian/patches/series
index e7ecd79..73069d6 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -2,3 +2,4 @@ default-optimisations.patch
 hurd_os.patch
 path_max.patch
 glide64_hurd.patch
+printf_fixup.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/mupen64plus-video-glide64.git



More information about the Pkg-games-commits mailing list