harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gshiman...@apache.org
Subject svn commit: r510652 - in /harmony/enhanced/drlvm/trunk: build/make/targets/ vm/port/src/atomic/win/ vm/port/src/lil/ vm/port/src/lil/em64t/pim/ vm/port/src/lil/pim/ vm/thread/src/ vm/vmcore/include/ vm/vmcore/src/class_support/ vm/vmcore/src/init/ vm/v...
Date Thu, 22 Feb 2007 21:25:41 GMT
Author: gshimansky
Date: Thu Feb 22 13:25:38 2007
New Revision: 510652

URL: http://svn.apache.org/viewvc?view=rev&rev=510652
Log:
Applied HARMONY-3236 [drlvm][winx64][build] Fixed majority of warnings.

I've had to change Runtime_win.cpp to make it compile without warnings on win32.
I had to add include <stddef.h> to dump.h to make it compile on linux.

Tests passed on Ubuntu6 x86, Windows XP x86, SuSE9 x86_64 and Gentoo x86_64.
On windows x86_64 compilation passes.


Modified:
    harmony/enhanced/drlvm/trunk/build/make/targets/common_vm.xml
    harmony/enhanced/drlvm/trunk/build/make/targets/jvmti.test.xml
    harmony/enhanced/drlvm/trunk/vm/port/src/atomic/win/port_atomic.c
    harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/lil/lil_code_generator.cpp
    harmony/enhanced/drlvm/trunk/vm/port/src/lil/pim/stack_iterator.cpp
    harmony/enhanced/drlvm/trunk/vm/thread/src/thread_java_basic.c
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/String_Pool.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/compile.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/dump.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_strings.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/String_Pool.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/manifest.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/dump.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/jarfile_support.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h
    harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/common_vm.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/common_vm.xml?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/common_vm.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/common_vm.xml Thu Feb 22 13:25:38 2007
@@ -73,19 +73,19 @@
                 </defineset>
 
                 <compilerarg value="/Fp${build.dir}/_obj\" />
-                <compilerarg value="/Fr${build.dir}/_obj\" />
+                <compilerarg value="/FR${build.dir}/_obj\" />
                 <compilerarg value="/Fd${build.dir}/_obj\" />
                 <compilerarg value="/nologo" />
                 <compilerarg value="/W3" />
 
-                <select arch="em64t">
-                    <compilerarg value="/W0" />
-                </select>
                 <select arch="ia32,ipf">
                     <compilerarg value="/WX" />
                 </select>
-
                 <compilerarg value="/Zi" />
+
+                <select arch="em64t">
+                    <compilerarg value="/wd4996" />
+                </select>
             </select>
 
             <select os="lnx">
@@ -137,15 +137,11 @@
                     <compilerarg value="/QxN" />
                     <compilerarg value="/Qip" />
                 </select>
-
-                <select os="win" cxx="msvc">
-                    <compilerarg value="/Ox" />
-                </select>
             </select>
         </compiler>
 
         <compiler id="common.cpp.compiler" name="${build.cxx}" extends="common.compiler">
-            <select arch="em64t,ipf">
+            <select arch="em64t,ipf" os="lnx">
                 <compilerarg value="-fPIC" />
             </select>
 
@@ -165,7 +161,7 @@
                 </select>
 
                 <select cxx="msvc">
-                    <compilerarg value="/GX" />
+                    <compilerarg value="/EHsc" />
                 </select>
 
                 <select cxx="icl">

Modified: harmony/enhanced/drlvm/trunk/build/make/targets/jvmti.test.xml
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/build/make/targets/jvmti.test.xml?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/build/make/targets/jvmti.test.xml (original)
+++ harmony/enhanced/drlvm/trunk/build/make/targets/jvmti.test.xml Thu Feb 22 13:25:38 2007
@@ -81,7 +81,7 @@
                         <linkerarg value="-lstdc++" />
                     </select>
                     <select os="win">
-                        <compilerarg value="/GX" />
+                        <compilerarg value="/EHsc" />
                     </select>
                     <fileset dir="@{directory}">
                         <include name="**/*.cpp" />
@@ -130,12 +130,12 @@
             <available file="${exclude.file}" />
             <then>                  
                   <property name="jvmti.exclude.file.${jvmti.tests.mode}.present" value="true" />
-                  <loadfile property="foo" srcFile="${exclude.file}"/>
-                  <echo>
-Using exclude file = ${exclude.file}   
-        
-${foo}
-                  </echo>
+                  <loadfile property="foo" srcFile="${exclude.file}"/>
+                  <echo>
+Using exclude file = ${exclude.file}   
+        
+${foo}
+                  </echo>
             </then>
         </if>
 

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/atomic/win/port_atomic.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/atomic/win/port_atomic.c?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/atomic/win/port_atomic.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/atomic/win/port_atomic.c Thu Feb 22 13:25:38 2007
@@ -20,3 +20,4 @@
  */  
 
 /* All code from this file was inlinied in port_atomic.h */
+

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/lil/em64t/pim/lil_code_generator_em64t.cpp Thu Feb 22 13:25:38 2007
@@ -102,7 +102,7 @@
     /*    4) INITILIZE STACK INFORMATION    */
 
     if (has_m2n) {
-        stk_m2n_size = m2n_get_size();
+        stk_m2n_size = (unsigned)m2n_get_size();
     } else {
         // preserve space for callee-saves registers
         stk_m2n_size = lil_cs_get_max_locals(stub) * GR_SIZE;
@@ -515,12 +515,12 @@
     
     inline const R_Opnd & get_r_opnd(const LcgEM64TLoc * loc) const {
         assert(loc->kind == LLK_Gr);
-        return context.get_reg_from_map(loc->addr);
+        return context.get_reg_from_map((unsigned)loc->addr);
     }
 
     inline const XMM_Opnd & get_xmm_r_opnd(const LcgEM64TLoc * loc) const {
         assert(loc->kind == LLK_Fr);
-        return context.get_xmm_reg_from_map(loc->addr);
+        return context.get_xmm_reg_from_map((unsigned)loc->addr);
     }
 
     inline const M_Opnd & get_m_opnd(const LcgEM64TLoc * loc) const {
@@ -1056,7 +1056,7 @@
 	
 	// debug code: check the estimate	
         char* i_end = buf;
-	unsigned i_len = i_end - i_start;
+	unsigned i_len = (unsigned)(i_end - i_start);
 	if (i_len > MAX_LIL_INSTRUCTION_CODE_LENGTH) {
 	    // the MAX_LIL_INSTRUCTION_CODE_LENGTH was underestimated.
 	    // most likely will not cause problems in real life, though still requires correction.
@@ -1074,7 +1074,7 @@
 	    
 	    // debug code: see above for the rationale
 	    char* i_end = buf;
-	    unsigned i_len = i_end - i_start;
+	    unsigned i_len = (unsigned)(i_end - i_start);
 	    if (i_len > MAX_LIL_INSTRUCTION_CODE_LENGTH) {
 		assert(false);
 	    }

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/lil/lil_code_generator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/lil/lil_code_generator.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/lil/lil_code_generator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/lil/lil_code_generator.cpp Thu Feb 22 13:25:38 2007
@@ -64,7 +64,8 @@
     compile_add_dynamic_generated_code_chunk("unknown", stub, stub_size);
 
     if (VM_Global_State::loader_env->TI->isEnabled())
-        jvmti_send_dynamic_code_generated_event("unknown", stub, stub_size);
+        jvmti_send_dynamic_code_generated_event("unknown", stub,
+            (jint)stub_size);
 
     return stub;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/port/src/lil/pim/stack_iterator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/port/src/lil/pim/stack_iterator.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/port/src/lil/pim/stack_iterator.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/port/src/lil/pim/stack_iterator.cpp Thu Feb 22 13:25:38 2007
@@ -59,7 +59,8 @@
     if ( cci != NULL && cci->has_inline_info()) {
         return cci->get_jit()->get_inline_depth(
                 cci->get_inline_info(),
-                (POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr());
+                // FIXME64: no support for large methods
+                (uint32)((POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr()));
     }
     return 0;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/thread/src/thread_java_basic.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/thread/src/thread_java_basic.c?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/thread/src/thread_java_basic.c (original)
+++ harmony/enhanced/drlvm/trunk/vm/thread/src/thread_java_basic.c Thu Feb 22 13:25:38 2007
@@ -404,7 +404,7 @@
  * Callback which is executed in the target thread at safe point 
  * whenever Thread.stop() method is called.
  */
-void stop_callback() {  
+void stop_callback(void) {  
     hythread_t tm_native_thread;
     jvmti_thread_t tm_java_thread;
     jobject excn;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/String_Pool.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/String_Pool.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/String_Pool.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/String_Pool.h Thu Feb 22 13:25:38 2007
@@ -53,7 +53,7 @@
 
     // lookup string in string table & insert if not found
     String * lookup(const char *str);
-    String * lookup(const char *str, unsigned len);
+    String * lookup(const char *str, size_t len);
 
     // Iterators for GC
     String * get_first_string_intern();
@@ -75,7 +75,7 @@
     public:
         Entry   * next;
         String  str;
-        Entry(const char *s, unsigned len, Entry *n);
+        Entry(const char *s, size_t len, Entry *n);
         /**
          * Memory is already allocated for this object.
          */
@@ -104,12 +104,12 @@
 #endif
 
     bool has_line_end(POINTER_SIZE_INT val);
-    void hash_it(const char * str, unsigned * len, POINTER_SIZE_INT * hash);
-    POINTER_SIZE_INT hash_it(const char * str, unsigned len);
-    String * lookup(const char *str, unsigned len, POINTER_SIZE_INT hash);
+    void hash_it(const char * str, size_t* len, POINTER_SIZE_INT * hash);
+    POINTER_SIZE_INT hash_it(const char * str, size_t len);
+    String * lookup(const char *str, size_t len, POINTER_SIZE_INT hash);
     void register_interned_string(String * str);
     private:
-    POINTER_SIZE_INT hash_it_unaligned(const char * str, unsigned len);
+    POINTER_SIZE_INT hash_it_unaligned(const char * str, size_t len);
     public:
     
     // memory pool

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/class_member.h Thu Feb 22 13:25:38 2007
@@ -478,7 +478,7 @@
     // The value returned by getByteCodeAddr may be NULL in which case the
     // bytecodes are not available (presumably they have been garbage collected by VM).
     const Byte  *get_byte_code_addr()   {return _byte_codes;}
-    size_t       get_byte_code_size()   {return _byte_code_length;}
+    unsigned     get_byte_code_size()   {return _byte_code_length;}
 
     // From the class file (Sec. 4.7.4)
     unsigned get_max_stack()                       { return _max_stack; }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/compile.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/compile.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/compile.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/compile.h Thu Feb 22 13:25:38 2007
@@ -146,7 +146,7 @@
 {
     const char *name;
     const void *address;
-    jint length;
+    size_t length;
     DynamicCode *next;
 };
 
@@ -158,7 +158,7 @@
 /** 
  * Adding dynamic generated code info to global list.
  */
-void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, jint length);
+void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, size_t length);
 void compile_clear_dynamic_code_list(DynamicCode* list);
 
 #endif

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/dump.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/dump.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/dump.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/dump.h Thu Feb 22 13:25:38 2007
@@ -22,6 +22,8 @@
 #ifndef _DUMP_H_
 #define _DUMP_H_
 
+#include <stddef.h>
+
 #ifndef NDEBUG
     extern bool dump_stubs;
 
@@ -32,6 +34,6 @@
     #define DUMP_STUB(addr, name, len)
 #endif
 
-int dump(const char * code, const char * name, unsigned int length);
+int dump(const char * code, const char * name, size_t length);
 
 #endif // _DUMP_H_

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/hashtable.h Thu Feb 22 13:25:38 2007
@@ -267,6 +267,7 @@
         else
         {
             ABORT( "Element was inserted second time in MapEx!");
+            return NULL; // not reachable; to satisfy compiler warning
         }
     }
     inline void Remove(Key key)
@@ -275,7 +276,7 @@
     }
     inline unsigned int GetItemCount()
     {
-        return this->size();
+        return (unsigned int)(this->size());
     }
 };
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_strings.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_strings.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_strings.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/include/vm_strings.h Thu Feb 22 13:25:38 2007
@@ -56,9 +56,9 @@
  */
 unsigned get_utf8_length_of_unicode(const uint16 *str, unsigned unicode_length);
 int get_unicode_length_of_utf8(const char *utf8);
-unsigned get_utf8_length_of_8bit(const uint8* chars, unsigned length);
+unsigned get_utf8_length_of_8bit(const uint8* chars, size_t length);
 void pack_utf8(char *utf8_string, const uint16 *unicode, unsigned unicode_length);
-void utf8_from_8bit(char* utf8_string, const uint8* chars, unsigned length);
+void utf8_from_8bit(char* utf8_string, const uint8* chars, size_t length);
 void unpack_utf8(uint16 *unicode, const char *utf8);
 
 Java_java_lang_String *vm_instantiate_cp_string_slow(Class*, unsigned cp_index);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/Prepare.cpp Thu Feb 22 13:25:38 2007
@@ -1072,7 +1072,8 @@
 Intfc_Table* Class::create_and_populate_interface_table(const std::vector<Class*>& intfc_table_entries)
 {
     // shouldn't it be called vtable_index?
-    Intfc_Table* intfc_table = create_intfc_table(this, intfc_table_entries.size());
+    Intfc_Table* intfc_table = create_intfc_table(this,
+        (unsigned)intfc_table_entries.size());
     if(intfc_table_entries.size() != 0) {
         unsigned vtable_offset = m_num_virtual_method_entries;
         for (unsigned i = 0; i < intfc_table_entries.size(); i++) {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/String_Pool.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/String_Pool.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/String_Pool.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/String_Pool.cpp Thu Feb 22 13:25:38 2007
@@ -58,13 +58,13 @@
     string_pool_lock = 0;
 } //String_Pool::unlock_pool
 
-String_Pool::Entry::Entry(const char * s, unsigned len, Entry *n) : next(n) {
+String_Pool::Entry::Entry(const char * s, size_t len, Entry *n) : next(n) {
 // This constructor can be run very early on during VM execution--even before main is entered.
 // This is before we have had a chance to process any command line arguments. So, initialize the 
 // interned Java_lang_String reference to NULL in a way that will work whether references are compressed or not.
     str.intern.raw_ref = NULL;
-    str.len = (len);
-    assert(strlen(s) >= (len));
+    str.len = (unsigned)len;
+    assert(strlen(s) >= len);
     memcpy(str.bytes, s, len);
     str.bytes[len] = '\0';
 } //String_Pool::Entry::Entry
@@ -92,7 +92,7 @@
     return (val ^ ~(val + BIT_MASK)) & ~BIT_MASK;
 }
 
-void String_Pool::hash_it(const char * s, unsigned * len, POINTER_SIZE_INT * hash) {
+void String_Pool::hash_it(const char * s, size_t* len, POINTER_SIZE_INT * hash) {
     POINTER_SIZE_INT h1 = 0;
     POINTER_SIZE_INT h2 = 0;
     const char * p_val = s;
@@ -129,7 +129,7 @@
     *hash = h1 - h2;
 }
 
-POINTER_SIZE_INT String_Pool::hash_it(const char * s, unsigned len) {
+POINTER_SIZE_INT String_Pool::hash_it(const char * s, size_t len) {
 
 #ifdef _IPF_
     // aligned loading is critical for _IPF_
@@ -139,7 +139,7 @@
 #endif
 
     POINTER_SIZE_INT h1 = 0, h2 = 0;
-    const unsigned parts = len / sizeof(POINTER_SIZE_INT);
+    const unsigned parts = (unsigned)(len / sizeof(POINTER_SIZE_INT));
     
     for (unsigned i = 0; i < parts; i++) {
         h1 += *((POINTER_SIZE_INT *)s + i);
@@ -152,13 +152,13 @@
     return h1 - h2;
 }
 
-POINTER_SIZE_INT String_Pool::hash_it_unaligned(const char * s, unsigned len) {
+POINTER_SIZE_INT String_Pool::hash_it_unaligned(const char * s, size_t len) {
     POINTER_SIZE_INT h1 = 0, h2 = 0;
-    const unsigned parts = len / sizeof(POINTER_SIZE_INT);
+    const size_t parts = len / sizeof(POINTER_SIZE_INT);
 
     // ATTENTION! we got here with unaligned s!
 
-    for (unsigned i = 0; i < parts; i++) {
+    for (size_t i = 0; i < parts; i++) {
 #ifdef _IPF_ /* 64 bit and little endian */
         h1 +=  (POINTER_SIZE_INT) s[i * 8  + 0]
             + ((POINTER_SIZE_INT)s[i * 8 + 1] << 8)
@@ -173,14 +173,14 @@
 #endif
     }
 
-    for (unsigned j = parts * sizeof(POINTER_SIZE_INT); j < len; j++) {
+    for (size_t j = parts * sizeof(POINTER_SIZE_INT); j < len; j++) {
         h2 += s[j];
     }
     
     return h1 - h2;
 }
 
-String * String_Pool::lookup(const char *s, unsigned len, POINTER_SIZE_INT raw_hash) {
+String * String_Pool::lookup(const char *s, size_t len, POINTER_SIZE_INT raw_hash) {
 #ifdef VM_STATS
     // we need a lock here since apr_palloc & apr_hash_set is single threaded
     LMAutoUnlock auto_lock(&VM_Statistics::get_vm_stats().vm_stats_lock);
@@ -200,7 +200,7 @@
     ++key_stats->num_lookup;
 #endif
 
-    int hash = raw_hash % STRING_TABLE_SIZE;
+    int hash = (int)(raw_hash % STRING_TABLE_SIZE);
 
     // search bucket for string, no lock
     for (Entry *e = table[hash]; e != NULL; e = e->next) {
@@ -241,7 +241,7 @@
     // compute size of Entry record
     // add one to str_len for '\0'
     // subtract STRING_PADDING already in Entry
-    unsigned entry_size = sizeof(Entry) + len + 1 - STRING_PADDING;
+    size_t entry_size = sizeof(Entry) + len + 1 - STRING_PADDING;
     
     /* Synchronized via String_Pool lock */
     void * mem = memory_pool.alloc(entry_size);
@@ -258,14 +258,14 @@
 
 String * String_Pool::lookup(const char *s) {
     POINTER_SIZE_INT hash;
-    unsigned len;
+    size_t len;
     
     hash_it(s, &len, &hash);
     return lookup(s, len, hash);
 } //String_Pool::lookup
 
 
-String * String_Pool::lookup(const char *s, unsigned len) {
+String * String_Pool::lookup(const char *s, size_t len) {
     return lookup(s, len, hash_it(s, len));
 } //String_Pool::lookup
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Thu Feb 22 13:25:38 2007
@@ -1789,7 +1789,8 @@
     apr_file_close(file_handle);
 
     // define class
-    Class* clss = DefineClass(m_env, class_name->bytes, buf, 0, buf_len); 
+    Class* clss = DefineClass(m_env, class_name->bytes, buf, 0,
+        (unsigned)buf_len); 
     if(clss) {
         clss->set_class_file_name(m_env->string_pool.lookup(full_name));
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/manifest.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/manifest.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/manifest.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/manifest.cpp Thu Feb 22 13:25:38 2007
@@ -73,7 +73,7 @@
         *dst = *src;
     } while (*src != '\0');
 
-    return dst - manifest;
+    return (long)(dst - manifest);
 }
 
 Manifest::Manifest( const JarFile* jf )
@@ -117,7 +117,7 @@
     {
         // parse property name
         // skip useless characters
-        long skipSpace = strspn( pointer, WHITESPACE_CHARS );
+        size_t skipSpace = strspn( pointer, WHITESPACE_CHARS );
         pointer += skipSpace;
         // set property name
         char *propName = pointer;
@@ -128,8 +128,8 @@
             break;
         }
         // find first whitespace character after property name, cut tail
-        long findSpace = strcspn( pointer, WHITESPACE_CHARS );
-        if( findSpace < nextPart - pointer ) {
+        size_t findSpace = strcspn( pointer, WHITESPACE_CHARS );
+        if( findSpace < (size_t)(nextPart - pointer) ) {
             pointer[findSpace] = '\0';
         } else {
             *nextPart = '\0';

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/parse_arguments.cpp Thu Feb 22 13:25:38 2007
@@ -275,7 +275,7 @@
         USE_JAVA_HELP;
         LOGGER_EXIT(1);
     } else {
-        unsigned len = strlen(++arg);
+        unsigned len = (unsigned)strlen(++arg);
         if (len >= 3 && strncmp("...", arg + len - 3, 3) == 0) {
             get_assert_reg(p_env)->add_package(p_env, arg, len - 3, value);
         } else {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/init/vm_init.cpp Thu Feb 22 13:25:38 2007
@@ -547,7 +547,8 @@
 
     if (name) {
         args[2].l = oh_allocate_local_handle();
-        args[2].l->object = string_create_from_utf8(name, strlen(name));
+        args[2].l->object = string_create_from_utf8(name,
+            (unsigned)strlen(name));
     } else {
         args[2].l = NULL;
     }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/compile.cpp Thu Feb 22 13:25:38 2007
@@ -809,7 +809,7 @@
 }
 
 // Adding dynamic generated code info to global list
-void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, jint length)
+void compile_add_dynamic_generated_code_chunk(const char* name, const void* address, size_t length)
 {
     DynamicCode *dc = (DynamicCode *)STD_MALLOC(sizeof(DynamicCode));
     assert(dc);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/dump.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/dump.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/dump.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jit/dump.cpp Thu Feb 22 13:25:38 2007
@@ -31,7 +31,7 @@
 // this variable is filled in by parse_args()
 const char * dump_file_name = "file.dump";
 
-int dump(const char * code, const char * name, unsigned int length) {
+int dump(const char * code, const char * name, size_t length) {
     static apr_pool_t * pool  = NULL;
     static port_disassembler_t * disassembler;
     static apr_file_t * file = NULL;
@@ -54,7 +54,9 @@
     }
 
     apr_file_printf(file, "Function dump begin: %s\n", name);
-    port_disasm_to_file(disassembler, code, length, file);
+    // FIXME64: no support for large methods
+    // with compiled code size greater than 2GB
+    port_disasm_to_file(disassembler, code, (int)length, file);
     apr_file_printf(file, "Function dump end: %s\n", name);
 
 //    apr_pool_destroy(pool);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jni/jni.cpp Thu Feb 22 13:25:38 2007
@@ -600,8 +600,8 @@
                 else
                 {
                     static const char* mess_templ = "duplicate class definition: ";
-                    static unsigned mess_templ_len = strlen(mess_templ);
-                    unsigned mess_size = mess_templ_len + strlen(name) + 1; // 1 is for trailing '\0'
+                    static size_t mess_templ_len = strlen(mess_templ);
+                    size_t mess_size = mess_templ_len + strlen(name) + 1; // 1 is for trailing '\0'
                     char* err_mess = (char*)STD_ALLOCA(mess_size);
                     sprintf(err_mess, "%s%s", mess_templ, name);
                     exn = exn_create("java/lang/LinkageError", err_mess);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti.cpp Thu Feb 22 13:25:38 2007
@@ -404,10 +404,10 @@
 static char *parse_agent_option(apr_pool_t* pool, const char *str, const char *option_str,
                          const char option_separator, char **options)
 {
-    int cmd_length = strlen(option_str);
+    size_t cmd_length = strlen(option_str);
     const char *lib_name = str + cmd_length;
     char *opts_start = (char *)strchr(lib_name, option_separator);
-    int lib_name_length;
+    size_t lib_name_length;
 
     if (NULL == opts_start)
         lib_name_length = strlen(lib_name);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_break_intf.cpp Thu Feb 22 13:25:38 2007
@@ -285,7 +285,7 @@
     assert(interpreter_enabled());
     bool UNREF check = check_insert_breakpoint(bp);
     assert(check);
-    bp->saved_byte = (POINTER_SIZE_INT)
+    bp->saved_byte =
         interpreter.interpreter_ti_set_breakpoint(bp->method, bp->location);
 
     insert_breakpoint(bp);
@@ -761,7 +761,7 @@
         char *branch_address = code - 1;
 
         code = jump(code, next_instruction);
-        jint offset = code - branch_address - 1;
+        jint offset = (jint)(code - branch_address - 1);
         *branch_address = offset;
 
         jump(code, jump_target);
@@ -774,7 +774,7 @@
         char *code = (char *)instruction_buffer;
 
         // Push "return address" to the $next_instruction
-        code = push(code, Imm_Opnd((POINTER_SIZE_INT)next_instruction));
+        code = push(code, Imm_Opnd(size_platf, (POINTER_SIZE_INT)next_instruction));
 
         // Jump to the target address of the call instruction
         jump(code, jump_target);
@@ -797,7 +797,7 @@
         char *code = (char *)instruction_buffer;
 
         // Push "return address" to the $next_instruction
-        code = push(code, Imm_Opnd((POINTER_SIZE_INT)next_instruction));
+        code = push(code, Imm_Opnd(size_platf, (POINTER_SIZE_INT)next_instruction));
 
         // Jump to the target address of the call instruction
         jump(code, jump_target);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_class.cpp Thu Feb 22 13:25:38 2007
@@ -300,8 +300,8 @@
 {
     TRACE2("jvmti.class", "GetClassSignature called");
     SuspendEnabledChecker sec;
-    int len,
-        sig_len;
+    int len;
+    size_t sig_len;
     char *pointer,
          *signature;
     Class *klass;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp Thu Feb 22 13:25:38 2007
@@ -537,7 +537,9 @@
 
                 for (CodeChunkInfo* cci = method->get_first_JIT_specific_info();  cci;  cci = cci->_next)
                 {
-                    jint code_size = cci->get_code_block_size();
+                    // FIXME64: no support for large methods
+                    // with compiled code size greater than 2GB
+                    jint code_size = (jint)cci->get_code_block_size();
                     const void* code_addr = cci->get_code_block_addr();
 
                     if ( code_size <= 0 || code_addr == NULL)
@@ -681,7 +683,8 @@
     // FIXME: linked list usage without sync
     for (DynamicCode *dcList = compile_get_dynamic_code_list();
         NULL != dcList; dcList = dcList->next)
-        jvmti_send_dynamic_code_generated_event(dcList->name, dcList->address, dcList->length);
+        jvmti_send_dynamic_code_generated_event(dcList->name,
+            dcList->address, (jint)dcList->length);
 
     return JVMTI_ERROR_NONE;
 } // generate_events_dynamic_code_generated

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_heap.cpp Thu Feb 22 13:25:38 2007
@@ -629,7 +629,7 @@
     hythread_suspend_disable(); // ---------------vv
 
     ti_env->tags->get_objects_with_tags(tag_set, objects);
-    int count = objects.size();
+    int count = (int)objects.size();
     *count_ptr = count;
     if (count == 0) {
         // set output args to NULL

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp Thu Feb 22 13:25:38 2007
@@ -206,8 +206,10 @@
                     if (NULL != cci)
                     {
                         NativeCodePtr ip = si_get_ip(si);
-                        uint32 offset = (POINTER_SIZE_INT)ip -
-                            (POINTER_SIZE_INT)cci->get_code_block_addr();
+                        // FIXME64: missing support for methods
+                        // with compiled code greater than 2GB
+                        uint32 offset = (uint32)((POINTER_SIZE_INT)ip -
+                            (POINTER_SIZE_INT)cci->get_code_block_addr());
                         JIT *jit = cci->get_jit();
 
                         uint16 bc;
@@ -715,8 +717,10 @@
                     if (NULL != cci)
                     {
                         NativeCodePtr ip = si_get_ip(si);
-                        uint32 offset = (POINTER_SIZE_INT)ip -
-                            (POINTER_SIZE_INT)cci->get_code_block_addr();
+                        // FIXME64: no support for methods
+                        // with compiled code greated than 4GB
+                        uint32 offset = (uint32)((POINTER_SIZE_INT)ip -
+                            (POINTER_SIZE_INT)cci->get_code_block_addr());
                         JIT *jit = cci->get_jit();
 
                         uint16 bc;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/ulist.h Thu Feb 22 13:25:38 2007
@@ -89,7 +89,7 @@
         }
     };
 
-    ulist(int initial)
+    ulist(size_t initial)
         : used(0), capacity(initial), next(NULL)
     {
         chunk = new T[capacity];
@@ -173,9 +173,9 @@
         ulist<T>* current = this;
         while (current) {
             if (current->chunk <= t && t < current->chunk + current->capacity) {
-                int index = t - current->chunk;
+                int index = (int)(t - current->chunk);
                 assert(0 <= index && (size_t)index < current->used && "deleted or moved element");
-                return iterator(current, t - current->chunk);
+                return iterator(current, (int)(t - current->chunk));
             }
             current = current->next;
         }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/Runtime_win.cpp Thu Feb 22 13:25:38 2007
@@ -115,7 +115,7 @@
         jstring jo = (jstring)env->GetObjectArrayElement(cmdarray, (jsize) i);
         const char *strChain = env->GetStringUTFChars(jo, 0);
         bool need_esc = (*strChain != '\"' && strchr(strChain, ' ') != NULL);
-        cur_pos += strlen(strChain) + (i == 0 ? 0 : 1) + (need_esc ? 0 : 2);
+        cur_pos += (int)strlen(strChain) + (i == 0 ? 0 : 1) + (need_esc ? 0 : 2);
         while (l <= cur_pos) {
             char *strtmp = (char*)malloc(l + btl);
             memcpy(strtmp, strCmnd, l);
@@ -146,8 +146,8 @@
         for ( i = 0; i < len; i++ ) {
             jstring jo = (jstring)env->GetObjectArrayElement(envp, (jsize) i);
             const char* strChain = env->GetStringUTFChars(jo, 0);
-            size_t tmp = strlen(strChain) + 1;
-            while ((unsigned)l <= (cur_pos + tmp)) {
+            int tmp = (int)strlen(strChain) + 1;
+            while (l <= (cur_pos + tmp)) {
                 char *strtmp = (char*)malloc(l + btl);
                 memcpy(strtmp, strEnvp, l);
                 l += btl;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/java_lang_VMClassRegistry.cpp Thu Feb 22 13:25:38 2007
@@ -371,7 +371,7 @@
         (genv->bootstrap_class_loader);
     Package_Table* ptab = cl->getPackageTable();
     cl->Lock();
-    unsigned p_num = ptab->size();
+    unsigned p_num = (unsigned)ptab->size();
     if (p_num == (unsigned)len) 
     {
         cl->Unlock();

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_drlvm_VMHelperFastPath.cpp Thu Feb 22 13:25:38 2007
@@ -69,5 +69,5 @@
 
 JNIEXPORT jint JNICALL Java_org_apache_harmony_drlvm_VMHelperFastPath_getClassDepthOffset(JNIEnv *, jclass)
 {
-    return Class::get_offset_of_depth();
+    return (jint)Class::get_offset_of_depth();
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/kernel_classes/native/org_apache_harmony_vm_VMStack.cpp Thu Feb 22 13:25:38 2007
@@ -225,7 +225,7 @@
 
     jclass pdc = struct_Class_to_java_lang_Class_Handle(genv->java_security_ProtectionDomain_Class);
     assert(pdc);
-    size = domains.size();
+    size = (unsigned)domains.size();
     TRACE("Domains on stack: " << size);
     // create & fill  java array
     jarray arr = jenv->NewObjectArray(size, pdc, NULL);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_dump.cpp Thu Feb 22 13:25:38 2007
@@ -239,7 +239,9 @@
                 st_get_c_method_info(&m, frames[i].ip);
             } else { // Java method
                 uint32 inlined_depth = si_get_inline_depth(si);
-                uint32 offset = (POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr();
+                // FIXME64: on 64-bit architectures method bodies can be
+                // potentially greater than 2GB in size
+                uint32 offset = (uint32)((POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr());
                 for (uint32 j = 0; j < inlined_depth; j++) {
                     Method *real_method = cci->get_jit()->get_inlined_method(cci->get_inline_info(), offset, j);
                     st_get_java_method_info(&m, real_method, frames[i].ip, 0 == i);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/stack/stack_trace.cpp Thu Feb 22 13:25:38 2007
@@ -41,7 +41,7 @@
 
     *line = -1;
     if (interpreter_enabled()) {
-        int bc = (uint8*)ip - (uint8*)method->get_byte_code_addr();
+        int bc = (int)((uint8*)ip - (uint8*)method->get_byte_code_addr());
         *line = method->get_line_number((uint16)bc);
         return;
     }
@@ -107,7 +107,9 @@
 
                 if (target_depth < depth + inlined_depth) {
                     CodeChunkInfo* cci = si_get_code_chunk_info(si);
-                    uint32 offset = (POINTER_SIZE_INT)stf->ip - (POINTER_SIZE_INT)cci->get_code_block_addr();
+                    // FIXME64: no support for large methods
+                    // with compiled code size greater than 4GB
+                    uint32 offset = (uint32)((POINTER_SIZE_INT)stf->ip - (POINTER_SIZE_INT)cci->get_code_block_addr());
                     stf->method = cci->get_jit()->get_inlined_method(
                             cci->get_inline_info(), offset, target_depth - depth);
                 }
@@ -165,7 +167,9 @@
             } else {
                 JIT *jit = cci->get_jit();
                 uint32 inlined_depth = si_get_inline_depth(si);
-                uint32 offset = (POINTER_SIZE_INT)ip - (POINTER_SIZE_INT)cci->get_code_block_addr();
+                // FIXME64: no support for large methods
+                // with compiled code greater than 4GB
+                uint32 offset = (uint32)((POINTER_SIZE_INT)ip - (POINTER_SIZE_INT)cci->get_code_block_addr());
 
                 for (uint32 i = 0; i < inlined_depth; i++) {
                     stf->method = jit->get_inlined_method(cci->get_inline_info(), offset, i);
@@ -258,7 +262,9 @@
             CodeChunkInfo* cci = si_get_code_chunk_info(si);
             if ( cci != NULL ) {
                 uint32 inlined_depth = si_get_inline_depth(si);
-                uint32 offset = (POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr();
+                // FIXME64: no support for large methods
+                // with compiled code size greater than 4GB
+                uint32 offset = (uint32)((POINTER_SIZE_INT)si_get_ip(si) - (POINTER_SIZE_INT)cci->get_code_block_addr());
                 
                 for (uint32 i = 0; i < inlined_depth; i++) {
                     Method *real_method = cci->get_jit()->get_inlined_method(cci->get_inline_info(), offset, i);

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/compile_em64t.cpp Thu Feb 22 13:25:38 2007
@@ -139,7 +139,7 @@
 //    6 xmm registers
 //    6 gp registers
 //    method handle
-const int32 stack_size = m2n_get_size() + 8 + 120;
+const int32 stack_size = (int32)m2n_get_size() + 8 + 120;
 
 static NativeCodePtr compile_get_compile_me_generic() {
     static NativeCodePtr addr = NULL;
@@ -186,7 +186,7 @@
     stub = call(stub, (char *)&compile_me);
 
     // pop m2n from the stack
-    const int32 bytes_to_m2n_bottom = stack_size - m2n_get_size();
+    const int32 bytes_to_m2n_bottom = (int32)(stack_size - m2n_get_size());
     stub = m2n_gen_pop_m2n(stub, false, 0, bytes_to_m2n_bottom, 1);
 
     // restore gp inputs from the stack

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/em64t/base/jit_runtime_support_em64t.cpp Thu Feb 22 13:25:38 2007
@@ -165,7 +165,7 @@
     // compute the base address of an array
     uint64* lens_base = (uint64*)(args+2);
     for(unsigned i = 0; i < dims; i++) {
-        lens[i] = lens_base[dims-i-1];
+        lens[i] = (int)lens_base[dims-i-1];
     }
     return vm_rt_multianewarray_recursive(c, lens, dims);
 }

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/jarfile_support.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/jarfile_support.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/jarfile_support.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/jarfile_support.cpp Thu Feb 22 13:25:38 2007
@@ -146,7 +146,7 @@
 
     m_jars.push_back(fileName);
     JarEntry je;
-    m_jarFileIdx = je.m_jarFileIdx = m_jars.size()-1;
+    m_jarFileIdx = je.m_jarFileIdx = (int)(m_jars.size() - 1);
 
     struct stat fs;
     if(stat(fileName, &fs) == -1) return false;

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/util/vm_strings.cpp Thu Feb 22 13:25:38 2007
@@ -84,10 +84,10 @@
     return length;
 } //get_utf8_length_of_unicode
 
-unsigned get_utf8_length_of_8bit(const uint8* chars, unsigned length)
+unsigned get_utf8_length_of_8bit(const uint8* chars, size_t length)
 {
     unsigned len = 0;
-    for(unsigned i=0; i<length; i++)
+    for(unsigned i=0; i < length; i++)
         if (chars[i]!=0 && chars[i]<0x80)
             len++;
         else
@@ -122,7 +122,7 @@
     *s = 0;
 } //pack_utf8
 
-void utf8_from_8bit(char* utf8_string, const uint8* chars, unsigned length)
+void utf8_from_8bit(char* utf8_string, const uint8* chars, size_t length)
 {
     char* s = utf8_string;
     for(unsigned i=0; i<length; i++) {

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Graph.cpp Thu Feb 22 13:25:38 2007
@@ -391,7 +391,7 @@
     const char *method_desc = method_get_descriptor( ctex->m_method );
 
     // create file name
-    unsigned len = strlen( class_name ) + strlen( method_name )
+    size_t len = strlen( class_name ) + strlen( method_name )
                         + strlen( method_desc ) + 6;
     char *fname = (char*)STD_ALLOCA( len );
     sprintf( fname, "%s_%s%s.dot", class_name, method_name, method_desc );

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/Verifier.cpp Thu Feb 22 13:25:38 2007
@@ -1534,8 +1534,8 @@
  */
 static inline const char *
 vf_get_class_valid_type( const char *class_name,    // class name
-                         unsigned name_len,         // class name length
-                         unsigned *len,             // length of created string
+                         size_t name_len,           // class name length
+                         size_t *len,               // length of created string
                          vf_VerifyPool_t *pool)     // memory pool
 {
     char *result;
@@ -1582,12 +1582,12 @@
 vf_create_class_valid_type( const char *class_name,     // class name
                             vf_Context_t *ctex)         // verifier context
 {
-    unsigned len;
+    size_t len;
     vf_ValidType_t *result;
 
     // get class valid type
-    unsigned class_name_len = strlen( class_name );
-    const char *type = vf_get_class_valid_type( class_name, class_name_len,
+    const char *type = vf_get_class_valid_type( class_name,
+                                                strlen( class_name ),
                                                 &len, ctex->m_pool );
     // create valid type
     result = ctex->m_type->NewType( type, len );
@@ -3786,13 +3786,13 @@
  */
 static inline const char *
 vf_get_class_array_valid_type( const char *element_name,    // array element name
-                               unsigned name_len,           // element name length
+                               size_t name_len,             // element name length
                                unsigned dimension,          // dimension of array
-                               unsigned *result_len,        // pointer to result string length
+                               size_t *result_len,          // pointer to result string length
                                vf_VerifyPool_t *pool)       // memory pool
 {
-    unsigned len,
-             index;
+    size_t len;
+    unsigned index;
     char *result;
 
     // create valid type
@@ -3861,9 +3861,9 @@
     assert( name );
 
     // create valid type string
-    unsigned len;
-    unsigned class_name_len = strlen( name );
-    const char *array = vf_get_class_array_valid_type( name, class_name_len, 1,
+    size_t len;
+    const char *array = vf_get_class_array_valid_type( name,
+        strlen( name ), 1,
         &len, ctex->m_pool );
 
     // check dimension
@@ -4018,9 +4018,9 @@
     assert( name );
 
     // get valid type string
-    unsigned len;
-    unsigned class_name_len = strlen( name );
-    const char *array = vf_get_class_valid_type( name, class_name_len,
+    size_t len;
+    const char *array = vf_get_class_valid_type( name,
+                                                 strlen( name ),
                                                  &len, ctex->m_pool );
     // check dimension
     unsigned short index;
@@ -5255,7 +5255,7 @@
      * Set valid types
      */
     const char *class_name = class_get_name( klass );
-    unsigned class_name_len = strlen( class_name );
+    size_t class_name_len = strlen( class_name );
     char *type_name = (char*)STD_ALLOCA( class_name_len + 1 + 1 );
     // it will be a funny name for array :)
     memcpy( &type_name[1], class_name, class_name_len );

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_graph.h Thu Feb 22 13:25:38 2007
@@ -284,7 +284,8 @@
                 + method_get_code_length( context->m_method )
             : context->m_code[node->m_end + 1].m_addr;
 
-        unsigned len = code_end - context->m_code[node->m_start].m_addr;
+        unsigned len = (unsigned)(code_end -
+            context->m_code[node->m_start].m_addr);
         return len;
     } // GetNodeBytecodeLen
 

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_real.h Thu Feb 22 13:25:38 2007
@@ -320,7 +320,7 @@
  * @note Trace is available with argument <b>verifier:memory</b>.
  */
 void *
-vf_calloc_func( unsigned number, unsigned element_size, VERIFY_SOURCE_PARAMS );
+vf_calloc_func( unsigned number, size_t element_size, VERIFY_SOURCE_PARAMS );
 
 /**
  * Function allocates memory blocks.
@@ -334,7 +334,7 @@
  * @note Trace is available with argument <b>verifier:memory</b>.
  */
 void *
-vf_malloc_func( unsigned size, VERIFY_SOURCE_PARAMS );
+vf_malloc_func( size_t size, VERIFY_SOURCE_PARAMS );
 
 /**
  * Function releases allocated memory blocks.
@@ -362,7 +362,7 @@
  * @note Trace is available with argument <b>verifier:memory</b>.
  */
 void *
-vf_realloc_func( void *pointer, unsigned resize, VERIFY_SOURCE_PARAMS );
+vf_realloc_func( void *pointer, size_t resize, VERIFY_SOURCE_PARAMS );
 
 /**
  * Function creates memory pool structure.
@@ -388,7 +388,7 @@
  * @note Trace is available with argument <b>verifier:memory:pool</b>.
  */
 void *
-vf_alloc_pool_memory_func( vf_VerifyPool_t *pool, unsigned size, VERIFY_SOURCE_PARAMS );
+vf_alloc_pool_memory_func( vf_VerifyPool_t *pool, size_t size, VERIFY_SOURCE_PARAMS );
 
 /**
  * Function cleans given pool.
@@ -560,7 +560,7 @@
      * @see vf_HashEntry_t
      * @note Created hash key and hash entry is allocated into hash memory pool.
      */
-    vf_HashEntry_t * NewHashEntry( const char *key, unsigned len );
+    vf_HashEntry_t * NewHashEntry( const char *key, size_t len );
 
 private:
     vf_VerifyPool_t *m_pool;    ///< hash memory pool
@@ -587,7 +587,7 @@
      *         else returns <code>false</code>.
      * @see vf_HashEntry_t
      */
-    bool CheckKey( vf_HashEntry_t *hash_entry, const char *key, unsigned len );
+    bool CheckKey( vf_HashEntry_t *hash_entry, const char *key, size_t len );
 
     /**
      * Hash function.
@@ -602,7 +602,7 @@
      * @param len - key length
      * @return Hash index relevant to key.
      */
-    unsigned HashFunc( const char *key, unsigned len );
+    unsigned HashFunc( const char *key, size_t len );
 }; // struct vf_Hash
 
 //===========================================================
@@ -646,7 +646,7 @@
      * @return Created valid type structure.
      * @see vf_ValidType_t
      */
-    vf_ValidType_t * NewType( const char *type, unsigned len );
+    vf_ValidType_t * NewType( const char *type, size_t len );
 
     /**
      * Function creates valid type which is identical to an element of a given array type.
@@ -825,9 +825,9 @@
  */
 struct vf_VerifyPool {
     vf_VerifyPoolInternal_t *m_pool;    ///< pool entry
-    unsigned m_memory;                  ///< allocated memory size
-    unsigned m_used;                    ///< used memory size
-    unsigned m_maxuse;                  ///< max used memory size
+    size_t m_memory;                    ///< allocated memory size
+    size_t m_used;                      ///< used memory size
+    size_t m_maxuse;                    ///< max used memory size
 };
 
 /**
@@ -837,7 +837,7 @@
     void *m_memory;                     ///< pool entry memory
     char *m_free;                       ///< free space in pool entry
     vf_VerifyPoolInternal_t *m_next;    ///< next pool entry
-    unsigned m_freesize;                ///< size of free space in pool entry
+    size_t m_freesize;                  ///< size of free space in pool entry
 };
 
 /**
@@ -1019,7 +1019,7 @@
         vf_free( ctex->m_error );
     }
     // create message
-    int len = stream.str().length();
+    size_t len = stream.str().length();
     if( len ) {
         ctex->m_error = (char*)vf_malloc( len + 1 );
         memcpy( ctex->m_error, stream.str().c_str(), len );

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp?view=diff&rev=510652&r1=510651&r2=510652
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/verifier/ver_utils.cpp Thu Feb 22 13:25:38 2007
@@ -81,7 +81,7 @@
 inline bool
 vf_Hash::CheckKey( vf_HashEntry_t *hash_entry,  // checked hash entry
                    const char *key,             // checked key
-                   unsigned len)                // key length
+                   size_t len)                  // key length
 {
     if( !strncmp( hash_entry->key, key, len ) && hash_entry->key[len] == '\0'  ) {
         return true;
@@ -109,7 +109,7 @@
  */
 inline unsigned
 vf_Hash::HashFunc( const char *key,     // key for hash function
-                   unsigned len)        // key length
+                   size_t len)          // key length
 {
     unsigned result = 0;
 
@@ -178,7 +178,7 @@
     }
 
     // create key string
-    unsigned len = strlen(key);
+    size_t len = strlen(key);
     char *hash_key = (char*)vf_alloc_pool_memory( m_pool, len + 1 );
     memcpy( hash_key, key, len );
 
@@ -196,7 +196,7 @@
  */
 inline vf_HashEntry_t *
 vf_Hash::NewHashEntry( const char *key,     // hash key
-                       unsigned len)        // key length
+                       size_t len)          // key length
 {
     // lookup type in hash
     assert( key );
@@ -252,7 +252,7 @@
  */
 vf_ValidType_t *
 vf_TypePool::NewType( const char *type,     // class name
-                      unsigned len)         // name length
+                      size_t len)           // name length
 {
     vf_ValidType_t *result;
     vf_HashEntry_t *hash;
@@ -675,7 +675,7 @@
         } while( name[index] == '[' );
         if( name[index] == 'L' ) {
             // array of objects, construct array name
-            unsigned len = strlen( name );
+            size_t len = strlen( name );
             char *buf = (char *)STD_ALLOCA( len + 2 );
             memcpy( buf, name, len );
             buf[len] = ';';
@@ -791,7 +791,7 @@
                 const char *sig1 = method_get_descriptor( method1 );
                 const char *sig2 = method_get_descriptor( method2 );
                 char *end_params = (char *)strrchr( sig1, ')' );
-                unsigned len = end_params - sig1 + 1;
+                unsigned len = (unsigned)(end_params - sig1 + 1);
                 if( !memcmp( sig1, sig2, len ) ) {
                     // methods arguments are the same
                     if( strcmp( &sig1[len], &sig2[len] ) ) {
@@ -1009,6 +1009,7 @@
                     && vf_is_super_class( current, target );
     }
     LDIE(40, "Verifier: vf_is_valid: invalid check type" );
+    return false;
 } // vf_is_valid
 
 /**
@@ -1497,7 +1498,7 @@
  */
 void*
 vf_calloc_func( unsigned num,            // number of elements
-                unsigned size,           // size of element
+                size_t size,             // size of element
                 VERIFY_SOURCE_PARAMS)    // debug info
 {
     assert(num);
@@ -1523,7 +1524,7 @@
  * Function allocates memory blocks.
  */
 void *
-vf_malloc_func( unsigned size,          // size of memory block
+vf_malloc_func( size_t size,          // size of memory block
                 VERIFY_SOURCE_PARAMS)   // debug info
 {
     assert( size );
@@ -1549,7 +1550,7 @@
  */
 void *
 vf_realloc_func( void *pointer,             // old pointer
-                 unsigned size,             // size of memory block
+                 size_t size,               // size of memory block
                  VERIFY_SOURCE_PARAMS)      // debug info
 {
     assert( size );
@@ -1597,7 +1598,7 @@
  * Function creates wide memory pool structure.
  */
 static inline vf_VerifyPoolInternal_t *
-vf_create_pool_element( unsigned size,             // initial pool size
+vf_create_pool_element( size_t size,               // initial pool size
                         VERIFY_SOURCE_PARAMS)      // debug info
 {
     vf_VerifyPoolInternal_t *result;
@@ -1656,7 +1657,7 @@
  */
 void *
 vf_alloc_pool_memory_func( vf_VerifyPool_t *hpool,     // a given pool
-                           unsigned size,              // memory size
+                           size_t size,              // memory size
                            VERIFY_SOURCE_PARAMS)       // debug info
 {
     const unsigned align = sizeof(void*) - 1;
@@ -1736,7 +1737,8 @@
     vf_VerifyPoolInternal_t *pool = hpool->m_pool;
     while( pool ) {
         // clean pool element space
-        unsigned used_size = pool->m_free - (char*)pool->m_memory;
+        unsigned used_size =
+            (unsigned)(pool->m_free - (char*)pool->m_memory);
         memset(pool->m_memory, 0, used_size);
         pool->m_free = (char*)pool->m_memory;
         pool->m_freesize += used_size;



Mime
View raw message