Rob Shearman : oleaut32: Fix testing of HRESULT types with not operator instead of comparing against S_OK .

Alexandre Julliard julliard at winehq.org
Mon Aug 18 10:47:19 CDT 2008


Module: wine
Branch: master
Commit: e57697a04b702adec26b196868fb767f7d6b8ed0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e57697a04b702adec26b196868fb767f7d6b8ed0

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Sun Aug 17 18:31:17 2008 +0100

oleaut32: Fix testing of HRESULT types with not operator instead of comparing against S_OK.

This makes it more obvious what the code is doing.

---

 dlls/oleaut32/variant.c |    4 ++--
 dlls/oleaut32/vartype.c |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c
index e6191d1..5c094e1 100644
--- a/dlls/oleaut32/variant.c
+++ b/dlls/oleaut32/variant.c
@@ -1191,7 +1191,7 @@ INT WINAPI DosDateTimeToVariantTime(USHORT wDosDate, USHORT wDosTime,
   ud.st.wSecond = DOS_SECOND(wDosTime);
   ud.st.wDayOfWeek = ud.st.wMilliseconds = 0;
 
-  return !VarDateFromUdate(&ud, 0, pDateOut);
+  return VarDateFromUdate(&ud, 0, pDateOut) == S_OK;
 }
 
 /**********************************************************************
@@ -1255,7 +1255,7 @@ INT WINAPI SystemTimeToVariantTime(LPSYSTEMTIME lpSt, double *pDateOut)
     return FALSE;
 
   ud.st = *lpSt;
-  return !VarDateFromUdate(&ud, 0, pDateOut);
+  return VarDateFromUdate(&ud, 0, pDateOut) == S_OK;
 }
 
 /***********************************************************************
diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c
index daeac85..318a58a 100644
--- a/dlls/oleaut32/vartype.c
+++ b/dlls/oleaut32/vartype.c
@@ -5179,7 +5179,7 @@ static HRESULT VARIANT_DI_div(const VARIANT_DI * dividend, const VARIANT_DI * di
            to multiply quotient by 10 (without overflowing), while adjusting the scale,
            until scale is 0. If this cannot be done, it is a real overflow.
          */
-        while (!r_overflow && quotientscale < 0) {
+        while (r_overflow == S_OK && quotientscale < 0) {
             memset(remainderplusquotient, 0, sizeof(remainderplusquotient));
             memcpy(remainderplusquotient, quotient->bitsnum, sizeof(quotient->bitsnum));
             VARIANT_int_mulbychar(remainderplusquotient, sizeof(remainderplusquotient)/sizeof(DWORD), 10);
@@ -5189,7 +5189,7 @@ static HRESULT VARIANT_DI_div(const VARIANT_DI * dividend, const VARIANT_DI * di
                 memcpy(quotient->bitsnum, remainderplusquotient, sizeof(quotient->bitsnum));
             } else r_overflow = DISP_E_OVERFLOW;
         }
-        if (!r_overflow) {
+        if (r_overflow == S_OK) {
             if (quotientscale <= 255) quotient->scale = quotientscale;
             else VARIANT_DI_clear(quotient);
         }




More information about the wine-cvs mailing list