[mupen64plus-video-z64] 25/161: Correct usage of printf format strings

Sven Eckelmann ecsv-guest at moszumanska.debian.org
Thu Nov 26 06:20:22 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-z64.

commit ebb18df3a8cc33729d67193cb0f6617383999e55
Author: Sven Eckelmann <sven.eckelmann at gmx.de>
Date:   Thu Sep 9 12:37:59 2010 +0200

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

diff --git a/debian/changelog b/debian/changelog
index 9652db9..bd16cf9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -20,6 +20,7 @@ mupen64plus-video-z64 (1.99.4~hg20100403-1) UNRELEASED; urgency=low
       dont-install-unneeded.patch, rice-ati-symbols.patch, link_gdk.patch
     - Rebase default-optimisations.patch against 1.99.4~hg20100403
     - 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..5c065a3
--- /dev/null
+++ b/debian/patches/printf_fixup.patch
@@ -0,0 +1,105 @@
+
+
+---
+diff --git a/src/rdp.cpp b/src/rdp.cpp
+index 2221f5e3d300ac70c1cf23fd531bb624c0742b70..e1abe35a3cbe2808fea71b2e6b81563a05468fe3 100644
+--- a/src/rdp.cpp
++++ b/src/rdp.cpp
+@@ -453,7 +453,7 @@ static void rdp_load_block(uint32_t w1, uint32_t w2)
+         tl * rdpTiWidth*4 + rdpTiAddress + sl*4, 0, ~0, ~0);
+ 
+     if (tb+width/4 > 0x1000/4) {
+-        LOG("load_block : fixup too large width\n", width, 0x1000-tb*4);
++        LOG("load_block : fixup too large width\n");
+         width = 0x1000-tb*4;
+     }
+ 
+diff --git a/src/rdp.h b/src/rdp.h
+index e663107a2cfe1c9c6cf2247b8b97a97711aa33a4..f06d4df353a9a36cf78896e3f07706af8f0470b6 100644
+--- a/src/rdp.h
++++ b/src/rdp.h
+@@ -246,7 +246,7 @@ int rdp_dasm(uint32_t * rdp_cmd_data, int rdp_cmd_cur, int length, char *buffer)
+ void rdp_process_list(void);
+ int rdp_store_list(void);
+ 
+-void rdp_log(m64p_msg_level level, const char *msg, ...);
++void rdp_log(m64p_msg_level level, const char *msg, ...) __attribute__ ((format (printf, 2, 3)));
+ 
+ #ifdef RDP_DEBUG
+ 
+@@ -257,6 +257,7 @@ extern int rdp_dump;
+ 
+ #define DUMP if (!rdp_dump) ; else LOG
+ 
++static void LOG(const char * s, ...) __attribute__ ((format (printf, 1, 2)));
+ static void LOG(const char * s, ...)
+ {
+     va_list ap;
+diff --git a/src/rgl.cpp b/src/rgl.cpp
+index 3150a5feb8ef12dfde4b672a8234196cba3cb501..275bba1c2fe8d0e9412d9ab3b7bc19ddc81f277f 100644
+--- a/src/rgl.cpp
++++ b/src/rgl.cpp
+@@ -344,7 +344,7 @@ int rglUseTile(rglTile_t & tile, float & ds, float & dt, float & ss, float & st)
+         ds = ss - ds;
+         dt = st - dt;
+ 
+-        DUMP("texture fb %x shift %g x %g (scale %g x %g) tile %d x %d (sl %d tl %d)\n",
++        DUMP("texture fb %p shift %g x %g (scale %g x %g) tile %d x %d (sl %d tl %d)\n",
+             &hbuf, ds, dt, ss, st, tile.w, tile.h,
+             tile.sl, tile.tl);
+     } else {
+@@ -435,7 +435,7 @@ void rglPrepareFramebuffer(rglRenderBuffer_t & buffer)
+             rglDeleteRenderBuffer(buffer);
+     }
+ 
+-    DUMP("Render buffer %x at %x --> %x\n", &buffer,
++    DUMP("Render buffer %p at %x --> %x\n", &buffer,
+         buffer.addressStart, buffer.addressStop);
+ 
+     if (!buffer.fbid) {
+@@ -605,7 +605,7 @@ void rglRenderChunks(int upto)
+         if (lastBuffer != &buffer)
+             rglPrepareFramebuffer(buffer);
+ 
+-        DUMP("Buffer %x at %x area %d -> %d x %d -> %d\n",
++        DUMP("Buffer %p at %x area %d -> %d x %d -> %d\n",
+             &buffer, buffer.addressStart,
+             buffer.area.xh>>2, buffer.area.xl>>2,
+             buffer.area.yh>>2, buffer.area.yl>>2);
+diff --git a/src/rgl_debugger.cpp b/src/rgl_debugger.cpp
+index 9f871a4c2b4255433d5df1e7004ee27e37efeb39..9783a95dbbc6d0056f64a1c386af4dd85f3c2b0d 100644
+--- a/src/rgl_debugger.cpp
++++ b/src/rgl_debugger.cpp
+@@ -183,8 +183,8 @@ void gglPrint(int x, int y, const char * text)
+ 
+     //printf("%s\n", text);
+ }
+-
+-void gglPrintf(int x, int y, const char * s, ...)
++static void gglPrintf(int x, int y, const char * s, ...) __attribute__ ((format (printf, 1, 2)));
++static void gglPrintf(int x, int y, const char * s, ...)
+ {
+     char buf[1024];
+     va_list ap;
+diff --git a/src/rgl_rendermode.cpp b/src/rgl_rendermode.cpp
+index 0c9bf4eeb0c1d46d6781fbcc01f6376262cc187b..2b69d93404e877215821eb043faca7e699069e08 100644
+--- a/src/rgl_rendermode.cpp
++++ b/src/rgl_rendermode.cpp
+@@ -610,7 +610,7 @@ case 0: // c
+     break;
+ case 1: // f
+     LOGERROR("Unsupported src color : FRAG\n");
+-    LOGERROR(rglCombiner2String(state));
++    LOGERROR("%s", rglCombiner2String(state));
+     break;
+ case 2: // b
+     p += sprintf(
+@@ -647,7 +647,7 @@ case 3:
+                 c->dstBlend = dst;
+             } else {
+                 LOGERROR("Unsuported blender :\n");
+-                LOGERROR(rglCombiner2String(state));
++                LOGERROR("%s", rglCombiner2String(state));
+             }
+         }
+         else
diff --git a/debian/patches/series b/debian/patches/series
index 16e335d..eb30664 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,3 @@
 default-optimisations.patch
 hurd_os.patch
+printf_fixup.patch

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



More information about the Pkg-games-commits mailing list