Commit bdbfac59 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

ole32/tests: Remove superfluous pointer casts.

parent 170f7f8d
...@@ -68,7 +68,7 @@ static HRESULT WINAPI EnumFormatImpl_QueryInterface(IEnumFORMATETC *iface, REFII ...@@ -68,7 +68,7 @@ static HRESULT WINAPI EnumFormatImpl_QueryInterface(IEnumFORMATETC *iface, REFII
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumFORMATETC)) { if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IEnumFORMATETC)) {
IEnumFORMATETC_AddRef(iface); IEnumFORMATETC_AddRef(iface);
*ppvObj = (LPVOID)This; *ppvObj = This;
return S_OK; return S_OK;
} }
*ppvObj = NULL; *ppvObj = NULL;
...@@ -165,7 +165,7 @@ static HRESULT WINAPI DataObjectImpl_QueryInterface(IDataObject *iface, REFIID r ...@@ -165,7 +165,7 @@ static HRESULT WINAPI DataObjectImpl_QueryInterface(IDataObject *iface, REFIID r
if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDataObject)) { if (IsEqualGUID(riid, &IID_IUnknown) || IsEqualGUID(riid, &IID_IDataObject)) {
IDataObject_AddRef(iface); IDataObject_AddRef(iface);
*ppvObj = (LPVOID)This; *ppvObj = This;
return S_OK; return S_OK;
} }
*ppvObj = NULL; *ppvObj = NULL;
......
...@@ -89,7 +89,7 @@ static HRESULT WINAPI Test_IClassFactory_QueryInterface( ...@@ -89,7 +89,7 @@ static HRESULT WINAPI Test_IClassFactory_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown) || if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory)) IsEqualGUID(riid, &IID_IClassFactory))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IClassFactory_AddRef(iface); IClassFactory_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -287,7 +287,7 @@ static HRESULT WINAPI MessageFilter_QueryInterface(IMessageFilter *iface, REFIID ...@@ -287,7 +287,7 @@ static HRESULT WINAPI MessageFilter_QueryInterface(IMessageFilter *iface, REFIID
if (IsEqualGUID(riid, &IID_IUnknown) || if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory)) IsEqualGUID(riid, &IID_IClassFactory))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IMessageFilter_AddRef(iface); IMessageFilter_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -398,7 +398,7 @@ static HRESULT WINAPI Test_IUnknown_QueryInterface( ...@@ -398,7 +398,7 @@ static HRESULT WINAPI Test_IUnknown_QueryInterface(
if (IsEqualIID(riid, &IID_IUnknown) || if (IsEqualIID(riid, &IID_IUnknown) ||
IsEqualIID(riid, &IID_IWineTest)) IsEqualIID(riid, &IID_IWineTest))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -513,7 +513,7 @@ static void test_CoRegisterPSClsid(void) ...@@ -513,7 +513,7 @@ static void test_CoRegisterPSClsid(void)
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok_ole_success(hr, "CreateStreamOnHGlobal"); ok_ole_success(hr, "CreateStreamOnHGlobal");
hr = CoMarshalInterface(stream, &IID_IWineTest, (IUnknown *)&Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); hr = CoMarshalInterface(stream, &IID_IWineTest, &Test_Unknown, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok(hr == E_NOTIMPL, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr); ok(hr == E_NOTIMPL, "CoMarshalInterface should have returned E_NOTIMPL instead of 0x%08x\n", hr);
IStream_Release(stream); IStream_Release(stream);
......
...@@ -114,7 +114,7 @@ static HRESULT WINAPI Test_IUnknown_QueryInterface( ...@@ -114,7 +114,7 @@ static HRESULT WINAPI Test_IUnknown_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown)) if (IsEqualGUID(riid, &IID_IUnknown))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -157,7 +157,7 @@ static HRESULT WINAPI Test_IClassFactory_QueryInterface( ...@@ -157,7 +157,7 @@ static HRESULT WINAPI Test_IClassFactory_QueryInterface(
/* the only other interface Wine is currently able to marshal (for testing two proxies) */ /* the only other interface Wine is currently able to marshal (for testing two proxies) */
IsEqualGUID(riid, &IID_IRemUnknown)) IsEqualGUID(riid, &IID_IRemUnknown))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IClassFactory_AddRef(iface); IClassFactory_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -220,7 +220,7 @@ struct host_object_data ...@@ -220,7 +220,7 @@ struct host_object_data
static DWORD CALLBACK host_object_proc(LPVOID p) static DWORD CALLBACK host_object_proc(LPVOID p)
{ {
struct host_object_data *data = (struct host_object_data *)p; struct host_object_data *data = p;
HRESULT hr; HRESULT hr;
MSG msg; MSG msg;
...@@ -833,7 +833,7 @@ struct ncu_params ...@@ -833,7 +833,7 @@ struct ncu_params
/* helper for test_no_couninitialize_server */ /* helper for test_no_couninitialize_server */
static DWORD CALLBACK no_couninitialize_server_proc(LPVOID p) static DWORD CALLBACK no_couninitialize_server_proc(LPVOID p)
{ {
struct ncu_params *ncu_params = (struct ncu_params *)p; struct ncu_params *ncu_params = p;
HRESULT hr; HRESULT hr;
pCoInitializeEx(NULL, COINIT_MULTITHREADED); pCoInitializeEx(NULL, COINIT_MULTITHREADED);
...@@ -899,7 +899,7 @@ static void test_no_couninitialize_server(void) ...@@ -899,7 +899,7 @@ static void test_no_couninitialize_server(void)
/* STA -> STA call during DLL_THREAD_DETACH */ /* STA -> STA call during DLL_THREAD_DETACH */
static DWORD CALLBACK no_couninitialize_client_proc(LPVOID p) static DWORD CALLBACK no_couninitialize_client_proc(LPVOID p)
{ {
struct ncu_params *ncu_params = (struct ncu_params *)p; struct ncu_params *ncu_params = p;
HRESULT hr; HRESULT hr;
IUnknown *pProxy = NULL; IUnknown *pProxy = NULL;
...@@ -1370,7 +1370,7 @@ static void test_hresult_marshaling(void) ...@@ -1370,7 +1370,7 @@ static void test_hresult_marshaling(void)
/* helper for test_proxy_used_in_wrong_thread */ /* helper for test_proxy_used_in_wrong_thread */
static DWORD CALLBACK bad_thread_proc(LPVOID p) static DWORD CALLBACK bad_thread_proc(LPVOID p)
{ {
IClassFactory * cf = (IClassFactory *)p; IClassFactory * cf = p;
HRESULT hr; HRESULT hr;
IUnknown * proxy = NULL; IUnknown * proxy = NULL;
...@@ -1447,7 +1447,7 @@ static void test_proxy_used_in_wrong_thread(void) ...@@ -1447,7 +1447,7 @@ static void test_proxy_used_in_wrong_thread(void)
IClassFactory_QueryInterface(pProxy, &IID_IStream, (LPVOID *)&pStream); IClassFactory_QueryInterface(pProxy, &IID_IStream, (LPVOID *)&pStream);
/* create a thread that we can misbehave in */ /* create a thread that we can misbehave in */
thread = CreateThread(NULL, 0, bad_thread_proc, (LPVOID)pProxy, 0, &tid2); thread = CreateThread(NULL, 0, bad_thread_proc, pProxy, 0, &tid2);
WaitForSingleObject(thread, INFINITE); WaitForSingleObject(thread, INFINITE);
CloseHandle(thread); CloseHandle(thread);
...@@ -1468,7 +1468,7 @@ static HRESULT WINAPI MessageFilter_QueryInterface(IMessageFilter *iface, REFIID ...@@ -1468,7 +1468,7 @@ static HRESULT WINAPI MessageFilter_QueryInterface(IMessageFilter *iface, REFIID
if (IsEqualGUID(riid, &IID_IUnknown) || if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory)) IsEqualGUID(riid, &IID_IClassFactory))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IClassFactory_AddRef(iface); IClassFactory_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -1679,7 +1679,7 @@ static HRESULT WINAPI HeapUnknown_QueryInterface(IUnknown *iface, REFIID riid, v ...@@ -1679,7 +1679,7 @@ static HRESULT WINAPI HeapUnknown_QueryInterface(IUnknown *iface, REFIID riid, v
if (IsEqualIID(riid, &IID_IUnknown)) if (IsEqualIID(riid, &IID_IUnknown))
{ {
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
*ppv = (LPVOID)iface; *ppv = iface;
return S_OK; return S_OK;
} }
*ppv = NULL; *ppv = NULL;
...@@ -2105,7 +2105,7 @@ static void test_freethreadedmarshaler(void) ...@@ -2105,7 +2105,7 @@ static void test_freethreadedmarshaler(void)
/* inproc normal marshaling */ /* inproc normal marshaling */
hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory,
(IUnknown*)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); &Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok_ole_success(hr, IMarshal_MarshalInterface); ok_ole_success(hr, IMarshal_MarshalInterface);
ok_more_than_one_lock(); ok_more_than_one_lock();
...@@ -2127,7 +2127,7 @@ static void test_freethreadedmarshaler(void) ...@@ -2127,7 +2127,7 @@ static void test_freethreadedmarshaler(void)
/* local normal marshaling */ /* local normal marshaling */
IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, (IUnknown*)&Test_ClassFactory, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL); hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, &Test_ClassFactory, MSHCTX_LOCAL, NULL, MSHLFLAGS_NORMAL);
ok_ole_success(hr, IMarshal_MarshalInterface); ok_ole_success(hr, IMarshal_MarshalInterface);
ok_more_than_one_lock(); ok_more_than_one_lock();
...@@ -2193,7 +2193,7 @@ static void test_freethreadedmarshaler(void) ...@@ -2193,7 +2193,7 @@ static void test_freethreadedmarshaler(void)
IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL); IStream_Seek(pStream, llZero, STREAM_SEEK_SET, NULL);
hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory, hr = IMarshal_MarshalInterface(pFTMarshal, pStream, &IID_IClassFactory,
(IUnknown*)&Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL); &Test_ClassFactory, MSHCTX_INPROC, NULL, MSHLFLAGS_NORMAL);
ok_ole_success(hr, IMarshal_MarshalInterface); ok_ole_success(hr, IMarshal_MarshalInterface);
ok_more_than_one_lock(); ok_more_than_one_lock();
...@@ -2277,7 +2277,7 @@ static HRESULT WINAPI Test_SMI_QueryInterface( ...@@ -2277,7 +2277,7 @@ static HRESULT WINAPI Test_SMI_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown) || if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IStdMarshalInfo)) IsEqualGUID(riid, &IID_IStdMarshalInfo))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IClassFactory_AddRef(iface); IClassFactory_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -2437,7 +2437,7 @@ static void test_client_security(void) ...@@ -2437,7 +2437,7 @@ static void test_client_security(void)
CoTaskMemFree(pServerPrincName); CoTaskMemFree(pServerPrincName);
hr = IClientSecurity_QueryBlanket(pCliSec, (IUnknown *)pUnknown1, &dwAuthnSvc, &dwAuthzSvc, &pServerPrincName, &dwAuthnLevel, &dwImpLevel, &pAuthInfo, &dwCapabilities); hr = IClientSecurity_QueryBlanket(pCliSec, pUnknown1, &dwAuthnSvc, &dwAuthzSvc, &pServerPrincName, &dwAuthnLevel, &dwImpLevel, &pAuthInfo, &dwCapabilities);
todo_wine ok_ole_success(hr, "IClientSecurity_QueryBlanket(IUnknown)"); todo_wine ok_ole_success(hr, "IClientSecurity_QueryBlanket(IUnknown)");
CoTaskMemFree(pServerPrincName); CoTaskMemFree(pServerPrincName);
...@@ -2479,7 +2479,7 @@ static HRESULT WINAPI TestOOP_IClassFactory_QueryInterface( ...@@ -2479,7 +2479,7 @@ static HRESULT WINAPI TestOOP_IClassFactory_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown) || if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory)) IsEqualGUID(riid, &IID_IClassFactory))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IClassFactory_AddRef(iface); IClassFactory_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -2694,7 +2694,7 @@ struct git_params ...@@ -2694,7 +2694,7 @@ struct git_params
static DWORD CALLBACK get_global_interface_proc(LPVOID pv) static DWORD CALLBACK get_global_interface_proc(LPVOID pv)
{ {
HRESULT hr; HRESULT hr;
struct git_params *params = (struct git_params *)pv; struct git_params *params = pv;
IClassFactory *cf; IClassFactory *cf;
hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(params->git, params->cookie, &IID_IClassFactory, (void **)&cf); hr = IGlobalInterfaceTable_GetInterfaceFromGlobal(params->git, params->cookie, &IID_IClassFactory, (void **)&cf);
......
...@@ -92,7 +92,7 @@ static HRESULT WINAPI Test_IClassFactory_QueryInterface( ...@@ -92,7 +92,7 @@ static HRESULT WINAPI Test_IClassFactory_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown) || if (IsEqualGUID(riid, &IID_IUnknown) ||
IsEqualGUID(riid, &IID_IClassFactory)) IsEqualGUID(riid, &IID_IClassFactory))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IClassFactory_AddRef(iface); IClassFactory_AddRef(iface);
return S_OK; return S_OK;
} }
...@@ -151,7 +151,7 @@ static HRESULT WINAPI HeapUnknown_QueryInterface(IUnknown *iface, REFIID riid, v ...@@ -151,7 +151,7 @@ static HRESULT WINAPI HeapUnknown_QueryInterface(IUnknown *iface, REFIID riid, v
if (IsEqualIID(riid, &IID_IUnknown)) if (IsEqualIID(riid, &IID_IUnknown))
{ {
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
*ppv = (LPVOID)iface; *ppv = iface;
return S_OK; return S_OK;
} }
*ppv = NULL; *ppv = NULL;
......
...@@ -68,7 +68,7 @@ static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, v ...@@ -68,7 +68,7 @@ static HRESULT WINAPI OleObject_QueryInterface(IOleObject *iface, REFIID riid, v
*ppv = NULL; *ppv = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IOleObject)) if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_IOleObject))
*ppv = (void *)iface; *ppv = iface;
else if (IsEqualIID(riid, &IID_IPersistStorage)) else if (IsEqualIID(riid, &IID_IPersistStorage))
*ppv = &OleObjectPersistStg; *ppv = &OleObjectPersistStg;
else if (IsEqualIID(riid, &IID_IOleCache)) else if (IsEqualIID(riid, &IID_IOleCache))
...@@ -1497,7 +1497,7 @@ static void test_runnable(void) ...@@ -1497,7 +1497,7 @@ static void test_runnable(void)
NULL NULL
}; };
IOleObject *object = (IOleObject *)&OleObject; IOleObject *object = &OleObject;
expected_method_list = methods_query_runnable; expected_method_list = methods_query_runnable;
ok(OleIsRunning(object), "Object should be running\n"); ok(OleIsRunning(object), "Object should be running\n");
......
...@@ -100,7 +100,7 @@ static void testProps(void) ...@@ -100,7 +100,7 @@ static void testProps(void)
/* test setting one by name with an invalid propidNameFirst */ /* test setting one by name with an invalid propidNameFirst */
spec.ulKind = PRSPEC_LPWSTR; spec.ulKind = PRSPEC_LPWSTR;
U(spec).lpwstr = (LPOLESTR)propName; U(spec).lpwstr = propName;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var,
PID_DICTIONARY); PID_DICTIONARY);
ok(hr == STG_E_INVALIDPARAMETER, ok(hr == STG_E_INVALIDPARAMETER,
...@@ -123,7 +123,7 @@ static void testProps(void) ...@@ -123,7 +123,7 @@ static void testProps(void)
/* set one by name */ /* set one by name */
spec.ulKind = PRSPEC_LPWSTR; spec.ulKind = PRSPEC_LPWSTR;
U(spec).lpwstr = (LPOLESTR)propName; U(spec).lpwstr = propName;
U(var).lVal = 2; U(var).lVal = 2;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var,
PID_FIRST_USABLE); PID_FIRST_USABLE);
...@@ -164,7 +164,7 @@ static void testProps(void) ...@@ -164,7 +164,7 @@ static void testProps(void)
var.vt, U(var).lVal); var.vt, U(var).lVal);
/* read by name */ /* read by name */
spec.ulKind = PRSPEC_LPWSTR; spec.ulKind = PRSPEC_LPWSTR;
U(spec).lpwstr = (LPOLESTR)propName; U(spec).lpwstr = propName;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var); hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr); ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(var.vt == VT_I4 && U(var).lVal == 2, ok(var.vt == VT_I4 && U(var).lVal == 2,
...@@ -237,7 +237,7 @@ static void testProps(void) ...@@ -237,7 +237,7 @@ static void testProps(void)
ok(hr == S_OK, "Commit failed: 0x%08x\n", hr); ok(hr == S_OK, "Commit failed: 0x%08x\n", hr);
/* set it to a string value */ /* set it to a string value */
var.vt = VT_LPSTR; var.vt = VT_LPSTR;
U(var).pszVal = (LPSTR)val; U(var).pszVal = val;
hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0); hr = IPropertyStorage_WriteMultiple(propertyStorage, 1, &spec, &var, 0);
ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr); ok(hr == S_OK, "WriteMultiple failed: 0x%08x\n", hr);
/* revert it */ /* revert it */
...@@ -269,7 +269,7 @@ static void testProps(void) ...@@ -269,7 +269,7 @@ static void testProps(void)
/* check properties again */ /* check properties again */
spec.ulKind = PRSPEC_LPWSTR; spec.ulKind = PRSPEC_LPWSTR;
U(spec).lpwstr = (LPOLESTR)propName; U(spec).lpwstr = propName;
hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var); hr = IPropertyStorage_ReadMultiple(propertyStorage, 1, &spec, &var);
ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr); ok(hr == S_OK, "ReadMultiple failed: 0x%08x\n", hr);
ok(var.vt == VT_I4 && U(var).lVal == 2, ok(var.vt == VT_I4 && U(var).lVal == 2,
......
...@@ -386,7 +386,7 @@ static HRESULT WINAPI Test_IUnknown_QueryInterface( ...@@ -386,7 +386,7 @@ static HRESULT WINAPI Test_IUnknown_QueryInterface(
if (IsEqualGUID(riid, &IID_IUnknown)) if (IsEqualGUID(riid, &IID_IUnknown))
{ {
*ppvObj = (LPVOID)iface; *ppvObj = iface;
IUnknown_AddRef(iface); IUnknown_AddRef(iface);
return S_OK; return S_OK;
} }
......
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