From 7a1c24acd4a25921caa4be2d4e7756e254fe659d Mon Sep 17 00:00:00 2001 From: Andreas HUBERT Date: Tue, 14 Oct 2008 13:34:30 +0200 Subject: [PATCH] * src/vm/classcache.cpp, src/vm/classcache.hpp, src/vm/method.cpp, src/vm/method.hpp, src/vm/zip.cpp, src/vm/zip.hpp: Moved to C++. --HG-- rename : src/vm/classcache.c => src/vm/classcache.cpp rename : src/vm/classcache.h => src/vm/classcache.hpp rename : src/vm/method.c => src/vm/method.cpp rename : src/vm/method.h => src/vm/method.hpp rename : src/vm/zip.c => src/vm/zip.cpp rename : src/vm/zip.h => src/vm/zip.hpp --- src/mm/cacao-gc/final.h | 2 +- src/mm/cacao-gc/rootset.h | 2 +- src/mm/gc.hpp | 2 +- src/native/jvmti/jvmti.c | 2 +- src/native/localref.hpp | 2 +- src/native/native.hpp | 2 +- .../com_sun_cldc_io_ResourceInputStream.cpp | 2 +- ...ng_management_VMClassLoadingMXBeanImpl.cpp | 2 +- ...ava_lang_management_VMThreadMXBeanImpl.cpp | 2 +- .../gnuclasspath/java_lang_VMClassLoader.cpp | 4 +-- .../java_lang_reflect_VMMethod.cpp | 2 +- src/native/vm/nativevm.cpp | 2 +- src/native/vm/openjdk/jvm.cpp | 2 +- src/native/vm/reflection.cpp | 2 +- src/native/vm/reflection.hpp | 2 +- src/threads/thread.cpp | 2 +- src/toolbox/logging.h | 2 +- src/vm/Makefile.am | 12 +++---- src/vm/access.c | 2 +- src/vm/access.h | 2 +- src/vm/annotation.h | 2 +- src/vm/class.cpp | 2 +- src/vm/class.hpp | 2 +- src/vm/{classcache.c => classcache.cpp} | 27 ++++++++++------ src/vm/{classcache.h => classcache.hpp} | 2 +- src/vm/descriptor.h | 2 +- src/vm/exceptions.cpp | 2 +- src/vm/exceptions.hpp | 2 +- src/vm/javaobjects.hpp | 2 +- src/vm/jit/allocator/liveness.c | 2 +- src/vm/jit/allocator/simplereg.c | 2 +- src/vm/jit/argument.cpp | 2 +- src/vm/jit/argument.hpp | 2 +- src/vm/jit/code.hpp | 2 +- src/vm/jit/codegen-common.cpp | 2 +- src/vm/jit/codegen-common.hpp | 2 +- src/vm/jit/inline/inline.cpp | 2 +- src/vm/jit/intrp/intrp.h | 2 +- src/vm/jit/jit.cpp | 2 +- src/vm/jit/jit.hpp | 2 +- src/vm/jit/jitcache.cpp | 2 +- src/vm/jit/jitcache.hpp | 2 +- src/vm/jit/linenumbertable.hpp | 2 +- src/vm/jit/loop/graph.h | 2 +- src/vm/jit/loop/loop.h | 2 +- src/vm/jit/mips/md-abi.c | 2 +- src/vm/jit/oprofile-agent.hpp | 2 +- src/vm/jit/optimizing/escape.c | 2 +- src/vm/jit/optimizing/escape.h | 2 +- src/vm/jit/optimizing/ifconv.c | 2 +- src/vm/jit/optimizing/lsra.c | 2 +- src/vm/jit/optimizing/profile.c | 4 +-- src/vm/jit/optimizing/recompiler.cpp | 2 +- src/vm/jit/optimizing/recompiler.hpp | 2 +- src/vm/jit/replace.cpp | 2 +- src/vm/jit/replace.hpp | 2 +- src/vm/jit/stacktrace.cpp | 2 +- src/vm/jit/stubs.cpp | 2 +- src/vm/jit/stubs.hpp | 2 +- src/vm/jit/trace.hpp | 2 +- src/vm/linker.c | 2 +- src/vm/loader.cpp | 6 ++-- src/vm/loader.hpp | 2 +- src/vm/{method.c => method.cpp} | 31 ++++++++++++------- src/vm/{method.h => method.hpp} | 3 +- src/vm/properties.cpp | 2 +- src/vm/references.h | 2 +- src/vm/resolve.cpp | 2 +- src/vm/resolve.hpp | 2 +- src/vm/signal.c | 2 +- src/vm/stackmap.c | 2 +- src/vm/stackmap.h | 9 +++++- src/vm/statistics.c | 2 +- src/vm/suck.cpp | 2 +- src/vm/vm.cpp | 2 +- src/vm/vm.hpp | 2 +- src/vm/{zip.c => zip.cpp} | 16 +++++++--- src/vm/{zip.h => zip.hpp} | 8 ++--- 78 files changed, 142 insertions(+), 114 deletions(-) rename src/vm/{classcache.c => classcache.cpp} (98%) rename src/vm/{classcache.h => classcache.hpp} (98%) rename src/vm/{method.c => method.cpp} (98%) rename src/vm/{method.h => method.hpp} (99%) rename src/vm/{zip.c => zip.cpp} (97%) rename src/vm/{zip.h => zip.hpp} (96%) diff --git a/src/mm/cacao-gc/final.h b/src/mm/cacao-gc/final.h index ebafe09b0..d6798b29a 100644 --- a/src/mm/cacao-gc/final.h +++ b/src/mm/cacao-gc/final.h @@ -30,7 +30,7 @@ #include "vm/types.h" #include "toolbox/list.hpp" -#include "vm/method.h" +#include "vm/method.hpp" /* Global Variables ***********************************************************/ diff --git a/src/mm/cacao-gc/rootset.h b/src/mm/cacao-gc/rootset.h index 9267d7fdb..5c01e9828 100644 --- a/src/mm/cacao-gc/rootset.h +++ b/src/mm/cacao-gc/rootset.h @@ -33,7 +33,7 @@ typedef struct rootset_t rootset_t; #include "threads/thread.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/replace.hpp" diff --git a/src/mm/gc.hpp b/src/mm/gc.hpp index 5e0d5e644..0a0791205 100644 --- a/src/mm/gc.hpp +++ b/src/mm/gc.hpp @@ -130,7 +130,7 @@ enum { // Includes. #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" /* function prototypes ********************************************************/ diff --git a/src/native/jvmti/jvmti.c b/src/native/jvmti/jvmti.c index 5e4878c24..e152104dc 100644 --- a/src/native/jvmti/jvmti.c +++ b/src/native/jvmti/jvmti.c @@ -46,7 +46,7 @@ #include "vm/jit/builtin.hpp" #include "vm/jit/asmpart.h" #include "vm/class.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "mm/gc.hpp" #include "toolbox/logging.h" #include "vm/options.h" diff --git a/src/native/localref.hpp b/src/native/localref.hpp index 41142d9db..11e212e38 100644 --- a/src/native/localref.hpp +++ b/src/native/localref.hpp @@ -35,7 +35,7 @@ typedef struct localref_table localref_table; #include "vm/types.h" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" /* localref_table ************************************************************** diff --git a/src/native/native.hpp b/src/native/native.hpp index 33e9ae9bf..c373e96f1 100644 --- a/src/native/native.hpp +++ b/src/native/native.hpp @@ -39,7 +39,7 @@ #include "vm/class.hpp" #include "vm/global.h" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/os.hpp" #include "vm/utf8.h" diff --git a/src/native/vm/cldc1.1/com_sun_cldc_io_ResourceInputStream.cpp b/src/native/vm/cldc1.1/com_sun_cldc_io_ResourceInputStream.cpp index 3d53b2cbf..2ece32fc4 100644 --- a/src/native/vm/cldc1.1/com_sun_cldc_io_ResourceInputStream.cpp +++ b/src/native/vm/cldc1.1/com_sun_cldc_io_ResourceInputStream.cpp @@ -49,7 +49,7 @@ #include "vm/string.hpp" #include "vm/types.h" #include "vm/vm.hpp" /* REMOVE ME: temporarily */ -#include "vm/zip.h" +#include "vm/zip.hpp" static java_handle_t* zip_read_resource(list_classpath_entry *lce, utf *name) diff --git a/src/native/vm/gnuclasspath/gnu_java_lang_management_VMClassLoadingMXBeanImpl.cpp b/src/native/vm/gnuclasspath/gnu_java_lang_management_VMClassLoadingMXBeanImpl.cpp index 069b7dffe..c706681c9 100644 --- a/src/native/vm/gnuclasspath/gnu_java_lang_management_VMClassLoadingMXBeanImpl.cpp +++ b/src/native/vm/gnuclasspath/gnu_java_lang_management_VMClassLoadingMXBeanImpl.cpp @@ -38,7 +38,7 @@ #include "toolbox/logging.h" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/utf8.h" #include "vm/vm.hpp" diff --git a/src/native/vm/gnuclasspath/gnu_java_lang_management_VMThreadMXBeanImpl.cpp b/src/native/vm/gnuclasspath/gnu_java_lang_management_VMThreadMXBeanImpl.cpp index 0ad83bcde..f04140ff3 100644 --- a/src/native/vm/gnuclasspath/gnu_java_lang_management_VMThreadMXBeanImpl.cpp +++ b/src/native/vm/gnuclasspath/gnu_java_lang_management_VMThreadMXBeanImpl.cpp @@ -38,7 +38,7 @@ #include "toolbox/logging.h" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/utf8.h" #include "vm/vm.hpp" diff --git a/src/native/vm/gnuclasspath/java_lang_VMClassLoader.cpp b/src/native/vm/gnuclasspath/java_lang_VMClassLoader.cpp index cc22d92b1..41bfe1779 100644 --- a/src/native/vm/gnuclasspath/java_lang_VMClassLoader.cpp +++ b/src/native/vm/gnuclasspath/java_lang_VMClassLoader.cpp @@ -48,7 +48,7 @@ #include "vm/jit/builtin.hpp" #include "vm/class.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/exceptions.hpp" #include "vm/globals.hpp" #include "vm/initialize.hpp" @@ -60,7 +60,7 @@ #include "vm/statistics.h" #include "vm/string.hpp" #include "vm/vm.hpp" -#include "vm/zip.h" +#include "vm/zip.hpp" #include "vm/jit/asmpart.h" diff --git a/src/native/vm/gnuclasspath/java_lang_reflect_VMMethod.cpp b/src/native/vm/gnuclasspath/java_lang_reflect_VMMethod.cpp index 61a20f737..7d345caa6 100644 --- a/src/native/vm/gnuclasspath/java_lang_reflect_VMMethod.cpp +++ b/src/native/vm/gnuclasspath/java_lang_reflect_VMMethod.cpp @@ -49,7 +49,7 @@ #include "vm/globals.hpp" #include "vm/initialize.hpp" #include "vm/javaobjects.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/resolve.hpp" #include "vm/string.hpp" diff --git a/src/native/vm/nativevm.cpp b/src/native/vm/nativevm.cpp index c3f356fa5..a61f61920 100644 --- a/src/native/vm/nativevm.cpp +++ b/src/native/vm/nativevm.cpp @@ -31,7 +31,7 @@ #include "vm/class.hpp" #include "vm/initialize.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/os.hpp" diff --git a/src/native/vm/openjdk/jvm.cpp b/src/native/vm/openjdk/jvm.cpp index 0ed70979b..7a63880ba 100644 --- a/src/native/vm/openjdk/jvm.cpp +++ b/src/native/vm/openjdk/jvm.cpp @@ -73,7 +73,7 @@ #endif #include "vm/jit/builtin.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/exceptions.hpp" #include "vm/global.h" #include "vm/globals.hpp" diff --git a/src/native/vm/reflection.cpp b/src/native/vm/reflection.cpp index c2745b9fb..a26a50c4a 100644 --- a/src/native/vm/reflection.cpp +++ b/src/native/vm/reflection.cpp @@ -43,7 +43,7 @@ #include "vm/globals.hpp" #include "vm/initialize.hpp" #include "vm/javaobjects.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/string.hpp" diff --git a/src/native/vm/reflection.hpp b/src/native/vm/reflection.hpp index c4fe674e2..2901c0ffe 100644 --- a/src/native/vm/reflection.hpp +++ b/src/native/vm/reflection.hpp @@ -33,7 +33,7 @@ #include "native/native.hpp" #include "vm/field.hpp" -#include "vm/method.h" +#include "vm/method.hpp" class Reflection { diff --git a/src/threads/thread.cpp b/src/threads/thread.cpp index 6f83faf5b..8804f6eb5 100644 --- a/src/threads/thread.cpp +++ b/src/threads/thread.cpp @@ -51,7 +51,7 @@ #include "vm/exceptions.hpp" #include "vm/globals.hpp" #include "vm/javaobjects.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/string.hpp" #include "vm/utf8.h" diff --git a/src/toolbox/logging.h b/src/toolbox/logging.h index bb4970cd1..eed61bd8d 100644 --- a/src/toolbox/logging.h +++ b/src/toolbox/logging.h @@ -32,7 +32,7 @@ #include #include "vm/class.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/utf8.h" diff --git a/src/vm/Makefile.am b/src/vm/Makefile.am index de4ea00bd..829fed607 100644 --- a/src/vm/Makefile.am +++ b/src/vm/Makefile.am @@ -65,8 +65,8 @@ endif if ENABLE_ZLIB ZLIB_SOURCES = \ - zip.c \ - zip.h + zip.cpp \ + zip.hpp endif noinst_HEADERS = \ @@ -85,8 +85,8 @@ libvm_la_SOURCES = \ $(ASSERTION_SOURCES) \ class.cpp \ class.hpp \ - classcache.c \ - classcache.h \ + classcache.cpp \ + classcache.hpp \ $(CYCLES_STATS_SOURCES) \ descriptor.c \ descriptor.h \ @@ -106,8 +106,8 @@ libvm_la_SOURCES = \ linker.h \ loader.cpp \ loader.hpp \ - method.c \ - method.h \ + method.cpp \ + method.hpp \ options.c \ options.h \ os.cpp \ diff --git a/src/vm/access.c b/src/vm/access.c index bd21bd782..218cff611 100644 --- a/src/vm/access.c +++ b/src/vm/access.c @@ -40,7 +40,7 @@ #include "vm/exceptions.hpp" #include "vm/field.hpp" #include "vm/globals.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/stacktrace.hpp" diff --git a/src/vm/access.h b/src/vm/access.h index 59c6ef781..d1a51f875 100644 --- a/src/vm/access.h +++ b/src/vm/access.h @@ -37,7 +37,7 @@ extern "C" { #include "vm/class.hpp" #include "vm/field.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" /* macros *********************************************************************/ diff --git a/src/vm/annotation.h b/src/vm/annotation.h index 6facf2d41..2a8b11616 100644 --- a/src/vm/annotation.h +++ b/src/vm/annotation.h @@ -35,7 +35,7 @@ #include "vm/field.hpp" #include "vm/global.h" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" /* function prototypes ********************************************************/ diff --git a/src/vm/class.cpp b/src/vm/class.cpp index 1e479529b..9a229f11b 100644 --- a/src/vm/class.cpp +++ b/src/vm/class.cpp @@ -46,7 +46,7 @@ #include "vm/array.hpp" #include "vm/jit/builtin.hpp" #include "vm/class.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/exceptions.hpp" #include "vm/global.h" #include "vm/globals.hpp" diff --git a/src/vm/class.hpp b/src/vm/class.hpp index f643fd357..2f52ed77b 100644 --- a/src/vm/class.hpp +++ b/src/vm/class.hpp @@ -47,7 +47,7 @@ typedef struct extra_classref extra_classref; #include "vm/global.h" #include "vm/linker.h" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/references.h" #include "vm/string.hpp" #include "vm/utf8.h" diff --git a/src/vm/classcache.c b/src/vm/classcache.cpp similarity index 98% rename from src/vm/classcache.c rename to src/vm/classcache.cpp index 6324f2a78..5458ec80b 100644 --- a/src/vm/classcache.c +++ b/src/vm/classcache.cpp @@ -1,4 +1,4 @@ -/* src/vm/classcache.c - loaded class cache and loading constraints +/* src/vm/classcache.cpp - loaded class cache and loading constraints Copyright (C) 1996-2005, 2006, 2007, 2008 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO @@ -37,7 +37,7 @@ #include "toolbox/hashtable.h" #include "toolbox/logging.h" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/exceptions.hpp" #include "vm/options.h" #include "vm/utf8.h" @@ -138,6 +138,10 @@ /* #define CLASSCACHE_VERBOSE */ +#if defined(__cplusplus) +extern "C" { +#endif + /*============================================================================*/ /* STATISTICS */ /*============================================================================*/ @@ -210,8 +214,8 @@ void classcache_print_statistics(FILE *file) { /*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */ #if defined(ENABLE_THREADS) -# define CLASSCACHE_LOCK() Mutex_lock(classcache_hashtable_mutex) -# define CLASSCACHE_UNLOCK() Mutex_unlock(classcache_hashtable_mutex) +# define CLASSCACHE_LOCK() classcache_hashtable_mutex->lock(); +# define CLASSCACHE_UNLOCK() classcache_hashtable_mutex->unlock(); #else # define CLASSCACHE_LOCK() # define CLASSCACHE_UNLOCK() @@ -261,7 +265,7 @@ bool classcache_init(void) #if defined(ENABLE_THREADS) /* create utf hashtable mutex */ - classcache_hashtable_mutex = Mutex_new(); + classcache_hashtable_mutex = new Mutex(); #endif /* everything's ok */ @@ -438,7 +442,7 @@ static classcache_name_entry *classcache_lookup_name(utf *name) key = CLASSCACHE_HASH(name->text, (u4) name->blength); slot = key & (hashtable_classcache.size - 1); - c = hashtable_classcache.ptr[slot]; + c = (classcache_name_entry*) hashtable_classcache.ptr[slot]; /* search external hash chain for the entry */ @@ -484,7 +488,7 @@ static classcache_name_entry *classcache_new_name(utf *name) key = CLASSCACHE_HASH(name->text, (u4) name->blength); slot = key & (hashtable_classcache.size - 1); - c = hashtable_classcache.ptr[slot]; + c = (classcache_name_entry*) hashtable_classcache.ptr[slot]; /* search external hash chain for the entry */ @@ -1347,7 +1351,7 @@ static s4 classcache_number_of_loaded_classes(void) for (i = 0; i < hashtable_classcache.size; i++) { /* iterate over hashlink */ - for (en = hashtable_classcache.ptr[i]; en != NULL; en = en->hashlink) { + for (en = (classcache_name_entry*) hashtable_classcache.ptr[i]; en != NULL; en = en->hashlink) { /* filter pseudo classes $NEW$, $NULL$, $ARRAYSTUB$ out */ if (en->name->text[0] == '$') @@ -1468,7 +1472,7 @@ void classcache_foreach_loaded_class(classcache_foreach_functionptr_t func, for (i = 0; i < hashtable_classcache.size; i++) { /* iterate over hashlink */ - for (en = hashtable_classcache.ptr[i]; en != NULL; en = en->hashlink) { + for (en = (classcache_name_entry*) hashtable_classcache.ptr[i]; en != NULL; en = en->hashlink) { /* filter pseudo classes $NEW$, $NULL$, $ARRAYSTUB$ out */ if (en->name->text[0] == '$') @@ -1569,6 +1573,11 @@ dump_it: CLASSCACHE_UNLOCK(); } + +#if defined(__cplusplus) +} +#endif + #endif /* NDEBUG */ /* diff --git a/src/vm/classcache.h b/src/vm/classcache.hpp similarity index 98% rename from src/vm/classcache.h rename to src/vm/classcache.hpp index 88d7a442c..84ba73658 100644 --- a/src/vm/classcache.h +++ b/src/vm/classcache.hpp @@ -1,4 +1,4 @@ -/* src/vm/classcache.h - loaded class cache and loading constraints +/* src/vm/classcache.hpp - loaded class cache and loading constraints Copyright (C) 1996-2005, 2006, 2007, 2008 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO diff --git a/src/vm/descriptor.h b/src/vm/descriptor.h index a93f3f965..bf6c69efb 100644 --- a/src/vm/descriptor.h +++ b/src/vm/descriptor.h @@ -44,7 +44,7 @@ typedef struct methoddesc methoddesc; #include "vm/class.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/references.h" #include "vm/utf8.h" diff --git a/src/vm/exceptions.cpp b/src/vm/exceptions.cpp index a337beaeb..5f01f221e 100644 --- a/src/vm/exceptions.cpp +++ b/src/vm/exceptions.cpp @@ -52,7 +52,7 @@ #include "vm/globals.hpp" #include "vm/javaobjects.hpp" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/os.hpp" #include "vm/string.hpp" diff --git a/src/vm/exceptions.hpp b/src/vm/exceptions.hpp index 924679b7d..564ffff9f 100644 --- a/src/vm/exceptions.hpp +++ b/src/vm/exceptions.hpp @@ -31,7 +31,7 @@ #include "vm/global.h" #include "vm/references.h" -#include "vm/method.h" +#include "vm/method.hpp" /* function prototypes ********************************************************/ diff --git a/src/vm/javaobjects.hpp b/src/vm/javaobjects.hpp index dc336cc76..f53021823 100644 --- a/src/vm/javaobjects.hpp +++ b/src/vm/javaobjects.hpp @@ -39,7 +39,7 @@ #include "vm/field.hpp" #include "vm/global.h" #include "vm/globals.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #ifdef __cplusplus diff --git a/src/vm/jit/allocator/liveness.c b/src/vm/jit/allocator/liveness.c index d6bd012da..de94a0f44 100644 --- a/src/vm/jit/allocator/liveness.c +++ b/src/vm/jit/allocator/liveness.c @@ -38,7 +38,7 @@ #include "vm/jit/builtin.hpp" #include "vm/exceptions.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/resolve.hpp" #include "vm/jit/codegen-common.hpp" #include "vm/jit/jit.hpp" diff --git a/src/vm/jit/allocator/simplereg.c b/src/vm/jit/allocator/simplereg.c index d1f63af18..f852229bf 100644 --- a/src/vm/jit/allocator/simplereg.c +++ b/src/vm/jit/allocator/simplereg.c @@ -37,7 +37,7 @@ #include "vm/jit/builtin.hpp" #include "vm/exceptions.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/resolve.hpp" #include "vm/string.hpp" diff --git a/src/vm/jit/argument.cpp b/src/vm/jit/argument.cpp index a340cf566..a670883d6 100644 --- a/src/vm/jit/argument.cpp +++ b/src/vm/jit/argument.cpp @@ -37,7 +37,7 @@ #include "vm/array.hpp" #include "vm/descriptor.h" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/primitive.hpp" #include "vm/resolve.hpp" #include "vm/vm.hpp" diff --git a/src/vm/jit/argument.hpp b/src/vm/jit/argument.hpp index 07ca62d5a..29c41360a 100644 --- a/src/vm/jit/argument.hpp +++ b/src/vm/jit/argument.hpp @@ -31,7 +31,7 @@ #include #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" /* function prototypes ********************************************************/ diff --git a/src/vm/jit/code.hpp b/src/vm/jit/code.hpp index fcdb08c68..51d291293 100644 --- a/src/vm/jit/code.hpp +++ b/src/vm/jit/code.hpp @@ -36,7 +36,7 @@ #include "toolbox/list.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/exceptiontable.h" #if defined (ENABLE_JITCACHE) diff --git a/src/vm/jit/codegen-common.cpp b/src/vm/jit/codegen-common.cpp index 47ad041c7..1ecbef326 100644 --- a/src/vm/jit/codegen-common.cpp +++ b/src/vm/jit/codegen-common.cpp @@ -67,7 +67,7 @@ #include "vm/jit/builtin.hpp" #include "vm/exceptions.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/string.hpp" diff --git a/src/vm/jit/codegen-common.hpp b/src/vm/jit/codegen-common.hpp index 8e676a495..98a714236 100644 --- a/src/vm/jit/codegen-common.hpp +++ b/src/vm/jit/codegen-common.hpp @@ -43,7 +43,7 @@ typedef struct dataref dataref; #include "vm/jit/builtin.hpp" #include "vm/descriptor.h" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/references.h" #include "vm/jit/dseg.h" diff --git a/src/vm/jit/inline/inline.cpp b/src/vm/jit/inline/inline.cpp index 2ba9156c2..cb6d37cb7 100644 --- a/src/vm/jit/inline/inline.cpp +++ b/src/vm/jit/inline/inline.cpp @@ -44,7 +44,7 @@ #include "vm/class.hpp" #include "vm/global.h" #include "vm/initialize.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/statistics.h" diff --git a/src/vm/jit/intrp/intrp.h b/src/vm/jit/intrp/intrp.h index 03073954c..7c74c9a87 100644 --- a/src/vm/jit/intrp/intrp.h +++ b/src/vm/jit/intrp/intrp.h @@ -47,7 +47,7 @@ typedef s4 Cell; #include "vm/class.hpp" #include "vm/global.h" #include "vm/linker.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/references.h" #include "vm/resolve.hpp" diff --git a/src/vm/jit/jit.cpp b/src/vm/jit/jit.cpp index 981743412..ffd17e37b 100644 --- a/src/vm/jit/jit.cpp +++ b/src/vm/jit/jit.cpp @@ -45,7 +45,7 @@ #include "vm/globals.hpp" #include "vm/initialize.hpp" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/rt-timing.h" #include "vm/statistics.h" diff --git a/src/vm/jit/jit.hpp b/src/vm/jit/jit.hpp index ecbb865cf..6aab8851e 100644 --- a/src/vm/jit/jit.hpp +++ b/src/vm/jit/jit.hpp @@ -37,7 +37,7 @@ typedef struct exception_entry exception_entry; #include "vm/types.h" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/references.h" #include "vm/resolve.hpp" diff --git a/src/vm/jit/jitcache.cpp b/src/vm/jit/jitcache.cpp index 6a38ccc04..124d03973 100644 --- a/src/vm/jit/jitcache.cpp +++ b/src/vm/jit/jitcache.cpp @@ -58,7 +58,7 @@ extern "C" { #include "mm/memory.h" #include "mm/codememory.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/resolve.hpp" #include "vm/types.h" diff --git a/src/vm/jit/jitcache.hpp b/src/vm/jit/jitcache.hpp index 513aa5c36..c40d1b4bd 100644 --- a/src/vm/jit/jitcache.hpp +++ b/src/vm/jit/jitcache.hpp @@ -38,7 +38,7 @@ extern "C" { #include #include "vm/class.hpp" -#include "vm/method.h" +#include "vm/method.hpp" typedef enum cachedreftype { CRT_CODEINFO, diff --git a/src/vm/jit/linenumbertable.hpp b/src/vm/jit/linenumbertable.hpp index 0d6143e17..799a1c62e 100644 --- a/src/vm/jit/linenumbertable.hpp +++ b/src/vm/jit/linenumbertable.hpp @@ -37,7 +37,7 @@ #include "toolbox/list.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/jit.hpp" #include "vm/jit/code.hpp" diff --git a/src/vm/jit/loop/graph.h b/src/vm/jit/loop/graph.h index 2f5978485..320ceb582 100644 --- a/src/vm/jit/loop/graph.h +++ b/src/vm/jit/loop/graph.h @@ -29,7 +29,7 @@ #include "config.h" #include "vm/types.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/loop/loop.h" diff --git a/src/vm/jit/loop/loop.h b/src/vm/jit/loop/loop.h index 0a2eaa54a..11080de74 100644 --- a/src/vm/jit/loop/loop.h +++ b/src/vm/jit/loop/loop.h @@ -30,7 +30,7 @@ #include "vm/types.h" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/jit.hpp" diff --git a/src/vm/jit/mips/md-abi.c b/src/vm/jit/mips/md-abi.c index a2d9157c6..3b4be869c 100644 --- a/src/vm/jit/mips/md-abi.c +++ b/src/vm/jit/mips/md-abi.c @@ -36,7 +36,7 @@ #include "vm/descriptor.h" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/abi.h" #include "vm/jit/stack.h" diff --git a/src/vm/jit/oprofile-agent.hpp b/src/vm/jit/oprofile-agent.hpp index 14bc54968..59d42505d 100644 --- a/src/vm/jit/oprofile-agent.hpp +++ b/src/vm/jit/oprofile-agent.hpp @@ -30,7 +30,7 @@ extern "C" { -#include "vm/method.h" +#include "vm/method.hpp" #include } diff --git a/src/vm/jit/optimizing/escape.c b/src/vm/jit/optimizing/escape.c index cd64a9c09..329ba02f0 100644 --- a/src/vm/jit/optimizing/escape.c +++ b/src/vm/jit/optimizing/escape.c @@ -26,7 +26,7 @@ #include "config.h" #include "vm/class.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/jit/jit.hpp" #include "vm/jit/optimizing/escape.h" diff --git a/src/vm/jit/optimizing/escape.h b/src/vm/jit/optimizing/escape.h index 4b9b9ec4e..b682be498 100644 --- a/src/vm/jit/optimizing/escape.h +++ b/src/vm/jit/optimizing/escape.h @@ -25,7 +25,7 @@ #define _VM_JIT_OPTIMIZING_ESCAPE_H #include "vm/jit/jit.hpp" -#include "vm/method.h" +#include "vm/method.hpp" typedef enum { ESCAPE_UNKNOWN, diff --git a/src/vm/jit/optimizing/ifconv.c b/src/vm/jit/optimizing/ifconv.c index c463d1e2f..9b292e64e 100644 --- a/src/vm/jit/optimizing/ifconv.c +++ b/src/vm/jit/optimizing/ifconv.c @@ -29,7 +29,7 @@ #include "vm/types.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/vm.hpp" #include "vm/jit/codegen-common.hpp" diff --git a/src/vm/jit/optimizing/lsra.c b/src/vm/jit/optimizing/lsra.c index e5e571ef3..5ea6e55d1 100644 --- a/src/vm/jit/optimizing/lsra.c +++ b/src/vm/jit/optimizing/lsra.c @@ -37,7 +37,7 @@ #include "vm/statistics.h" #include "vm/options.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/abi.h" #include "vm/jit/reg.h" diff --git a/src/vm/jit/optimizing/profile.c b/src/vm/jit/optimizing/profile.c index dfffb133f..e397be602 100644 --- a/src/vm/jit/optimizing/profile.c +++ b/src/vm/jit/optimizing/profile.c @@ -37,8 +37,8 @@ #include "vm/jit/builtin.hpp" #include "vm/class.hpp" -#include "vm/classcache.h" -#include "vm/method.h" +#include "vm/classcache.hpp" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/string.hpp" diff --git a/src/vm/jit/optimizing/recompiler.cpp b/src/vm/jit/optimizing/recompiler.cpp index 8cd46d400..4f3d52426 100644 --- a/src/vm/jit/optimizing/recompiler.cpp +++ b/src/vm/jit/optimizing/recompiler.cpp @@ -34,7 +34,7 @@ #include "threads/mutex.hpp" #include "threads/thread.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/exceptions.hpp" #include "vm/options.h" #include "vm/string.hpp" diff --git a/src/vm/jit/optimizing/recompiler.hpp b/src/vm/jit/optimizing/recompiler.hpp index 4a99d84d7..86eba45d6 100644 --- a/src/vm/jit/optimizing/recompiler.hpp +++ b/src/vm/jit/optimizing/recompiler.hpp @@ -38,7 +38,7 @@ #include "threads/condition.hpp" #include "threads/mutex.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #ifdef __cplusplus diff --git a/src/vm/jit/replace.cpp b/src/vm/jit/replace.cpp index 3fec92c75..427f0746a 100644 --- a/src/vm/jit/replace.cpp +++ b/src/vm/jit/replace.cpp @@ -44,7 +44,7 @@ #include "toolbox/logging.h" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/globals.hpp" #include "vm/options.h" #include "vm/string.hpp" diff --git a/src/vm/jit/replace.hpp b/src/vm/jit/replace.hpp index 20b61ec70..5c520d5ec 100644 --- a/src/vm/jit/replace.hpp +++ b/src/vm/jit/replace.hpp @@ -57,7 +57,7 @@ typedef union replace_val_t replace_val_t; #include "arch.h" #include "md-abi.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/reg.h" #include "vm/jit/stacktrace.hpp" diff --git a/src/vm/jit/stacktrace.cpp b/src/vm/jit/stacktrace.cpp index 140503705..9b63c7e17 100644 --- a/src/vm/jit/stacktrace.cpp +++ b/src/vm/jit/stacktrace.cpp @@ -53,7 +53,7 @@ #include "vm/globals.hpp" #include "vm/javaobjects.hpp" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/string.hpp" #include "vm/vm.hpp" diff --git a/src/vm/jit/stubs.cpp b/src/vm/jit/stubs.cpp index 42a6c442e..66489b627 100644 --- a/src/vm/jit/stubs.cpp +++ b/src/vm/jit/stubs.cpp @@ -33,7 +33,7 @@ #include "mm/dumpmemory.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/jit/abi.h" diff --git a/src/vm/jit/stubs.hpp b/src/vm/jit/stubs.hpp index ac4041f39..a8af31404 100644 --- a/src/vm/jit/stubs.hpp +++ b/src/vm/jit/stubs.hpp @@ -29,7 +29,7 @@ #include -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/jit/code.hpp" diff --git a/src/vm/jit/trace.hpp b/src/vm/jit/trace.hpp index 06d808dbf..14d1b6110 100644 --- a/src/vm/jit/trace.hpp +++ b/src/vm/jit/trace.hpp @@ -30,7 +30,7 @@ #include -#include "vm/method.h" +#include "vm/method.hpp" #if !defined(NDEBUG) diff --git a/src/vm/linker.c b/src/vm/linker.c index e5883f091..8ee26ca36 100644 --- a/src/vm/linker.c +++ b/src/vm/linker.c @@ -42,7 +42,7 @@ #include "vm/access.h" #include "vm/array.hpp" #include "vm/class.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/exceptions.hpp" #include "vm/globals.hpp" #include "vm/loader.hpp" diff --git a/src/vm/loader.cpp b/src/vm/loader.cpp index 4f1d36fff..32ac8e14c 100644 --- a/src/vm/loader.cpp +++ b/src/vm/loader.cpp @@ -42,14 +42,14 @@ #include "toolbox/logging.h" #include "vm/jit/builtin.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/exceptions.hpp" #include "vm/field.hpp" #include "vm/global.h" #include "vm/globals.hpp" #include "vm/linker.h" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/package.hpp" #include "vm/primitive.hpp" @@ -70,7 +70,7 @@ #endif #if defined(ENABLE_ZLIB) -# include "vm/zip.h" +# include "vm/zip.hpp" #endif #include "vm/jit/stubs.hpp" diff --git a/src/vm/loader.hpp b/src/vm/loader.hpp index d750b59e1..3e30e4a27 100644 --- a/src/vm/loader.hpp +++ b/src/vm/loader.hpp @@ -40,7 +40,7 @@ typedef struct classbuffer classbuffer; #include "vm/descriptor.h" #include "vm/class.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/references.h" #include "vm/utf8.h" diff --git a/src/vm/method.c b/src/vm/method.cpp similarity index 98% rename from src/vm/method.c rename to src/vm/method.cpp index afaea9948..471842315 100644 --- a/src/vm/method.c +++ b/src/vm/method.cpp @@ -1,4 +1,4 @@ -/* src/vm/method.c - method functions +/* src/vm/method.cpp - method functions Copyright (C) 1996-2005, 2006, 2007, 2008 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO @@ -45,7 +45,7 @@ #include "vm/globals.hpp" #include "vm/linker.h" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/resolve.hpp" #include "vm/suck.hpp" @@ -63,12 +63,16 @@ #define INLINELOG(code) #endif - /* global variables ***********************************************************/ methodinfo *method_java_lang_reflect_Method_invoke; +#if defined(__cplusplus) +extern "C" { +#endif + + /* method_init ***************************************************************** Initialize method subsystem. @@ -144,7 +148,7 @@ bool method_load(classbuffer *cb, methodinfo *m, descriptor_pool *descpool) c = cb->clazz; - m->mutex = Mutex_new(); + m->mutex = new Mutex(); #if defined(ENABLE_STATISTICS) if (opt_stat) @@ -166,7 +170,7 @@ bool method_load(classbuffer *cb, methodinfo *m, descriptor_pool *descpool) name_index = suck_u2(cb); - if (!(u = class_getconstant(c, name_index, CONSTANT_Utf8))) + if (!(u = (utf*) class_getconstant(c, name_index, CONSTANT_Utf8))) return false; m->name = u; @@ -175,7 +179,7 @@ bool method_load(classbuffer *cb, methodinfo *m, descriptor_pool *descpool) descriptor_index = suck_u2(cb); - if (!(u = class_getconstant(c, descriptor_index, CONSTANT_Utf8))) + if (!(u = (utf*) class_getconstant(c, descriptor_index, CONSTANT_Utf8))) return false; m->descriptor = u; @@ -274,7 +278,7 @@ bool method_load(classbuffer *cb, methodinfo *m, descriptor_pool *descpool) attribute_name_index = suck_u2(cb); attribute_name = - class_getconstant(c, attribute_name_index, CONSTANT_Utf8); + (utf*) class_getconstant(c, attribute_name_index, CONSTANT_Utf8); if (attribute_name == NULL) return false; @@ -377,7 +381,7 @@ bool method_load(classbuffer *cb, methodinfo *m, descriptor_pool *descpool) code_attribute_name_index = suck_u2(cb); code_attribute_name = - class_getconstant(c, code_attribute_name_index, CONSTANT_Utf8); + (utf*) class_getconstant(c, code_attribute_name_index, CONSTANT_Utf8); if (code_attribute_name == NULL) return false; @@ -529,7 +533,7 @@ bool method_load(classbuffer *cb, methodinfo *m, descriptor_pool *descpool) void method_free(methodinfo *m) { if (m->mutex) - Mutex_delete(m->mutex); + delete m->mutex; if (m->jcode) MFREE(m->jcode, u1, m->jcodelength); @@ -541,10 +545,10 @@ void method_free(methodinfo *m) if (m->stubroutine) { if (m->flags & ACC_NATIVE) { - NativeStub_remove(m->stubroutine); + NativeStub::remove(m->stubroutine); } else { - CompilerStub_remove(m->stubroutine); + CompilerStub::remove(m->stubroutine); } } } @@ -591,7 +595,7 @@ methodinfo *method_new_builtin(builtintable_entry *bte) MZERO(m, methodinfo, 1); - m->mutex = Mutex_new(); + m->mutex = new Mutex(); m->flags = ACC_METHOD_BUILTIN; m->parseddesc = bte->md; m->name = bte->name; @@ -1203,6 +1207,9 @@ void method_methodref_println(constant_FMIref *mr) } #endif /* !defined(NDEBUG) */ +#if defined(__cplusplus) +} +#endif /* * These are local overrides for various environment variables in Emacs. diff --git a/src/vm/method.h b/src/vm/method.hpp similarity index 99% rename from src/vm/method.h rename to src/vm/method.hpp index 994a6c229..754bacc17 100644 --- a/src/vm/method.h +++ b/src/vm/method.hpp @@ -1,4 +1,4 @@ -/* src/vm/method.h - method functions header +/* src/vm/method.hpp - method functions header Copyright (C) 1996-2005, 2006, 2007, 2008 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO @@ -59,7 +59,6 @@ typedef struct codeinfo codeinfo; #define METHOD_INITIAL_HIT_COUNTDOWN 1000 #endif - /* methodinfo *****************************************************************/ struct methodinfo { /* method structure */ diff --git a/src/vm/properties.cpp b/src/vm/properties.cpp index f59188d2e..f5b66db4d 100644 --- a/src/vm/properties.cpp +++ b/src/vm/properties.cpp @@ -42,7 +42,7 @@ #include "vm/class.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/os.hpp" #include "vm/properties.hpp" diff --git a/src/vm/references.h b/src/vm/references.h index f29d69fc5..a24d975f3 100644 --- a/src/vm/references.h +++ b/src/vm/references.h @@ -65,7 +65,7 @@ typedef union parseddesc { #include "vm/descriptor.h" #include "vm/field.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/utf8.h" diff --git a/src/vm/resolve.cpp b/src/vm/resolve.cpp index 0dc57ef3e..e5b90991e 100644 --- a/src/vm/resolve.cpp +++ b/src/vm/resolve.cpp @@ -32,7 +32,7 @@ #include "mm/memory.h" #include "vm/access.h" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/descriptor.h" #include "vm/exceptions.hpp" #include "vm/global.h" diff --git a/src/vm/resolve.hpp b/src/vm/resolve.hpp index dc6ccfc1c..f75f17338 100644 --- a/src/vm/resolve.hpp +++ b/src/vm/resolve.hpp @@ -40,7 +40,7 @@ typedef struct unresolved_subtype_set unresolved_subtype_set; #include "vm/class.hpp" #include "vm/field.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/references.h" #include "vm/jit/jit.hpp" diff --git a/src/vm/signal.c b/src/vm/signal.c index 345db3dd2..ed7d495e4 100644 --- a/src/vm/signal.c +++ b/src/vm/signal.c @@ -48,7 +48,7 @@ #include "vm/exceptions.hpp" #include "vm/globals.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/signallocal.h" #include "vm/vm.hpp" diff --git a/src/vm/stackmap.c b/src/vm/stackmap.c index ecbb6e916..87117d05e 100644 --- a/src/vm/stackmap.c +++ b/src/vm/stackmap.c @@ -30,7 +30,7 @@ #include "vm/class.hpp" #include "vm/exceptions.hpp" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/stackmap.h" #include "vm/statistics.h" diff --git a/src/vm/stackmap.h b/src/vm/stackmap.h index ff9c5e581..fb900863d 100644 --- a/src/vm/stackmap.h +++ b/src/vm/stackmap.h @@ -54,7 +54,7 @@ typedef struct Uninitialized_variable_info_t Uninitialized_variable_info_t; #include "vm/global.h" #include "vm/loader.hpp" -#include "vm/method.h" +#include "vm/method.hpp" /* verification_type_info *****************************************************/ @@ -206,11 +206,18 @@ union stack_map_frame_t { full_frame_t full_frame; }; +#if defined(__cplusplus) +extern "C" { +#endif /* function prototypes ********************************************************/ bool stackmap_load_attribute_stackmaptable(classbuffer *cb, methodinfo *m); +#if defined(__cplusplus) +} +#endif + #endif /* _STACKMAP_H */ diff --git a/src/vm/statistics.c b/src/vm/statistics.c index 8ab2f6fd5..2088b2d8a 100644 --- a/src/vm/statistics.c +++ b/src/vm/statistics.c @@ -51,7 +51,7 @@ #include "vm/class.hpp" #include "vm/field.hpp" #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" #include "vm/options.h" #include "vm/statistics.h" diff --git a/src/vm/suck.cpp b/src/vm/suck.cpp index 8fd069970..1c1664a7e 100644 --- a/src/vm/suck.cpp +++ b/src/vm/suck.cpp @@ -47,7 +47,7 @@ #include "vm/properties.hpp" #include "vm/suck.hpp" #include "vm/vm.hpp" -#include "vm/zip.h" +#include "vm/zip.hpp" /* global variables ***********************************************************/ diff --git a/src/vm/vm.cpp b/src/vm/vm.cpp index f50e37732..28fff0ae9 100644 --- a/src/vm/vm.cpp +++ b/src/vm/vm.cpp @@ -64,7 +64,7 @@ #endif #include "vm/jit/builtin.hpp" -#include "vm/classcache.h" +#include "vm/classcache.hpp" #include "vm/exceptions.hpp" #include "vm/finalizer.h" #include "vm/global.h" diff --git a/src/vm/vm.hpp b/src/vm/vm.hpp index 6e3d54d37..4a73ecc35 100644 --- a/src/vm/vm.hpp +++ b/src/vm/vm.hpp @@ -120,7 +120,7 @@ int64_t VM_get_starttime(); // Includes. #include "vm/global.h" -#include "vm/method.h" +#include "vm/method.hpp" /* These C methods are the exported interface. ********************************/ diff --git a/src/vm/zip.c b/src/vm/zip.cpp similarity index 97% rename from src/vm/zip.c rename to src/vm/zip.cpp index 109156079..841109a0e 100644 --- a/src/vm/zip.c +++ b/src/vm/zip.cpp @@ -1,4 +1,4 @@ -/* src/vm/zip.c - ZIP file handling for bootstrap classloader +/* src/vm/zip.cpp - ZIP file handling for bootstrap classloader Copyright (C) 1996-2005, 2006, 2007, 2008 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO @@ -43,7 +43,7 @@ #include "vm/suck.hpp" #include "vm/utf8.h" #include "vm/vm.hpp" -#include "vm/zip.h" +#include "vm/zip.hpp" /* start size for classes hashtable *******************************************/ @@ -155,6 +155,9 @@ struct eocdr { u4 offset; }; +#if defined(__cplusplus) +extern "C" { +#endif /* zip_open ******************************************************************** @@ -200,7 +203,7 @@ hashtable *zip_open(char *path) /* we better mmap the file */ - filep = mmap(0, len, PROT_READ, MAP_PRIVATE, fd, 0); + filep = (u1*) mmap(0, len, PROT_READ, MAP_PRIVATE, fd, 0); /* some older compilers, like DEC OSF cc, don't like comparisons on void* types */ @@ -273,7 +276,7 @@ hashtable *zip_open(char *path) /* insert into external chain */ - htzfe->hashlink = ht->ptr[slot]; + htzfe->hashlink = (hashtable_zipfile_entry*) ht->ptr[slot]; /* insert hashtable zipfile entry */ @@ -330,7 +333,7 @@ hashtable_zipfile_entry *zip_find(list_classpath_entry *lce, utf *u) key = utf_hashkey(u->text, u->blength); slot = key & (ht->size - 1); - htzfe = ht->ptr[slot]; + htzfe = (hashtable_zipfile_entry*) ht->ptr[slot]; /* search external hash chain for utf-symbol */ @@ -444,6 +447,9 @@ classbuffer *zip_get(list_classpath_entry *lce, classinfo *c) return cb; } +#if defined(__cplusplus) +} +#endif /* * These are local overrides for various environment variables in Emacs. diff --git a/src/vm/zip.h b/src/vm/zip.hpp similarity index 96% rename from src/vm/zip.h rename to src/vm/zip.hpp index b95dae1a6..660553594 100644 --- a/src/vm/zip.h +++ b/src/vm/zip.hpp @@ -1,4 +1,4 @@ -/* src/vm/zip.c - ZIP file handling for bootstrap classloader +/* src/vm/zip.cpp - ZIP file handling for bootstrap classloader Copyright (C) 1996-2005, 2006, 2007, 2008 CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO @@ -23,8 +23,8 @@ */ -#ifndef _ZIP_H -#define _ZIP_H +#ifndef _ZIP_HPP +#define _ZIP_HPP #include "config.h" #include "vm/types.h" @@ -101,7 +101,7 @@ classbuffer *zip_get(list_classpath_entry *lce, classinfo *c); } #endif -#endif /* _ZIP_H */ +#endif /* _ZIP_HPP */ /* -- 2.25.1