harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From apetre...@apache.org
Subject svn commit: r486080 - in /harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors: shared/ windows/
Date Tue, 12 Dec 2006 10:03:25 GMT
Author: apetrenko
Date: Tue Dec 12 02:03:24 2006
New Revision: 486080

URL: http://svn.apache.org/viewvc?view=rev&rev=486080
Log:
Makefile is changed to use compiler options from the common place
Compiler warnings are fixed

Modified:
    harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_Malloc.c
    harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_MemoryAccessorNativeImpl.c
    harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_StringAccessorImpl.c
    harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/windows/makefile

Modified: harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_Malloc.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_Malloc.c?view=diff&rev=486080&r1=486079&r2=486080
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_Malloc.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_Malloc.c
Tue Dec 12 02:03:24 2006
@@ -110,7 +110,7 @@
 JNIEXPORT jlong JNICALL Java_org_apache_harmony_misc_accessors_Malloc_strncpy
   (JNIEnv *env, jclass self, jlong addr1, jlong addr2, jlong len)
 {
-    strncpy(jlong2addr(char, addr1), jlong2addr(const char, addr2), len);
+    strncpy(jlong2addr(char, addr1), jlong2addr(const char, addr2), (size_t)len);
     return addr1;
 }
 

Modified: harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_MemoryAccessorNativeImpl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_MemoryAccessorNativeImpl.c?view=diff&rev=486080&r1=486079&r2=486080
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_MemoryAccessorNativeImpl.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_MemoryAccessorNativeImpl.c
Tue Dec 12 02:03:24 2006
@@ -358,7 +358,7 @@
 {
   char *buf = (char*)(*env)->GetPrimitiveArrayCritical(env, (jarray)array, 0);
 
-  memcpy(buf + offset, jlong2addr(char, addr), size);
+  memcpy(buf + offset, jlong2addr(char, addr), (size_t)size);
 
   (*env)->ReleasePrimitiveArrayCritical(env, (jarray)array, buf, 0);
 }
@@ -373,7 +373,7 @@
 {
   char *buf = (char*)(*env)->GetPrimitiveArrayCritical(env, (jarray)array, 0);
 
-  memcpy(jlong2addr(char, addr), buf + offset, size);
+  memcpy(jlong2addr(char, addr), buf + offset, (size_t)size);
 
   (*env)->ReleasePrimitiveArrayCritical(env, (jarray)array, buf, 0);
 }
@@ -569,7 +569,7 @@
   (JNIEnv *env, jobject self, jlong addr, jlong size)
 {
     int mult = 1;
-    int i;
+    jlong i;
     jbyte* block = jlong2addr(jbyte, addr);
     jint res = 0;
     for (i = size - 1; i >= 0; i--) {

Modified: harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_StringAccessorImpl.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_StringAccessorImpl.c?view=diff&rev=486080&r1=486079&r2=486080
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_StringAccessorImpl.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_StringAccessorImpl.c
Tue Dec 12 02:03:24 2006
@@ -21,7 +21,7 @@
 #include <sys/types.h>
 #endif
 
-#define min(a, b) ((a < b) ? a : b)
+#define MIN(a, b) ((a < b) ? a : b)
 
 #include "MemMacros.h"
 #include "org_apache_harmony_misc_accessors_StringAccessor.h"
@@ -97,11 +97,11 @@
 JNIEXPORT jstring JNICALL Java_org_apache_harmony_misc_accessors_StringAccessor_createStringUTF__JJ
   (JNIEnv *env, jobject self, jlong ptr, jlong len)
 {
-    const jlong tmplen = len + 2;
+    const size_t tmplen = (size_t)len + 2;
     char* cstr = (char*)malloc(tmplen);
     jstring res;
     memset(cstr, 0, tmplen);
-    strncpy(cstr, jlong2addr(const char, ptr), len);
+    strncpy(cstr, jlong2addr(const char, ptr), (size_t)len);
     res = (*env)->NewStringUTF(env, cstr);
     free(cstr);
     return res;
@@ -115,5 +115,5 @@
 JNIEXPORT jstring JNICALL Java_org_apache_harmony_misc_accessors_StringAccessor_createString__JJ
   (JNIEnv *env, jobject self, jlong ptr, jlong len)
 {
-    return (*env)->NewString(env, jlong2addr(const jchar, ptr), min(len >> 1, jstrlen(jlong2addr(const
jchar, ptr))));
+    return (*env)->NewString(env, jlong2addr(const jchar, ptr), (jsize)MIN(len >>
1, jstrlen(jlong2addr(const jchar, ptr))));
 }

Modified: harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/windows/makefile
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/windows/makefile?view=diff&rev=486080&r1=486079&r2=486080
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/windows/makefile
(original)
+++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/windows/makefile
Tue Dec 12 02:03:24 2006
@@ -20,13 +20,6 @@
 LIBNAME=$(LIBPATH)$(LIBBASE).lib
 HYLDFLAGS = $(HYLDFLAGS) -def:$(LIBBASE).def
 
-# TOFIX: This is only copied to remove -WX due to errors which should
-# be fixed - line 112 ..Malloc.cpp gives warning about cast from jlong
-# to size_t.
-HYCFLAGS = -Ogityb1 -GF -Gs -MD -Zi -Zm400 \
-  -D_DLL -D_MT -DWIN32 -D_WIN32_WINNT=0x0400 -D_WINSOCKAPI_ -DWINVER=0x0400 \
-  $(VMDEBUG) /I$(HY_HDK)\include /I$(HY_HDK)\jdk\include /I. /I$(SHAREDSUB)
-
 BUILDFILES = \
   $(SHAREDSUB)org_apache_harmony_misc_accessors_ArrayAccessorImpl.obj \
   $(SHAREDSUB)org_apache_harmony_misc_accessors_Malloc.obj \



Mime
View raw message