commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r802320 - /commons/sandbox/runtime/trunk/src/main/native/os/win32/variant.cpp
Date Sat, 08 Aug 2009 08:32:45 GMT
Author: mturk
Date: Sat Aug  8 08:32:45 2009
New Revision: 802320

URL: http://svn.apache.org/viewvc?rev=802320&view=rev
Log:
Use C++ casting operators in C++ code

Modified:
    commons/sandbox/runtime/trunk/src/main/native/os/win32/variant.cpp

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/variant.cpp
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/variant.cpp?rev=802320&r1=802319&r2=802320&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/variant.cpp (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/variant.cpp Sat Aug  8 08:32:45
2009
@@ -171,7 +171,7 @@
             return V_I8(v);
         break;
         case VT_UI8:
-            return (jlong)V_I8(v);
+            return static_cast<jlong>V_I8(v);
         break;
         case VT_INT:
             return V_INT(v);
@@ -180,10 +180,10 @@
             return V_UINT(v);
         break;
         case VT_R4:
-            return (jlong)(V_R4(v));
+            return static_cast<jlong>(V_R4(v));
         break;
         case VT_R8:
-            return (jlong)(V_R8(v));
+            return static_cast<jlong>(V_R8(v));
         break;
         case VT_CY:
             return V_CY(v).int64;
@@ -192,7 +192,7 @@
             return V_ERROR(v);
         break;
         case VT_DATE:
-            return (jlong)V_DATE(v);
+            return static_cast<jlong>V_DATE(v);
         break;
         case VT_BSTR:
             return SysStringLen(V_BSTR(v));
@@ -239,10 +239,10 @@
             return V_UI4(v);
         break;
         case VT_I8:
-            return (double)V_I8(v);
+            return static_cast<double>V_I8(v);
         break;
         case VT_UI8:
-            return (double)((jlong)V_I8(v));
+            return static_cast<double>(V_I8(v));
         break;
         case VT_INT:
             return V_INT(v);
@@ -251,13 +251,13 @@
             return V_UINT(v);
         break;
         case VT_R4:
-            return (double)V_R4(v);
+            return static_cast<double>V_R4(v);
         break;
         case VT_R8:
             return V_R8(v);
         break;
         case VT_CY:
-            return (double)V_CY(v).int64;
+            return static_cast<double>(V_CY(v).int64);
         break;
         case VT_ERROR:
             return V_ERROR(v);
@@ -283,10 +283,10 @@
         case VT_NULL:
         break;
         case VT_EMPTY:
-            s = _E->NewString((const jchar *)L"", 0);
+            s = _E->NewString(reinterpret_cast<jchar *>(L""), 0);
         break;
         case VT_BSTR:
-            s = _E->NewString((const jchar *)V_BSTR(v), SysStringLen(V_BSTR(v)));
+            s = _E->NewString(reinterpret_cast<jchar *>V_BSTR(v), SysStringLen(V_BSTR(v)));
         break;
         default:
             VariantInit(&c);
@@ -294,7 +294,7 @@
                                   VARIANT_ALPHABOOL | VARIANT_NOUSEROVERRIDE,
                                   VT_BSTR);
             if (SUCCEEDED(r)) {
-                s = _E->NewString((const jchar *)V_BSTR(&c), SysStringLen(V_BSTR(&c)));
+                s = _E->NewString(reinterpret_cast<jchar *>V_BSTR(&c), SysStringLen(V_BSTR(&c)));
                 VariantClear(&c);
             }
             else {



Mime
View raw message