Henri Verbeet : winecoreaudio.drv: Use wine_dbg_sprintf() in a few debug utility functions.

Alexandre Julliard julliard at winehq.org
Mon Nov 30 10:42:47 CST 2009


Module: wine
Branch: master
Commit: c369f338933e208a3b93f87fdc1d2072626f9e88
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c369f338933e208a3b93f87fdc1d2072626f9e88

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Mon Nov 30 10:22:11 2009 +0100

winecoreaudio.drv: Use wine_dbg_sprintf() in a few debug utility functions.

---

 dlls/winecoreaudio.drv/audio.c |    4 +---
 dlls/winecoreaudio.drv/mixer.c |   16 ++++------------
 2 files changed, 5 insertions(+), 15 deletions(-)

diff --git a/dlls/winecoreaudio.drv/audio.c b/dlls/winecoreaudio.drv/audio.c
index f48a5aa..8223dff 100644
--- a/dlls/winecoreaudio.drv/audio.c
+++ b/dlls/winecoreaudio.drv/audio.c
@@ -264,7 +264,6 @@ OSStatus CoreAudio_wiAudioUnitIOProc(void *inRefCon,
 
 static const char * getMessage(UINT msg)
 {
-    static char unknown[32];
 #define MSG_TO_STR(x) case x: return #x
     switch(msg) {
         MSG_TO_STR(DRVM_INIT);
@@ -306,8 +305,7 @@ static const char * getMessage(UINT msg)
         MSG_TO_STR(DRV_QUERYDSOUNDDESC);
     }
 #undef MSG_TO_STR
-    sprintf(unknown, "UNKNOWN(0x%04x)", msg);
-    return unknown;
+    return wine_dbg_sprintf("UNKNOWN(0x%04x)", msg);
 }
 
 #define kStopLoopMessage 0
diff --git a/dlls/winecoreaudio.drv/mixer.c b/dlls/winecoreaudio.drv/mixer.c
index 7c01c57..389caad 100644
--- a/dlls/winecoreaudio.drv/mixer.c
+++ b/dlls/winecoreaudio.drv/mixer.c
@@ -92,7 +92,6 @@ static int numMixers = 1;
 
 static const char * getMessage(UINT uMsg)
 {
-    static char str[64];
 #define MSG_TO_STR(x) case x: return #x;
     switch (uMsg) {
         MSG_TO_STR(DRVM_INIT);
@@ -109,13 +108,11 @@ static const char * getMessage(UINT uMsg)
         MSG_TO_STR(MXDM_SETCONTROLDETAILS);
     }
 #undef MSG_TO_STR
-        sprintf(str, "UNKNOWN(%08x)", uMsg);
-    return str;
+    return wine_dbg_sprintf("UNKNOWN(%08x)", uMsg);
 }
 
 static const char * getControlType(DWORD dwControlType)
 {
-    static char str[64];
 #define TYPE_TO_STR(x) case x: return #x;
     switch (dwControlType) {
         TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_CUSTOM);
@@ -151,13 +148,11 @@ static const char * getControlType(DWORD dwControlType)
         TYPE_TO_STR(MIXERCONTROL_CONTROLTYPE_MILLITIME);
     }
 #undef TYPE_TO_STR
-        sprintf(str, "UNKNOWN(%08x)", dwControlType);
-    return str;
+    return wine_dbg_sprintf("UNKNOWN(%08x)", dwControlType);
 }
 
 static const char * getComponentType(DWORD dwComponentType)
 {
-    static char str[64];
 #define TYPE_TO_STR(x) case x: return #x;
     switch (dwComponentType) {
         TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_DST_UNDEFINED);
@@ -182,13 +177,11 @@ static const char * getComponentType(DWORD dwComponentType)
         TYPE_TO_STR(MIXERLINE_COMPONENTTYPE_SRC_ANALOG);
     }
 #undef TYPE_TO_STR
-        sprintf(str, "UNKNOWN(%08x)", dwComponentType);
-    return str;
+    return wine_dbg_sprintf("UNKNOWN(%08x)", dwComponentType);
 }
 
 static const char * getTargetType(DWORD dwType)
 {
-    static char str[64];
 #define TYPE_TO_STR(x) case x: return #x;
     switch (dwType) {
         TYPE_TO_STR(MIXERLINE_TARGETTYPE_UNDEFINED);
@@ -199,8 +192,7 @@ static const char * getTargetType(DWORD dwType)
         TYPE_TO_STR(MIXERLINE_TARGETTYPE_AUX);
     }
 #undef TYPE_TO_STR
-        sprintf(str, "UNKNOWN(%08x)", dwType);
-    return str;
+    return wine_dbg_sprintf("UNKNOWN(%08x)", dwType);
 }
 
 /* FIXME is there a better way ? */




More information about the wine-cvs mailing list