[PATCH 4/4] Use IsEqualIID() instead of memcmp()
Nikolay Sivov
nsivov at codeweavers.com
Wed Jul 21 05:19:51 CDT 2010
---
dlls/ole32/datacache.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
diff --git a/dlls/ole32/datacache.c b/dlls/ole32/datacache.c
index 919829e..1c7be2b 100644
--- a/dlls/ole32/datacache.c
+++ b/dlls/ole32/datacache.c
@@ -879,7 +879,7 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface(
/*
* Perform a sanity check on the parameters.
*/
- if ( (this==0) || (ppvObject==0) )
+ if ( ppvObject==0 )
return E_INVALIDARG;
/*
@@ -890,30 +890,30 @@ static HRESULT WINAPI DataCache_NDIUnknown_QueryInterface(
/*
* Compare the riid with the interface IDs implemented by this object.
*/
- if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0)
+ if (IsEqualIID(&IID_IUnknown, riid))
{
*ppvObject = iface;
}
- else if (memcmp(&IID_IDataObject, riid, sizeof(IID_IDataObject)) == 0)
+ else if (IsEqualIID(&IID_IDataObject, riid))
{
*ppvObject = &this->lpVtbl;
}
- else if ( (memcmp(&IID_IPersistStorage, riid, sizeof(IID_IPersistStorage)) == 0) ||
- (memcmp(&IID_IPersist, riid, sizeof(IID_IPersist)) == 0) )
+ else if ( IsEqualIID(&IID_IPersistStorage, riid) ||
+ IsEqualIID(&IID_IPersist, riid) )
{
*ppvObject = &this->lpvtblIPersistStorage;
}
- else if ( (memcmp(&IID_IViewObject, riid, sizeof(IID_IViewObject)) == 0) ||
- (memcmp(&IID_IViewObject2, riid, sizeof(IID_IViewObject2)) == 0) )
+ else if ( IsEqualIID(&IID_IViewObject, riid) ||
+ IsEqualIID(&IID_IViewObject2, riid) )
{
*ppvObject = &this->lpvtblIViewObject;
}
- else if ( (memcmp(&IID_IOleCache, riid, sizeof(IID_IOleCache)) == 0) ||
- (memcmp(&IID_IOleCache2, riid, sizeof(IID_IOleCache2)) == 0) )
+ else if ( IsEqualIID(&IID_IOleCache, riid) ||
+ IsEqualIID(&IID_IOleCache2, riid) )
{
*ppvObject = &this->lpvtblIOleCache2;
}
- else if (memcmp(&IID_IOleCacheControl, riid, sizeof(IID_IOleCacheControl)) == 0)
+ else if ( IsEqualIID(&IID_IOleCacheControl, riid) )
{
*ppvObject = &this->lpvtblIOleCacheControl;
}
--
1.5.6.5
--------------050509070407080708060403--
More information about the wine-patches
mailing list