Alexandre Julliard : dnsapi: Make type_to_str() into a proper debugstr function.

Alexandre Julliard julliard at winehq.org
Tue Nov 2 17:27:45 CDT 2021


Module: wine
Branch: master
Commit: 87f94202bb391cfcc7e65505cefa92f196e4f09b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=87f94202bb391cfcc7e65505cefa92f196e4f09b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Nov  2 12:45:10 2021 +0100

dnsapi: Make type_to_str() into a proper debugstr function.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dnsapi/dnsapi.h    | 2 +-
 dlls/dnsapi/libresolv.c | 2 +-
 dlls/dnsapi/query.c     | 8 ++++----
 dlls/dnsapi/record.c    | 6 +++---
 4 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/dlls/dnsapi/dnsapi.h b/dlls/dnsapi/dnsapi.h
index c598ade756e..a356d24b1f0 100644
--- a/dlls/dnsapi/dnsapi.h
+++ b/dlls/dnsapi/dnsapi.h
@@ -119,7 +119,7 @@ static inline char *strdup_ua( const char *src )
     return dst;
 }
 
-extern const char *type_to_str( unsigned short ) DECLSPEC_HIDDEN;
+extern const char *debugstr_type( unsigned short ) DECLSPEC_HIDDEN;
 
 struct resolv_funcs
 {
diff --git a/dlls/dnsapi/libresolv.c b/dlls/dnsapi/libresolv.c
index e5c520a0a32..e72e86ad1b1 100644
--- a/dlls/dnsapi/libresolv.c
+++ b/dlls/dnsapi/libresolv.c
@@ -109,7 +109,7 @@ static DWORD dnsapi_umbstowcs( const char *src, WCHAR *dst, DWORD dstlen )
     }
 }
 
-static const char *debugstr_type( unsigned short type )
+const char *debugstr_type( unsigned short type )
 {
     const char *str;
 
diff --git a/dlls/dnsapi/query.c b/dlls/dnsapi/query.c
index 3155c93b360..3f2e82eb9c1 100644
--- a/dlls/dnsapi/query.c
+++ b/dlls/dnsapi/query.c
@@ -110,7 +110,7 @@ static const char *debugstr_query_request(const DNS_QUERY_REQUEST *req)
         return "(null)";
 
     return wine_dbg_sprintf("{%d %s %s %x%08x %p %d %p %p}", req->Version,
-            debugstr_w(req->QueryName), type_to_str(req->QueryType),
+            debugstr_w(req->QueryName), debugstr_type(req->QueryType),
             (UINT32)(req->QueryOptions>>32u), (UINT32)req->QueryOptions, req->pDnsServerList,
             req->InterfaceIndex, req->pQueryCompletionCallback, req->pQueryContext);
 }
@@ -136,7 +136,7 @@ DNS_STATUS WINAPI DnsQuery_A( PCSTR name, WORD type, DWORD options, PVOID server
     DNS_RECORDW *resultW;
     DNS_STATUS status;
 
-    TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_a(name), type_to_str( type ),
+    TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_a(name), debugstr_type( type ),
            options, servers, result, reserved );
 
     if (!name || !result)
@@ -169,7 +169,7 @@ DNS_STATUS WINAPI DnsQuery_UTF8( PCSTR name, WORD type, DWORD options, PVOID ser
 {
     DNS_STATUS ret = DNS_ERROR_RCODE_NOT_IMPLEMENTED;
 
-    TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_a(name), type_to_str( type ),
+    TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_a(name), debugstr_type( type ),
            options, servers, result, reserved );
 
     if (!name || !result)
@@ -200,7 +200,7 @@ DNS_STATUS WINAPI DnsQuery_W( PCWSTR name, WORD type, DWORD options, PVOID serve
     DNS_RECORDA *resultA;
     DNS_STATUS status;
 
-    TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_w(name), type_to_str( type ),
+    TRACE( "(%s,%s,0x%08x,%p,%p,%p)\n", debugstr_w(name), debugstr_type( type ),
            options, servers, result, reserved );
 
     if (!name || !result)
diff --git a/dlls/dnsapi/record.c b/dlls/dnsapi/record.c
index 014d788cf5e..1fdbae523eb 100644
--- a/dlls/dnsapi/record.c
+++ b/dlls/dnsapi/record.c
@@ -29,7 +29,7 @@
 
 WINE_DEFAULT_DEBUG_CHANNEL(dnsapi);
 
-const char *type_to_str( unsigned short type )
+const char *debugstr_type( unsigned short type )
 {
     switch (type)
     {
@@ -91,7 +91,7 @@ const char *type_to_str( unsigned short type )
     X(DNS_TYPE_WINS)
     X(DNS_TYPE_WINSR)
 #undef X
-    default: { static char tmp[7]; sprintf( tmp, "0x%04x", type ); return tmp; }
+    default: return wine_dbg_sprintf( "0x%04x", type );
     }
 }
 
@@ -339,7 +339,7 @@ BOOL WINAPI DnsRecordCompare( PDNS_RECORD r1, PDNS_RECORD r2 )
         break;
     }
     default:
-        FIXME( "unknown type: %s\n", type_to_str( r1->wType ) );
+        FIXME( "unknown type: %s\n", debugstr_type( r1->wType ) );
         return FALSE;
     }
     return TRUE;




More information about the wine-cvs mailing list