[kaffe] CVS kaffe (robilad): small warning fix for 4.1.0

Kaffe CVS cvs-commits at kaffe.org
Thu May 25 15:36:11 PDT 2006


PatchSet 7300 
Date: 2006/05/25 22:26:29
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
small warning fix for 4.1.0

2006-05-25  Dalibor Topic  <robilad at kaffe.org>

        * kaffe/kaffevm/classMethod.h (Hjava_lang_Class):
        Changed type of superclass to void * to fix compiler
        warning with gcc 4.1.0.
        (getSuperclass) New inline function.

        * kaffe/kaffevm/classMethod.c (processClass, resolveInterfaces,
        buildDispatchTable),
        kaffe/kaffevm/gcFuncs.c (destroyClass),
        kaffe/kaffevm/verifier/verify2.c (verify2):
        use getSuperclass.

Members: 
	ChangeLog:1.4804->1.4805 
	kaffe/kaffevm/classMethod.c:1.157->1.158 
	kaffe/kaffevm/classMethod.h:1.90->1.91 
	kaffe/kaffevm/gcFuncs.c:1.84->1.85 
	kaffe/kaffevm/verifier/verify2.c:1.6->1.7 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4804 kaffe/ChangeLog:1.4805
--- kaffe/ChangeLog:1.4804	Wed May 24 21:47:14 2006
+++ kaffe/ChangeLog	Thu May 25 22:26:29 2006
@@ -1,3 +1,16 @@
+2006-05-25  Dalibor Topic  <robilad at kaffe.org>
+
+	* kaffe/kaffevm/classMethod.h (Hjava_lang_Class):
+	Changed type of superclass to void * to fix compiler
+	warning with gcc 4.1.0.
+	(getSuperclass) New inline function.
+
+	* kaffe/kaffevm/classMethod.c (processClass, resolveInterfaces,
+	buildDispatchTable),
+	kaffe/kaffevm/gcFuncs.c (destroyClass),
+	kaffe/kaffevm/verifier/verify2.c (verify2):
+	use getSuperclass.
+
 2006-05-24  Dalibor Topic  <robilad at kaffe.org>
 
 	* include/Makefile.am (stamp-h1all): Merged with
Index: kaffe/kaffe/kaffevm/classMethod.c
diff -u kaffe/kaffe/kaffevm/classMethod.c:1.157 kaffe/kaffe/kaffevm/classMethod.c:1.158
--- kaffe/kaffe/kaffevm/classMethod.c:1.157	Sun Apr 23 01:32:12 2006
+++ kaffe/kaffe/kaffevm/classMethod.c	Thu May 25 22:26:40 2006
@@ -245,29 +245,29 @@
 				       class->superclass, 
 				       (void **)&(class->superclass));
 			if( !(class->accflags & ACC_INTERFACE) &&
-			    (class->superclass->accflags & ACC_INTERFACE)) {
+			    (getSuperclass(class)->accflags & ACC_INTERFACE)) {
 				postExceptionMessage(
 					einfo,
 					JAVA_LANG(
 						IncompatibleClassChangeError),
 					"Super class, %s, is an interface.",
-					class->superclass->name->data);
+					getSuperclass(class)->name->data);
 				success = false;
 				goto done;
 			}
 			/* that's pretty much obsolete. */
-			assert(class->superclass->state >= CSTATE_DOING_LINK);
+			assert(getSuperclass(class)->state >= CSTATE_DOING_LINK);
 			classMappingLoaded(ce, class);
 			/* Copy initial field size and gc layout.
 			 * Later, as this class's fields are resolved, they
 			 * are added to the superclass's layout.
 			 */
-			CLASS_FSIZE(class) = CLASS_FSIZE(class->superclass);
-			class->gc_layout = class->superclass->gc_layout;
+			CLASS_FSIZE(class) = CLASS_FSIZE(getSuperclass(class));
+			class->gc_layout = getSuperclass(class)->gc_layout;
 		}
 		if( class->superclass )
 		{
-			assert(class->superclass->state >= CSTATE_DOING_LINK);
+			assert(getSuperclass(class)->state >= CSTATE_DOING_LINK);
 		}
 		
 	}
@@ -527,7 +527,7 @@
 					       einfo);
 			lockClass(class);
 			if (success == false) {
-				if (class->superclass->state == CSTATE_FAILED)
+				if (getSuperclass(class)->state == CSTATE_FAILED)
 					SET_CLASS_STATE(CSTATE_FAILED);
 				goto done;
 			}
@@ -821,7 +821,7 @@
 			success = false;
 			goto done;
 		}
-		j += class->superclass->total_interface_len;
+		j += getSuperclass(class)->total_interface_len;
 	}
 	for (i = 0; i < class->interface_len; i++) {
 		uintp iface = (uintp)class->interfaces[i];
@@ -2079,7 +2079,7 @@
 	Hjava_lang_Class *cc;
 
 	if (class->superclass != NULL) {
-		class->msize = class->superclass->msize;
+		class->msize = getSuperclass(class)->msize;
 	}
 	else {
 		class->msize = 0;
Index: kaffe/kaffe/kaffevm/classMethod.h
diff -u kaffe/kaffe/kaffevm/classMethod.h:1.90 kaffe/kaffe/kaffevm/classMethod.h:1.91
--- kaffe/kaffe/kaffevm/classMethod.h:1.90	Sun Apr 23 01:32:12 2006
+++ kaffe/kaffe/kaffevm/classMethod.h	Thu May 25 22:26:40 2006
@@ -110,7 +110,7 @@
 	/* If non-NULL, a pointer to the superclass.
 	 * However, if state < CSTATE_DOING_PREPARE, then
 	 * (int) superclass is a constant pool index. */
-	struct Hjava_lang_Class* superclass;
+	void*                   superclass;
 
 	struct _constants	constants;
 
@@ -703,5 +703,17 @@
 extern Utf8Const* EnclosingMethod_name;  /* "EnclosingMethod" */
 
 void initialiseSecurity (void);
+
+/**
+ * get super class for a given class.
+ *
+ * @param class the class
+ *
+ * @return superclass of class
+ */
+static inline struct Hjava_lang_Class* getSuperclass(struct Hjava_lang_Class* class)
+{
+  return class->superclass;
+}
 
 #endif
Index: kaffe/kaffe/kaffevm/gcFuncs.c
diff -u kaffe/kaffe/kaffevm/gcFuncs.c:1.84 kaffe/kaffe/kaffevm/gcFuncs.c:1.85
--- kaffe/kaffe/kaffevm/gcFuncs.c:1.84	Sat Apr 22 23:42:06 2006
+++ kaffe/kaffe/kaffevm/gcFuncs.c	Thu May 25 22:26:40 2006
@@ -239,7 +239,7 @@
 	  KGC_rmRef(collector, clazz->itable2dtable);
 	}
 	if (clazz->gc_layout != NULL && clazz->superclass != NULL &&
-	    clazz->superclass->gc_layout != clazz->gc_layout)
+	    getSuperclass(clazz)->gc_layout != clazz->gc_layout)
 	  KFREE(clazz->gc_layout);
 
 	KFREE(clazz->sourcefile);
Index: kaffe/kaffe/kaffevm/verifier/verify2.c
diff -u kaffe/kaffe/kaffevm/verifier/verify2.c:1.6 kaffe/kaffe/kaffevm/verifier/verify2.c:1.7
--- kaffe/kaffe/kaffevm/verifier/verify2.c:1.6	Fri Aug 19 00:38:34 2005
+++ kaffe/kaffe/kaffevm/verifier/verify2.c	Thu May 25 22:26:41 2006
@@ -330,7 +330,7 @@
 					     "class \"%s\" does not have a superclass",
 					     CLASS_CNAME(class));
 			return(false);
-		} else if (CLASS_IS_FINAL(class->superclass)) {
+		} else if (CLASS_IS_FINAL(getSuperclass(class))) {
 			/*********************************************************
 			 * 2a: check that final classes are not inherited from
 			 *********************************************************/
@@ -338,7 +338,7 @@
 			postExceptionMessage(einfo, JAVA_LANG(VerifyError),
 					     "class \"%s\" cannot inherit from final class \"%s\"",
 					     CLASS_CNAME(class),
-					     CLASS_CNAME(class->superclass));
+					     CLASS_CNAME(getSuperclass(class)));
 			return(false);
 		} else if (CLASS_IS_INTERFACE(class)) {
 		        /* we separate this from the rest of the method checking because the only requirement
@@ -432,7 +432,7 @@
 									postExceptionMessage(einfo, JAVA_LANG(VerifyError),
 											     "final method \"%s\" declared in class \"%s\" is overriden in class \"%s\"",
 											     METHOD_NAMED(method),
-											     CLASS_CNAME(class->superclass),
+											     CLASS_CNAME(getSuperclass(class)),
 											     CLASS_CNAME(class));
 									return(false);
 								}




More information about the kaffe mailing list