harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Hindess <mark.hind...@googlemail.com>
Subject Re: svn commit: r486080 - in /harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors: shared/ windows/
Date Tue, 12 Dec 2006 10:25:12 GMT

Thanks!
-Mark.

On 12 December 2006 at 10:03, apetrenko@apache.org wrote:
> 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/sh
> ared/org_apache_harmony_misc_accessors_Malloc.c
>     harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/sh
> ared/org_apache_harmony_misc_accessors_MemoryAccessorNativeImpl.c
>     harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/sh
> ared/org_apache_harmony_misc_accessors_StringAccessorImpl.c
>     harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/wi
> ndows/makefile
> 
> Modified: harmony/enhanced/classlib/trunk/modules/misc/src/main/native/access
> ors/shared/org_apache_harmony_misc_accessors_Malloc.c
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/mis
> c/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/sh
> ared/org_apache_harmony_misc_accessors_Malloc.c (original)
> +++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/sh
> ared/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_strncp
> y
>    (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/access
> ors/shared/org_apache_harmony_misc_accessors_MemoryAccessorNativeImpl.c
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/mis
> c/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_MemoryAc
> cessorNativeImpl.c?view=diff&rev=486080&r1=486079&r2=486080
> =============================================================================
> =
> --- harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/sh
> ared/org_apache_harmony_misc_accessors_MemoryAccessorNativeImpl.c (original)
> +++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/sh
> ared/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/access
> ors/shared/org_apache_harmony_misc_accessors_StringAccessorImpl.c
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/mis
> c/src/main/native/accessors/shared/org_apache_harmony_misc_accessors_StringAc
> cessorImpl.c?view=diff&rev=486080&r1=486079&r2=486080
> =============================================================================
> =
> --- harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/sh
> ared/org_apache_harmony_misc_accessors_StringAccessorImpl.c (original)
> +++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/sh
> ared/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_StringAcces
> sor_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_StringAcces
> sor_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(l
> en >> 1, jstrlen(jlong2addr(const jchar, ptr))));
>  }
> 
> Modified: harmony/enhanced/classlib/trunk/modules/misc/src/main/native/access
> ors/windows/makefile
> URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/mis
> c/src/main/native/accessors/windows/makefile?view=diff&rev=486080&r1=486079&r
> 2=486080
> =============================================================================
> =
> --- harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/wi
> ndows/makefile (original)
> +++ harmony/enhanced/classlib/trunk/modules/misc/src/main/native/accessors/wi
> ndows/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