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.
This commit is contained in:
Robert Shearman 2006-03-29 18:41:01 +01:00 committed by Alexandre Julliard
parent 8c7706bad0
commit aa2214626e
1 changed files with 8 additions and 21 deletions

View File

@ -451,30 +451,17 @@ static HRESULT WINAPI OLEPictureImpl_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) || IsEqualIID(&IID_IPicture, riid))
*ppvObject = (IPicture*)This;
}
else if (memcmp(&IID_IPicture, riid, sizeof(IID_IPicture)) == 0)
{
*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.
*/