summaryrefslogtreecommitdiff
path: root/ext/win32ole
diff options
context:
space:
mode:
authorsuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-04 14:19:01 +0000
committersuke <suke@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-07-04 14:19:01 +0000
commit7a05bfaaab03375783f6e91bec6032c7edaecb78 (patch)
treee9c420bb0a10d487f8dcdbf61354f7f313abe7bc /ext/win32ole
parent7d166d26a5fbe66cdd7974314104f85dd29977ab (diff)
* ext/win32ole/win32ole.c (d2time): fix the bug of VT_DATE
to String conversion when negative value. * test/win32ole/test_win32ole_variant.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/win32ole')
-rw-r--r--ext/win32ole/win32ole.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/win32ole/win32ole.c b/ext/win32ole/win32ole.c
index ea027c1..a972c8b 100644
--- a/ext/win32ole/win32ole.c
+++ b/ext/win32ole/win32ole.c
@@ -24,6 +24,7 @@
#include <olectl.h>
#include <ole2.h>
#include <stdlib.h>
+#include <math.h>
#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
#define va_init_list(a,b) va_start(a,b)
@@ -117,7 +118,7 @@
#define WC2VSTR(x) ole_wc2vstr((x), TRUE)
-#define WIN32OLE_VERSION "1.1.8"
+#define WIN32OLE_VERSION "1.1.9"
typedef HRESULT (STDAPICALLTYPE FNCOCREATEINSTANCEEX)
(REFCLSID, IUnknown*, DWORD, COSERVERINFO*, DWORD, MULTI_QI*);
@@ -763,7 +764,7 @@ d2time(double v, int *hh, int *mm, int *ss)
double d_hh, d_mm, d_ss;
int i_hh, i_mm, i_ss;
- double d = v * 86400.0;
+ double d = fabs(v * 86400.0);
d_hh = d / 3600.0;
i_hh = (int)d_hh;