Commit d2886a05 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

wine/debug.h: Added debugstr_variant and debugstr_vt aliases and removed all…

wine/debug.h: Added debugstr_variant and debugstr_vt aliases and removed all duplicated implementations.
parent e18ef3cf
......@@ -310,8 +310,6 @@ HRESULT WINAPI InternetShortcut_Create(IClassFactory*,IUnknown*,REFIID,void**) D
HRESULT WINAPI WebBrowser_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
HRESULT WINAPI WebBrowserV1_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
extern LONG module_ref DECLSPEC_HIDDEN;
extern HINSTANCE ieframe_instance DECLSPEC_HIDDEN;
......
......@@ -29,33 +29,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
LONG module_ref = 0;
HINSTANCE ieframe_instance;
const char *debugstr_variant(const VARIANT *v)
{
if(!v)
return "(null)";
switch(V_VT(v)) {
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
case VT_ERROR:
return wine_dbg_sprintf("{VT_ERROR: %08x}", V_ERROR(v));
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
static ITypeLib *typelib;
static ITypeInfo *typeinfos[LAST_tid];
......
......@@ -525,7 +525,6 @@ static inline BOOL is_jscript_error(HRESULT hres)
return HRESULT_FACILITY(hres) == FACILITY_JSCRIPT;
}
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
const char *debugstr_jsval(const jsval_t) DECLSPEC_HIDDEN;
HRESULT create_jscript_object(BOOL,REFIID,void**) DECLSPEC_HIDDEN;
......
......@@ -30,35 +30,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(jscript);
WINE_DECLARE_DEBUG_CHANNEL(heap);
const char *debugstr_variant(const VARIANT *v)
{
if(!v)
return "(null)";
switch(V_VT(v)) {
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_UI4:
return wine_dbg_sprintf("{VT_UI4: %u}", V_UI4(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
case VT_ARRAY|VT_VARIANT:
return "{VT_ARRAY|VT_VARIANT: ...}";
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
const char *debugstr_jsval(const jsval_t v)
{
switch(jsval_type(v)) {
......
......@@ -501,37 +501,6 @@ HRESULT WINAPI DllUnregisterServer(void)
return hres;
}
const char *debugstr_variant(const VARIANT *v)
{
if(!v)
return "(null)";
switch(V_VT(v)) {
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I2:
return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v));
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_ERROR:
return wine_dbg_sprintf("{VT_ERROR: %08x}", V_ERROR(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
case VT_UINT:
return wine_dbg_sprintf("{VT_UINT: %u}", V_UINT(v));
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
const char *debugstr_mshtml_guid(const GUID *iid)
{
#define X(x) if(IsEqualGUID(iid, &x)) return #x
......
......@@ -1028,7 +1028,6 @@ void remove_target_tasks(LONG) DECLSPEC_HIDDEN;
HRESULT set_task_timer(HTMLInnerWindow*,DWORD,BOOL,IDispatch*,LONG*) DECLSPEC_HIDDEN;
HRESULT clear_task_timer(HTMLInnerWindow*,BOOL,DWORD) DECLSPEC_HIDDEN;
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
const char *debugstr_mshtml_guid(const GUID*) DECLSPEC_HIDDEN;
DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
......
......@@ -271,50 +271,6 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID reserved)
return TRUE;
}
const char *debugstr_variant(const VARIANT *v)
{
if(!v)
return "(null)";
switch(V_VT(v)) {
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I1:
return wine_dbg_sprintf("{VT_I1: %d}", V_I1(v));
case VT_I2:
return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v));
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_INT:
return wine_dbg_sprintf("{VT_INT: %d}", V_INT(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
case VT_UNKNOWN:
return wine_dbg_sprintf("{VT_UNKNOWN: %p}", V_UNKNOWN(v));
case VT_UINT:
return wine_dbg_sprintf("{VT_UINT: %u}", V_UINT(v));
case VT_BSTR|VT_BYREF:
return wine_dbg_sprintf("{VT_BSTR|VT_BYREF: ptr %p, data %s}",
V_BSTRREF(v), debugstr_w(V_BSTRREF(v) ? *V_BSTRREF(v) : NULL));
case VT_ERROR:
return wine_dbg_sprintf("{VT_ERROR: 0x%08x}", V_ERROR(v));
case VT_VARIANT|VT_BYREF:
return wine_dbg_sprintf("{VT_VARIANT|VT_BYREF: %s}", debugstr_variant(V_VARIANTREF(v)));
case VT_UI1|VT_ARRAY:
return "{VT_UI1|VT_ARRAY}";
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
/***********************************************************************
* DllRegisterServer (MSXML3.@)
*/
......
......@@ -544,8 +544,6 @@ HRESULT create_moniker_from_url(LPCWSTR, IMoniker**) DECLSPEC_HIDDEN;
HRESULT bind_url(IMoniker*, HRESULT (*onDataAvailable)(void*,char*,DWORD), void*, bsc_t**) DECLSPEC_HIDDEN;
HRESULT detach_bsc(bsc_t*) DECLSPEC_HIDDEN;
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
/* Error Codes - not defined anywhere in the public headers */
#define E_XML_ELEMENT_UNDECLARED 0xC00CE00D
#define E_XML_ELEMENT_ID_NOT_FOUND 0xC00CE00E
......
......@@ -87,38 +87,6 @@ static struct {
static HINSTANCE oleacc_handle = 0;
const char *debugstr_variant(const VARIANT *v)
{
if(!v)
return "(null)";
if(V_ISBYREF(v))
return wine_dbg_sprintf("{V_BYREF -> %s}", debugstr_variant(V_BYREF(v)));
switch(V_VT(v)) {
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I2:
return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v));
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_UI4:
return wine_dbg_sprintf("{VT_UI4: %u}", V_UI4(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
int convert_child_id(VARIANT *v)
{
switch(V_VT(v)) {
......
......@@ -21,7 +21,6 @@
HRESULT create_client_object(HWND, const IID*, void**) DECLSPEC_HIDDEN;
HRESULT create_window_object(HWND, const IID*, void**) DECLSPEC_HIDDEN;
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
int convert_child_id(VARIANT *v) DECLSPEC_HIDDEN;
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
......
......@@ -78,16 +78,6 @@ static const char * const variant_flags[16] =
"|VT_VECTOR|VT_ARRAY|VT_BYREF|VT_RESERVED",
};
const char *debugstr_vt(VARTYPE vt)
{
return wine_dbgstr_vt(vt);
}
const char *debugstr_variant(const VARIANT *v)
{
return wine_dbgstr_variant(v);
}
/* Convert a variant from one type to another */
static inline HRESULT VARIANT_Coerce(VARIANTARG* pd, LCID lcid, USHORT wFlags,
VARIANTARG* ps, VARTYPE vt)
......
......@@ -48,9 +48,6 @@
#define VTBIT_VARIANT (1 << VT_VARIANT)
#define VTBIT_15 (1 << 15) /* no variant type with this number */
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
const char *debugstr_vt(VARTYPE) DECLSPEC_HIDDEN;
/* Size constraints */
#define I1_MAX 0x7f
#define I1_MIN ((-I1_MAX)-1)
......
......@@ -180,34 +180,3 @@ HRESULT WINAPI DllUnregisterServer(void)
{
return __wine_unregister_resources(schd_instance);
}
const char *debugstr_variant(const VARIANT *v)
{
if (!v) return "(null)";
switch (V_VT(v))
{
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I2:
return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v));
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_ERROR:
return wine_dbg_sprintf("{VT_ERROR: %08x}", V_ERROR(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
case VT_UINT:
return wine_dbg_sprintf("{VT_UINT: %u}", V_UINT(v));
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
......@@ -30,7 +30,6 @@ HRESULT RegisteredTask_create(const WCHAR *path, const WCHAR *name, ITaskDefinit
HRESULT RegisteredTaskCollection_create(const WCHAR *path, IRegisteredTaskCollection **obj) DECLSPEC_HIDDEN;
WCHAR *get_full_path(const WCHAR *parent, const WCHAR *path) DECLSPEC_HIDDEN;
const char *debugstr_variant(const VARIANT *v) DECLSPEC_HIDDEN;
static void *heap_alloc_zero(SIZE_T size) __WINE_ALLOC_SIZE(1);
static inline void *heap_alloc_zero(SIZE_T size)
......
......@@ -426,8 +426,6 @@ HRESULT map_hres(HRESULT) DECLSPEC_HIDDEN;
HRESULT WINAPI VBScriptFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
HRESULT WINAPI VBScriptRegExpFactory_CreateInstance(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
static inline void *heap_alloc(size_t len)
{
return HeapAlloc(GetProcessHeap(), 0, len);
......
......@@ -95,38 +95,6 @@ static void release_typelib(void)
ITypeLib_Release(typelib);
}
const char *debugstr_variant(const VARIANT *v)
{
if(!v)
return "(null)";
if(V_ISBYREF(v))
return wine_dbg_sprintf("{V_BYREF -> %s}", debugstr_variant(V_BYREF(v)));
switch(V_VT(v)) {
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I2:
return wine_dbg_sprintf("{VT_I2: %d}", V_I2(v));
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_UI4:
return wine_dbg_sprintf("{VT_UI4: %u}", V_UI4(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
#define MIN_BLOCK_SIZE 128
#define ARENA_FREE_FILLER 0xaa
......
......@@ -256,37 +256,6 @@ static inline WCHAR *heap_strdupW( const WCHAR *src )
return dst;
}
static inline const char *debugstr_variant( const VARIANT *v )
{
if (!v) return "(null)";
switch (V_VT(v))
{
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I4:
return wine_dbg_sprintf( "{VT_I4: %d}", V_I4(v) );
case VT_R8:
return wine_dbg_sprintf( "{VT_R8: %lf}", V_R8(v) );
case VT_BSTR:
return wine_dbg_sprintf( "{VT_BSTR: %s}", debugstr_w(V_BSTR(v)) );
case VT_DISPATCH:
return wine_dbg_sprintf( "{VT_DISPATCH: %p}", V_DISPATCH(v) );
case VT_BOOL:
return wine_dbg_sprintf( "{VT_BOOL: %x}", V_BOOL(v) );
case VT_UNKNOWN:
return wine_dbg_sprintf( "{VT_UNKNOWN: %p}", V_UNKNOWN(v) );
case VT_UINT:
return wine_dbg_sprintf( "{VT_UINT: %u}", V_UINT(v) );
case VT_BSTR|VT_BYREF:
return wine_dbg_sprintf( "{VT_BSTR|VT_BYREF: ptr %p, data %s}",
V_BSTRREF(v), V_BSTRREF(v) ? debugstr_w( *V_BSTRREF(v) ) : NULL );
default:
return wine_dbg_sprintf( "{vt %d}", V_VT(v) );
}
}
static const WCHAR class_processW[] = {'W','i','n','3','2','_','P','r','o','c','e','s','s',0};
static const WCHAR class_serviceW[] = {'W','i','n','3','2','_','S','e','r','v','i','c','e',0};
static const WCHAR class_stdregprovW[] = {'S','t','d','R','e','g','P','r','o','v',0};
......
......@@ -22,7 +22,6 @@
#define COBJMACROS
#include "config.h"
#include "wine/port.h"
#include "wine/debug.h"
#include <stdarg.h>
#include <assert.h>
......@@ -39,6 +38,8 @@
#include "winhttp_private.h"
#include "wine/debug.h"
WINE_DEFAULT_DEBUG_CHANNEL(winhttp);
static const WCHAR attr_accept[] = {'A','c','c','e','p','t',0};
......
......@@ -284,37 +284,6 @@ void destroy_authinfo( struct authinfo * ) DECLSPEC_HIDDEN;
extern HRESULT WinHttpRequest_create( void ** ) DECLSPEC_HIDDEN;
static inline const char *debugstr_variant( const VARIANT *v )
{
if (!v) return "(null)";
switch (V_VT(v))
{
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I4:
return wine_dbg_sprintf( "{VT_I4: %d}", V_I4(v) );
case VT_R8:
return wine_dbg_sprintf( "{VT_R8: %lf}", V_R8(v) );
case VT_BSTR:
return wine_dbg_sprintf( "{VT_BSTR: %s}", debugstr_w(V_BSTR(v)) );
case VT_DISPATCH:
return wine_dbg_sprintf( "{VT_DISPATCH: %p}", V_DISPATCH(v) );
case VT_BOOL:
return wine_dbg_sprintf( "{VT_BOOL: %x}", V_BOOL(v) );
case VT_UNKNOWN:
return wine_dbg_sprintf( "{VT_UNKNOWN: %p}", V_UNKNOWN(v) );
case VT_UINT:
return wine_dbg_sprintf( "{VT_UINT: %u}", V_UINT(v) );
case VT_BSTR|VT_BYREF:
return wine_dbg_sprintf( "{VT_BSTR|VT_BYREF: ptr %p, data %s}",
V_BSTRREF(v), V_BSTRREF(v) ? debugstr_w( *V_BSTRREF(v) ) : NULL );
default:
return wine_dbg_sprintf( "{vt %d}", V_VT(v) );
}
}
static inline void *heap_alloc( SIZE_T size )
{
return HeapAlloc( GetProcessHeap(), 0, size );
......
......@@ -28,38 +28,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(wshom);
static const char *debugstr_variant(const VARIANT *v)
{
if(!v)
return "(null)";
switch(V_VT(v)) {
case VT_EMPTY:
return "{VT_EMPTY}";
case VT_NULL:
return "{VT_NULL}";
case VT_I4:
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
case VT_R8:
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
case VT_BSTR:
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
case VT_DISPATCH:
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
case VT_BOOL:
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
case VT_UNKNOWN:
return wine_dbg_sprintf("{VT_UNKNOWN: %p}", V_UNKNOWN(v));
case VT_UINT:
return wine_dbg_sprintf("{VT_UINT: %u}", V_UINT(v));
case VT_BSTR|VT_BYREF:
return wine_dbg_sprintf("{VT_BSTR|VT_BYREF: ptr %p, data %s}",
V_BSTRREF(v), debugstr_w(V_BSTRREF(v) ? *V_BSTRREF(v) : NULL));
default:
return wine_dbg_sprintf("{vt %d}", V_VT(v));
}
}
static IWshShell3 WshShell3;
typedef struct
......
......@@ -377,6 +377,11 @@ static inline const char *debugstr_guid( const struct _GUID *id ) { return wine_
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 ); }
#if defined(__oaidl_h__) && defined(V_VT)
static inline const char *debugstr_vt( VARTYPE vt ) { return wine_dbgstr_vt( vt ); }
static inline const char *debugstr_variant( const VARIANT *v ) { return wine_dbgstr_variant( v ); }
#endif
#define TRACE WINE_TRACE
#define TRACE_(ch) WINE_TRACE_(ch)
#define TRACE_ON(ch) WINE_TRACE_ON(ch)
......
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