nativeLoad remove #ifdef JOWENNDEBUG
[cacao.git] / native.c
index 1a5badf57c6e9e246e66fc316b988710cf565bf9..68f3714924c78870b3e70e99f213519c8231875d 100644 (file)
--- a/native.c
+++ b/native.c
@@ -31,7 +31,7 @@
    The .hh files created with the header file generator are all
    included here as are the C functions implementing these methods.
 
-   $Id: native.c 1331 2004-07-21 15:46:54Z twisti $
+   $Id: native.c 1429 2004-11-02 08:58:26Z jowenn $
 
 */
 
@@ -82,9 +82,6 @@
 #include "nativetable.inc"
 
 
-/* searchpath for classfiles */
-char *classpath;
-
 /* for java-string to char conversion */
 #define MAXSTRINGSIZE 1000                          
 
@@ -146,6 +143,7 @@ void use_class_as_object(classinfo *c)
 #undef JOWENN_DEBUG
 #undef JOWENN_DEBUG1
 
+#ifdef STATIC_CLASSPATH
 #define NATIVETABLESIZE  (sizeof(nativetable)/sizeof(struct nativeref))
 
 /* table for fast string comparison */
@@ -153,7 +151,7 @@ static nativecompref nativecomptable[NATIVETABLESIZE];
 
 /* string comparsion table initialized */
 static bool nativecompdone = false;
-
+#endif
 
 /******************************************************************************/
 
@@ -258,15 +256,6 @@ void init_systemclassloader()
 }
 
 
-/********************* function: native_setclasspath **************************/
-void native_setclasspath(char *path)
-{
-       /* set searchpath for classfiles */
-       classpath = path;
-}
-
-
 /*********************** Function: native_findfunction *************************
 
        Looks up a method (must have the same class name, method name, descriptor
@@ -281,6 +270,7 @@ void native_setclasspath(char *path)
 functionptr native_findfunction(utf *cname, utf *mname, 
                                                                utf *desc, bool isstatic)
 {
+#ifdef STATIC_CLASSPATH
        int i;
        /* entry of table for fast string comparison */
        struct nativecompref *n;
@@ -378,6 +368,10 @@ functionptr native_findfunction(utf *cname, utf *mname,
 
        /* keep compiler happy */
        return NULL;
+#else
+/* dynamic classpath */
+  return 0;
+#endif
 }
 
 
@@ -938,6 +932,9 @@ java_objectheader *literalstring_u2(java_chararray *a, u4 length, u4 offset,
 
     /* create new javastring */
     js = LNEW(java_lang_String);
+#if defined(USE_THREADS) && defined(NATIVE_THREADS)
+       initObjectLock(&js->header);
+#endif
        js->header.vftbl = class_java_lang_String->vftbl;
     js->value  = stringdata;
     js->offset = 0;