[PATCH 11/12] Remove some useless null checks

Nikolay Sivov nsivov at codeweavers.com
Sat Oct 23 14:23:07 CDT 2010


---
 dlls/oleaut32/olefont.c       |   11 +----------
 dlls/oleaut32/tests/olefont.c |    3 +++
 2 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c
index 3c8c91f..24d18b7 100644
--- a/dlls/oleaut32/olefont.c
+++ b/dlls/oleaut32/olefont.c
@@ -480,15 +480,6 @@ static HRESULT WINAPI OLEFontImpl_QueryInterface(
   OLEFontImpl *this = (OLEFontImpl *)iface;
   TRACE("(%p)->(%s, %p)\n", this, debugstr_guid(riid), ppvObject);
 
-  /*
-   * Perform a sanity check on the parameters.
-   */
-  if ( (this==0) || (ppvObject==0) )
-    return E_INVALIDARG;
-
-  /*
-   * Initialize the return parameter.
-   */
   *ppvObject = 0;
 
   /*
@@ -1143,7 +1134,7 @@ static HRESULT WINAPI OLEFontImpl_IsEqual(
   INT ret;
   INT left_len,right_len;
 
-  if((iface == NULL) || (pFontOther == NULL))
+  if(pFontOther == NULL)
     return E_POINTER;
   else if (left->description.cySize.s.Lo != right->description.cySize.s.Lo)
     return S_FALSE;
diff --git a/dlls/oleaut32/tests/olefont.c b/dlls/oleaut32/tests/olefont.c
index 7c0a112..0b08432 100644
--- a/dlls/oleaut32/tests/olefont.c
+++ b/dlls/oleaut32/tests/olefont.c
@@ -127,6 +127,9 @@ static void test_QueryInterface(void)
         IFont*  font = NULL;
         LONG ret;
 
+        hres = pOleCreateFontIndirect(NULL, &IID_IFont, NULL);
+        ok(hres == E_POINTER, "got 0x%08x\n", hres);
+
         hres = pOleCreateFontIndirect(NULL, &IID_IFont, &pvObj);
         font = pvObj;
 
-- 
1.5.6.5



--------------080607080302070502040106--



More information about the wine-patches mailing list