Module: wine Branch: refs/heads/master Commit: aa2214626eb7e698c61bb1bc044b9e21d12f983b URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=aa2214626eb7e698c61bb1bc...
Author: Robert Shearman rob@codeweavers.com Date: Wed Mar 29 18:41:01 2006 +0100
oleaut32: Replace memcmp with IsEqualIID macro.
Replace memcmp with IsEqualIID macro that doesn't require a size parameter and remove the unneeded brackets to give more compact and more readable code.
---
dlls/oleaut32/olepicture.c | 29 ++++++++--------------------- 1 files changed, 8 insertions(+), 21 deletions(-)
diff --git a/dlls/oleaut32/olepicture.c b/dlls/oleaut32/olepicture.c index 0441235..74c7fa0 100644 --- a/dlls/oleaut32/olepicture.c +++ b/dlls/oleaut32/olepicture.c @@ -451,30 +451,17 @@ static HRESULT WINAPI OLEPictureImpl_Que /* * Compare the riid with the interface IDs implemented by this object. */ - if (memcmp(&IID_IUnknown, riid, sizeof(IID_IUnknown)) == 0) - { - *ppvObject = (IPicture*)This; - } - else if (memcmp(&IID_IPicture, riid, sizeof(IID_IPicture)) == 0) - { + if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IPicture, riid)) *ppvObject = (IPicture*)This; - } - else if (memcmp(&IID_IDispatch, riid, sizeof(IID_IDispatch)) == 0) - { + else if (IsEqualIID(&IID_IDispatch, riid)) *ppvObject = (IDispatch*)&(This->lpvtblIDispatch); - } - else if (memcmp(&IID_IPictureDisp, riid, sizeof(IID_IPictureDisp)) == 0) - { + else if (IsEqualIID(&IID_IPictureDisp, riid)) *ppvObject = (IDispatch*)&(This->lpvtblIDispatch); - } - else if (memcmp(&IID_IPersistStream, riid, sizeof(IID_IPersistStream)) == 0) - { - *ppvObject = (IPersistStream*)&(This->lpvtblIPersistStream); - } - else if (memcmp(&IID_IConnectionPointContainer, riid, sizeof(IID_IConnectionPointContainer)) == 0) - { - *ppvObject = (IConnectionPointContainer*)&(This->lpvtblIConnectionPointContainer); - } + else if (IsEqualIID(&IID_IPersistStream, riid)) + *ppvObject = (IPersistStream*)&(This->lpvtblIPersistStream); + else if (IsEqualIID(&IID_IConnectionPointContainer, riid)) + *ppvObject = (IConnectionPointContainer*)&(This->lpvtblIConnectionPointContainer); + /* * Check that we obtained an interface. */