Michael Stefaniuc : shell32: Use a helper to trace the type of a STRRET.

Alexandre Julliard julliard at winehq.org
Wed Sep 12 13:39:15 CDT 2012


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

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Wed Sep 12 12:21:41 2012 +0200

shell32: Use a helper to trace the type of a STRRET.

---

 dlls/shell32/shellstring.c |   33 +++++++++++++++++++--------------
 1 files changed, 19 insertions(+), 14 deletions(-)

diff --git a/dlls/shell32/shellstring.c b/dlls/shell32/shellstring.c
index 5961920..792b1db 100644
--- a/dlls/shell32/shellstring.c
+++ b/dlls/shell32/shellstring.c
@@ -42,14 +42,24 @@ WINE_DEFAULT_DEBUG_CHANNEL(shell);
 
 /************************* STRRET functions ****************************/
 
+static const char *debugstr_strret(STRRET *s)
+{
+    switch (s->uType)
+    {
+        case STRRET_WSTR:
+            return "STRRET_WSTR";
+        case STRRET_CSTR:
+            return "STRRET_CSTR";
+        case STRRET_OFFSET:
+            return "STRRET_OFFSET";
+        default:
+            return "STRRET_???";
+    }
+}
+
 BOOL WINAPI StrRetToStrNA(LPSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
 {
-	TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
-	    dest,len,src,
-	    (src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
-	    (src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
-	    (src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
-	    pidl);
+    TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n", dest, len, src, debugstr_strret(src), pidl);
 
     if (!dest)
         return FALSE;
@@ -70,7 +80,7 @@ BOOL WINAPI StrRetToStrNA(LPSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST
 	    break;
 
 	  default:
-	    FIXME("unknown type!\n");
+            FIXME("unknown type %u!\n", src->uType);
 	    if (len) *dest = '\0';
 	    return FALSE;
 	}
@@ -82,12 +92,7 @@ BOOL WINAPI StrRetToStrNA(LPSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST
 
 BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST *pidl)
 {
-	TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n",
-	    dest,len,src,
-	    (src->uType == STRRET_WSTR) ? "STRRET_WSTR" :
-	    (src->uType == STRRET_CSTR) ? "STRRET_CSTR" :
-	    (src->uType == STRRET_OFFSET) ? "STRRET_OFFSET" : "STRRET_???",
-	    pidl);
+    TRACE("dest=%p len=0x%x strret=%p(%s) pidl=%p\n", dest, len, src, debugstr_strret(src), pidl);
 
     if (!dest)
         return FALSE;
@@ -110,7 +115,7 @@ BOOL WINAPI StrRetToStrNW(LPWSTR dest, DWORD len, LPSTRRET src, const ITEMIDLIST
 	    break;
 
 	  default:
-	    FIXME("unknown type!\n");
+            FIXME("unknown type %u!\n", src->uType);
 	    if (len) *dest = '\0';
 	    return FALSE;
 	}




More information about the wine-cvs mailing list