commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r802315 - in /commons/sandbox/runtime/trunk/src/main/native: include/acr_xdr.h os/win32/file.c os/win32/variant.cpp shared/mbstr.c shared/memory.c shared/string.c
Date Sat, 08 Aug 2009 07:53:04 GMT
Author: mturk
Date: Sat Aug  8 07:53:03 2009
New Revision: 802315

URL: http://svn.apache.org/viewvc?rev=802315&view=rev
Log:
size_t != jsize. Do a casting to suppress warnings

Modified:
    commons/sandbox/runtime/trunk/src/main/native/include/acr_xdr.h
    commons/sandbox/runtime/trunk/src/main/native/os/win32/file.c
    commons/sandbox/runtime/trunk/src/main/native/os/win32/variant.cpp
    commons/sandbox/runtime/trunk/src/main/native/shared/mbstr.c
    commons/sandbox/runtime/trunk/src/main/native/shared/memory.c
    commons/sandbox/runtime/trunk/src/main/native/shared/string.c

Modified: commons/sandbox/runtime/trunk/src/main/native/include/acr_xdr.h
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/include/acr_xdr.h?rev=802315&r1=802314&r2=802315&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/include/acr_xdr.h (original)
+++ commons/sandbox/runtime/trunk/src/main/native/include/acr_xdr.h Sat Aug  8 07:53:03 2009
@@ -43,68 +43,68 @@
 #define H2N32(V) (arc_uint32_t)htonl((acr_uint32_t)(V))
 #define N2H32(V) (arc_uint32_t)ntohl((acr_uint32_t)(V))
 
-#define ACR_P_16_ENC(M, B, V)                        \
-    if ((M)) {                                       \
-    *((B)++) = (acr_byte_t)(((V) >>  8) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >>  0) & 0xFF);     \
-    } else {                                         \
-    *((acr_uint16_t *)(void *)(B)) = (V);            \
+#define ACR_P_16_ENC(M, B, V)                               \
+    if ((M)) {                                              \
+    *((B)++) = (acr_byte_t)(((V) >>  8) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >>  0) & 0xFF);            \
+    } else {                                                \
+    *((acr_uint16_t *)(void *)(B)) = (acr_uint16_t)(V);     \
      ((B))  += 2; } (void)(0)
 
-#define ACR_P_32_ENC(M, B, V)                        \
-    if ((M)) {                                       \
-    *((B)++) = (acr_byte_t)(((V) >> 24) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >> 16) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >>  8) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >>  0) & 0xFF);     \
-    } else {                                         \
-    *((acr_uint32_t *)(void *)(B)) = (V);            \
+#define ACR_P_32_ENC(M, B, V)                               \
+    if ((M)) {                                              \
+    *((B)++) = (acr_byte_t)(((V) >> 24) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >> 16) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >>  8) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >>  0) & 0xFF);            \
+    } else {                                                \
+    *((acr_uint32_t *)(void *)(B)) = (acr_uint32_t)(V);     \
      ((B))  += 4; } (void)(0)
 
-#define ACR_P_64_ENC(M, B, V)                        \
-    if ((M)) {                                       \
-    *((B)++) = (acr_byte_t)(((V) >> 56) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >> 48) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >> 40) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >> 32) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >> 24) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >> 16) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >>  8) & 0xFF);     \
-    *((B)++) = (acr_byte_t)(((V) >>  0) & 0xFF);     \
-    } else {                                         \
-    *((acr_uint64_t *)(void *)(B)) = (V);            \
+#define ACR_P_64_ENC(M, B, V)                               \
+    if ((M)) {                                              \
+    *((B)++) = (acr_byte_t)(((V) >> 56) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >> 48) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >> 40) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >> 32) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >> 24) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >> 16) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >>  8) & 0xFF);            \
+    *((B)++) = (acr_byte_t)(((V) >>  0) & 0xFF);            \
+    } else {                                                \
+    *((acr_uint64_t *)(void *)(B)) = (acr_uint64_t)(V);     \
      ((B))  += 8; } (void)(0)
 
-#define ACR_P_16_DEC(M, B, V)                        \
-    if ((M)) {                                       \
-    (V) |= (acr_uint16_t)(*((B)++) & 0xFF) <<  8;    \
-    (V) |= (acr_uint16_t)(*((B)++) & 0xFF);          \
-    } else {                                         \
-      (V)   = *((acr_uint16_t *)(void *)(B));        \
+#define ACR_P_16_DEC(M, B, V)                               \
+    if ((M)) {                                              \
+    (V) |= (acr_uint16_t)(*((B)++) & 0xFF) <<  8;           \
+    (V) |= (acr_uint16_t)(*((B)++) & 0xFF);                 \
+    } else {                                                \
+      (V)   = *((acr_uint16_t *)(void *)(B));               \
      ((B)) += 2; } (void)(0)
 
-#define ACR_P_32_DEC(M, B, V)                        \
-    if ((M)) {                                       \
-    (V)  = (acr_uint32_t)(*((B)++) & 0xFF) << 24;    \
-    (V) |= (acr_uint32_t)(*((B)++) & 0xFF) << 16;    \
-    (V) |= (acr_uint32_t)(*((B)++) & 0xFF) <<  8;    \
-    (V) |= (acr_uint32_t)(*((B)++) & 0xFF);          \
-    } else {                                         \
-      (V)   = *((acr_uint32_t *)(void *)(B));        \
+#define ACR_P_32_DEC(M, B, V)                               \
+    if ((M)) {                                              \
+    (V)  = (acr_uint32_t)(*((B)++) & 0xFF) << 24;           \
+    (V) |= (acr_uint32_t)(*((B)++) & 0xFF) << 16;           \
+    (V) |= (acr_uint32_t)(*((B)++) & 0xFF) <<  8;           \
+    (V) |= (acr_uint32_t)(*((B)++) & 0xFF);                 \
+    } else {                                                \
+      (V)   = *((acr_uint32_t *)(void *)(B));               \
      ((B)) += 4; } (void)(0)
 
-#define ACR_P_64_DEC(M, B, V)                        \
-    if ((M)) {                                       \
-    (V)  = (acr_uint64_t)(*((B)++) & 0xFF) << 56;    \
-    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 48;    \
-    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 40;    \
-    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 32;    \
-    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 24;    \
-    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 16;    \
-    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) <<  8;    \
-    (V) |= (acr_uint64_t)(*( B)    & 0xFF);          \
-    } else {                                         \
-      (V)   = *((acr_uint64_t *)(void *)(B));        \
+#define ACR_P_64_DEC(M, B, V)                               \
+    if ((M)) {                                              \
+    (V)  = (acr_uint64_t)(*((B)++) & 0xFF) << 56;           \
+    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 48;           \
+    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 40;           \
+    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 32;           \
+    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 24;           \
+    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) << 16;           \
+    (V) |= (acr_uint64_t)(*((B)++) & 0xFF) <<  8;           \
+    (V) |= (acr_uint64_t)(*( B)    & 0xFF);                 \
+    } else {                                                \
+      (V)   = *((acr_uint64_t *)(void *)(B));               \
      ((B)) += 8; } (void)(0)
 
 /**
@@ -263,4 +263,3 @@
 #endif
 
 #endif /* _ACR_XDR_H */
-

Modified: commons/sandbox/runtime/trunk/src/main/native/os/win32/file.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/os/win32/file.c?rev=802315&r1=802314&r2=802315&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/os/win32/file.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/os/win32/file.c Sat Aug  8 07:53:03 2009
@@ -226,9 +226,9 @@
             wcscat(rdb->MountPointReparseBuffer.PathBuffer, fpath);
             tlen = wcslen(rdb->MountPointReparseBuffer.PathBuffer);
 
-            rdb->MountPointReparseBuffer.SubstituteNameLength = tlen  * sizeof(wchar_t);
-            rdb->MountPointReparseBuffer.PrintNameOffset = (tlen + 1) * sizeof(wchar_t);
-            rdb->ReparseDataLength = sizeof(rdb->MountPointReparseBuffer) + ((tlen
+ 1) * sizeof(wchar_t));
+            rdb->MountPointReparseBuffer.SubstituteNameLength = (USHORT)(tlen  * sizeof(wchar_t));
+            rdb->MountPointReparseBuffer.PrintNameOffset = (USHORT)((tlen + 1) * sizeof(wchar_t));
+            rdb->ReparseDataLength = (USHORT)(sizeof(rdb->MountPointReparseBuffer)
+ ((tlen + 1) * sizeof(wchar_t)));
 
             if (!DeviceIoControl(hlink, FSCTL_SET_REPARSE_POINT,
                                  rdb, rdb->ReparseDataLength + 8,

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=802315&r1=802314&r2=802315&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 07:53:03
2009
@@ -283,10 +283,10 @@
         case VT_NULL:
         break;
         case VT_EMPTY:
-            s = _E->NewString(L"", 0);
+            s = _E->NewString((const jchar *)L"", 0);
         break;
         case VT_BSTR:
-            s = _E->NewString(V_BSTR(v), SysStringLen(V_BSTR(v)));
+            s = _E->NewString((const 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(V_BSTR(&c), SysStringLen(V_BSTR(&c)));
+                s = _E->NewString((const jchar *)V_BSTR(&c), SysStringLen(V_BSTR(&c)));
                 VariantClear(&c);
             }
             else {

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/mbstr.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/mbstr.c?rev=802315&r1=802314&r2=802315&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/mbstr.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/mbstr.c Sat Aug  8 07:53:03 2009
@@ -65,7 +65,7 @@
         jbyteArray ba;
         size_t sl = strlen(str) + 1;
 
-        if ((ba = (*_E)->NewByteArray(_E, sl))) {
+        if ((ba = (*_E)->NewByteArray(_E, (jsize)sl))) {
             (*_E)->SetByteArrayRegion(_E, ba, 0, (jsize)sl, (jbyte *)str);
             return (*_E)->NewObject(_E, _clazzn.i, J4MID(0000), ba);
         }
@@ -119,9 +119,9 @@
         return NULL;
     }
     cs = strlen(p);
-    ba = (*_E)->NewByteArray(_E, cs + 1);
+    ba = (*_E)->NewByteArray(_E, (jsize)(cs + 1));
     if (ba && cs) {
-        (*_E)->SetByteArrayRegion(_E, ba, 0, cs, (jbyte *)p);
+        (*_E)->SetByteArrayRegion(_E, ba, 0, (jsize)cs, (jbyte *)p);
     }
     return ba;
 }
@@ -144,9 +144,9 @@
         return NULL;
     }
     cs = strlen(p + dn);
-    ba = (*_E)->NewByteArray(_E, cs + 1);
+    ba = (*_E)->NewByteArray(_E, (jsize)(cs + 1));
     if (ba && cs) {
-        (*_E)->SetByteArrayRegion(_E, ba, 0, cs, (jbyte *)(p + dn));
+        (*_E)->SetByteArrayRegion(_E, ba, 0, (jsize)cs, (jbyte *)(p + dn));
     }
     return ba;
 }
@@ -165,9 +165,9 @@
     cs = strlen(p);
     if ((size_t)n < cs)
         cs = (size_t)n;
-    ba = (*_E)->NewByteArray(_E, cs + 1);
+    ba = (*_E)->NewByteArray(_E, (jsize)(cs + 1));
     if (ba && cs) {
-        (*_E)->SetByteArrayRegion(_E, ba, 0, cs, (jbyte *)p);
+        (*_E)->SetByteArrayRegion(_E, ba, 0, (jsize)cs, (jbyte *)p);
     }
     return ba;
 }
@@ -192,9 +192,9 @@
     cs = strlen(p + dn);
     if ((size_t)n < cs)
         cs = (size_t)n;
-    ba = (*_E)->NewByteArray(_E, cs + 1);
+    ba = (*_E)->NewByteArray(_E, (jsize)(cs + 1));
     if (ba && cs) {
-        (*_E)->SetByteArrayRegion(_E, ba, 0, cs, (jbyte *)(p + dn));
+        (*_E)->SetByteArrayRegion(_E, ba, 0, (jsize)cs, (jbyte *)(p + dn));
     }
     return ba;
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/memory.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/memory.c?rev=802315&r1=802314&r2=802315&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/memory.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/memory.c Sat Aug  8 07:53:03 2009
@@ -577,9 +577,9 @@
         ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EINDEX, 0);
         return NULL;
     }
-    ba = (*_E)->NewByteArray(_E, cs);
+    ba = (*_E)->NewByteArray(_E, (jsize)cs);
     if (ba) {
-        (*_E)->SetByteArrayRegion(_E, ba, 0, cs, p + dn);
+        (*_E)->SetByteArrayRegion(_E, ba, 0, (jsize)cs, p + dn);
     }
     return ba;
 }
@@ -601,9 +601,9 @@
         ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EINDEX, 0);
         return NULL;
     }
-    oa = (*_E)->NewCharArray(_E, cs);
+    oa = (*_E)->NewCharArray(_E, (jsize)cs);
     if (oa) {
-        (*_E)->SetCharArrayRegion(_E, oa, 0, cs, p + dn);
+        (*_E)->SetCharArrayRegion(_E, oa, 0, (jsize)cs, p + dn);
     }
     return oa;
 }
@@ -625,9 +625,9 @@
         ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EINDEX, 0);
         return NULL;
     }
-    oa = (*_E)->NewShortArray(_E, cs);
+    oa = (*_E)->NewShortArray(_E, (jsize)cs);
     if (oa) {
-        (*_E)->SetShortArrayRegion(_E, oa, 0, cs, p + dn);
+        (*_E)->SetShortArrayRegion(_E, oa, 0, (jsize)cs, p + dn);
     }
     return oa;
 }
@@ -649,9 +649,9 @@
         ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EINDEX, 0);
         return NULL;
     }
-    oa = (*_E)->NewIntArray(_E, cs);
+    oa = (*_E)->NewIntArray(_E, (jsize)cs);
     if (oa) {
-        (*_E)->SetIntArrayRegion(_E, oa, 0, cs, p + dn);
+        (*_E)->SetIntArrayRegion(_E, oa, 0, (jsize)cs, p + dn);
     }
     return oa;
 }
@@ -673,9 +673,9 @@
         ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EINDEX, 0);
         return NULL;
     }
-    oa = (*_E)->NewLongArray(_E, cs);
+    oa = (*_E)->NewLongArray(_E, (jsize)cs);
     if (oa) {
-        (*_E)->SetLongArrayRegion(_E, oa, 0, cs, p + dn);
+        (*_E)->SetLongArrayRegion(_E, oa, 0, (jsize)cs, p + dn);
     }
     return oa;
 }
@@ -697,9 +697,9 @@
         ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EINDEX, 0);
         return NULL;
     }
-    oa = (*_E)->NewFloatArray(_E, cs);
+    oa = (*_E)->NewFloatArray(_E, (jsize)cs);
     if (oa) {
-        (*_E)->SetFloatArrayRegion(_E, oa, 0, cs, p + dn);
+        (*_E)->SetFloatArrayRegion(_E, oa, 0, (jsize)cs, p + dn);
     }
     return oa;
 }
@@ -721,9 +721,9 @@
         ACR_ThrowException(_E, THROW_NMARK, ACR_EX_EINDEX, 0);
         return NULL;
     }
-    oa = (*_E)->NewDoubleArray(_E, cs);
+    oa = (*_E)->NewDoubleArray(_E, (jsize)cs);
     if (oa) {
-        (*_E)->SetDoubleArrayRegion(_E, oa, 0, cs, p + dn);
+        (*_E)->SetDoubleArrayRegion(_E, oa, 0, (jsize)cs, p + dn);
     }
     return oa;
 }

Modified: commons/sandbox/runtime/trunk/src/main/native/shared/string.c
URL: http://svn.apache.org/viewvc/commons/sandbox/runtime/trunk/src/main/native/shared/string.c?rev=802315&r1=802314&r2=802315&view=diff
==============================================================================
--- commons/sandbox/runtime/trunk/src/main/native/shared/string.c (original)
+++ commons/sandbox/runtime/trunk/src/main/native/shared/string.c Sat Aug  8 07:53:03 2009
@@ -464,7 +464,7 @@
             for (i = 0; i < l; i++) {
                 cc[i] = s[i];
             }
-            rs = (*_E)->NewString(_E, cc, l);
+            rs = (*_E)->NewString(_E, cc, (jsize)l);
         }
         else {
             jchar  *cc;
@@ -473,7 +473,7 @@
                 for (i = 0; i < l; i++) {
                     cc[i] = s[i];
                 }
-                rs = (*_E)->NewString(_E, cc, l);
+                rs = (*_E)->NewString(_E, cc, (jsize)l);
                 free(cc);
             }
         }
@@ -996,7 +996,7 @@
     const char *p;
 
     if (str) {
-        if ((n = ACR_MszStrCountA(str)) > 0)
+        if ((n = (jsize)ACR_MszStrCountA(str)) > 0)
             arr = ACR_NewCoreObjectArray(_E, ACR_CC_STRING, n);
     }
     if (!arr)
@@ -1024,7 +1024,7 @@
     const wchar_t *p;
 
     if (str) {
-        if ((n = ACR_MszStrCountW(str)) > 0)
+        if ((n = (jsize)ACR_MszStrCountW(str)) > 0)
             arr = ACR_NewCoreObjectArray(_E, ACR_CC_STRING, n);
     }
     if (!arr)



Mime
View raw message