Commit 8b20c588 authored by Alex Henrie's avatar Alex Henrie Committed by Alexandre Julliard

include: Introduce wine_dbgstr_fourcc and debugstr_fourcc.

parent b490890d
...@@ -70,15 +70,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dxof_parsing); ...@@ -70,15 +70,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3dxof_parsing);
#define CLSIDFMT "<%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>" #define CLSIDFMT "<%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X>"
/* FOURCC to string conversion for debug messages */
static const char *debugstr_fourcc(DWORD fourcc)
{
if (!fourcc) return "'null'";
return wine_dbg_sprintf ("\'%c%c%c%c\'",
(char)(fourcc), (char)(fourcc >> 8),
(char)(fourcc >> 16), (char)(fourcc >> 24));
}
static const char* get_primitive_string(DWORD token) static const char* get_primitive_string(DWORD token)
{ {
switch(token) switch(token)
......
...@@ -121,10 +121,3 @@ HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface, ...@@ -121,10 +121,3 @@ HRESULT WINAPI unimpl_IPersistStream_GetSizeMax(IPersistStream *iface,
const char *debugstr_chunk(const struct chunk_entry *chunk); const char *debugstr_chunk(const struct chunk_entry *chunk);
const char *debugstr_dmguid(const GUID *id); const char *debugstr_dmguid(const GUID *id);
void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc); void dump_DMUS_OBJECTDESC(DMUS_OBJECTDESC *desc);
static inline const char *debugstr_fourcc(DWORD fourcc)
{
if (!fourcc) return "''";
return wine_dbg_sprintf("'%c%c%c%c'", (char)(fourcc), (char)(fourcc >> 8),
(char)(fourcc >> 16), (char)(fourcc >> 24));
}
...@@ -324,6 +324,16 @@ static inline const char *wine_dbgstr_guid( const GUID *id ) ...@@ -324,6 +324,16 @@ static inline const char *wine_dbgstr_guid( const GUID *id )
id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] ); id->Data4[4], id->Data4[5], id->Data4[6], id->Data4[7] );
} }
static inline const char *wine_dbgstr_fourcc( unsigned int fourcc )
{
char str[4] = { fourcc, fourcc >> 8, fourcc >> 16, fourcc >> 24 };
if (!fourcc)
return "''";
if (isprint( str[0] ) && isprint( str[1] ) && isprint( str[2] ) && isprint( str[3] ))
return wine_dbg_sprintf( "'%4s'", str );
return wine_dbg_sprintf( "0x%08x", fourcc );
}
static inline const char *wine_dbgstr_point( const POINT *pt ) static inline const char *wine_dbgstr_point( const POINT *pt )
{ {
if (!pt) return "(null)"; if (!pt) return "(null)";
...@@ -504,6 +514,7 @@ static inline const char *wine_dbgstr_variant( const VARIANT *v ) ...@@ -504,6 +514,7 @@ static inline const char *wine_dbgstr_variant( const VARIANT *v )
static inline const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); } static inline const char *debugstr_an( const char * s, int n ) { return wine_dbgstr_an( s, n ); }
static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); } static inline const char *debugstr_wn( const WCHAR *s, int n ) { return wine_dbgstr_wn( s, n ); }
static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); } static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_dbgstr_guid(id); }
static inline const char *debugstr_fourcc( unsigned int cc ) { return wine_dbgstr_fourcc( cc ); }
static inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); } static inline const char *debugstr_a( const char *s ) { return wine_dbgstr_an( s, -1 ); }
static inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); } static inline const char *debugstr_w( const WCHAR *s ) { return wine_dbgstr_wn( s, -1 ); }
......
...@@ -55,14 +55,6 @@ static const char *strmbase_debugstr_guid(const GUID *guid) ...@@ -55,14 +55,6 @@ static const char *strmbase_debugstr_guid(const GUID *guid)
return debugstr_guid(guid); return debugstr_guid(guid);
} }
static const char *debugstr_fourcc(DWORD fourcc)
{
char str[4] = {fourcc, fourcc >> 8, fourcc >> 16, fourcc >> 24};
if (isprint(str[0]) && isprint(str[1]) && isprint(str[2]) && isprint(str[3]))
return wine_dbgstr_an(str, 4);
return wine_dbg_sprintf("%#lx", fourcc);
}
void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt) void strmbase_dump_media_type(const AM_MEDIA_TYPE *mt)
{ {
if (!TRACE_ON(quartz) || !mt) return; if (!TRACE_ON(quartz) || !mt) return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment