Juan Lang : oleaut32: Implement VarDecInt.

Alexandre Julliard julliard at winehq.org
Thu Feb 19 09:18:28 CST 2009


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

Author: Juan Lang <juan.lang at gmail.com>
Date:   Wed Feb 18 09:06:19 2009 -0800

oleaut32: Implement VarDecInt.

---

 dlls/oleaut32/vartype.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/vartype.c b/dlls/oleaut32/vartype.c
index 0b0ed28..6d972a2 100644
--- a/dlls/oleaut32/vartype.c
+++ b/dlls/oleaut32/vartype.c
@@ -5702,14 +5702,22 @@ HRESULT WINAPI VarDecFix(const DECIMAL* pDecIn, DECIMAL* pDecOut)
  */
 HRESULT WINAPI VarDecInt(const DECIMAL* pDecIn, DECIMAL* pDecOut)
 {
+  double dbl;
+  HRESULT hr;
+
   if (DEC_SIGN(pDecIn) & ~DECIMAL_NEG)
     return E_INVALIDARG;
 
   if (!(DEC_SIGN(pDecIn) & DECIMAL_NEG) || !DEC_SCALE(pDecIn))
     return VarDecFix(pDecIn, pDecOut); /* The same, if +ve or no fractionals */
 
-  FIXME("semi-stub!\n");
-  return DISP_E_OVERFLOW;
+  hr = VarR8FromDec(pDecIn, &dbl);
+  if (SUCCEEDED(hr)) {
+    LONGLONG rounded = dbl >= 0.0 ? dbl + 0.5 : dbl - 0.5;
+
+    hr = VarDecFromI8(rounded, pDecOut);
+  }
+  return hr;
 }
 
 /************************************************************************




More information about the wine-cvs mailing list