[kaffe] CVS kaffe (robilad): Fixed compiler warning on x86_64-linux.

Kaffe CVS cvs-commits at kaffe.org
Sat Sep 22 10:37:53 PDT 2007


PatchSet 7556 
Date: 2007/09/22 17:36:12
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
2007-09-22  Dalibor Topic  <robilad at kaffe.org>

        Fixed compiler warning on x86_64-linux.

        * kaffe/kaffevm/classMethod.c (methodIsNative): New function.

        * kaffe/kaffevm/classMethod.h (METHOD_IS_NATIVE): Removed macro.
        (methodIsNative) Added prototype.

        * kaffe/kaffevm/classPool.c,
        kaffe/kaffevm/stackTrace.c,
        kaffe/kaffevm/intrp/machine.c,
        kaffe/kaffevm/intrp/methodcalls.c,
        kaffe/kaffevm/jit/machine.c,
        kaffe/kaffevm/jit/methodcalls.c,
        kaffe/kaffevm/jit3/machine.c,
        kaffe/kaffevm/jni/jni.c,
        kaffe/kaffevm/verifier/verify.c,
        kaffe/kaffevm/verifier/verify2.c,
        kaffe/xprof/feedback.c: Use methodIsNative instead of METHOD_IS_NATIVE.

Members: 
	ChangeLog:1.5054->1.5055 
	kaffe/kaffevm/classMethod.c:1.160->1.161 
	kaffe/kaffevm/classMethod.h:1.94->1.95 
	kaffe/kaffevm/classPool.c:1.41->1.42 
	kaffe/kaffevm/stackTrace.c:1.54->1.55 
	kaffe/kaffevm/intrp/machine.c:1.58->1.59 
	kaffe/kaffevm/intrp/methodcalls.c:1.17->1.18 
	kaffe/kaffevm/jit/machine.c:1.88->1.89 
	kaffe/kaffevm/jit/methodcalls.c:1.13->1.14 
	kaffe/kaffevm/jit3/machine.c:1.85->1.86 
	kaffe/kaffevm/jni/jni.c:1.47->1.48 
	kaffe/kaffevm/verifier/verify.c:1.17->1.18 
	kaffe/kaffevm/verifier/verify2.c:1.8->1.9 
	kaffe/xprof/feedback.c:1.7->1.8 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.5054 kaffe/ChangeLog:1.5055
--- kaffe/ChangeLog:1.5054	Sat Sep 22 17:00:10 2007
+++ kaffe/ChangeLog	Sat Sep 22 17:36:12 2007
@@ -1,5 +1,26 @@
 2007-09-22  Dalibor Topic  <robilad at kaffe.org>
 
+	Fixed compiler warning on x86_64-linux.
+
+	* kaffe/kaffevm/classMethod.c (methodIsNative): New function.
+
+	* kaffe/kaffevm/classMethod.h (METHOD_IS_NATIVE): Removed macro.
+	(methodIsNative) Added prototype.
+
+	* kaffe/kaffevm/classPool.c,
+	kaffe/kaffevm/stackTrace.c,
+	kaffe/kaffevm/intrp/machine.c,
+	kaffe/kaffevm/intrp/methodcalls.c,
+	kaffe/kaffevm/jit/machine.c,
+	kaffe/kaffevm/jit/methodcalls.c,
+	kaffe/kaffevm/jit3/machine.c,
+	kaffe/kaffevm/jni/jni.c,
+	kaffe/kaffevm/verifier/verify.c,
+	kaffe/kaffevm/verifier/verify2.c,
+	kaffe/xprof/feedback.c: Use methodIsNative instead of METHOD_IS_NATIVE.
+
+2007-09-22  Dalibor Topic  <robilad at kaffe.org>
+
 	* kaffevm/classPool.c,
         kaffevm/intrp/machine.c,
         kaffevm/intrp/methodcalls.c,
Index: kaffe/kaffe/kaffevm/classMethod.c
diff -u kaffe/kaffe/kaffevm/classMethod.c:1.160 kaffe/kaffe/kaffevm/classMethod.c:1.161
--- kaffe/kaffe/kaffevm/classMethod.c:1.160	Fri Jan  5 15:03:04 2007
+++ kaffe/kaffe/kaffevm/classMethod.c	Sat Sep 22 17:36:13 2007
@@ -3027,3 +3027,7 @@
 	     retval-- );
 	return( retval );
 }
+
+bool methodIsNative(Method * method) {
+  return method->accflags & ACC_NATIVE;
+}
Index: kaffe/kaffe/kaffevm/classMethod.h
diff -u kaffe/kaffe/kaffevm/classMethod.h:1.94 kaffe/kaffe/kaffevm/classMethod.h:1.95
--- kaffe/kaffe/kaffevm/classMethod.h:1.94	Sat Sep  9 11:30:14 2006
+++ kaffe/kaffe/kaffevm/classMethod.h	Sat Sep 22 17:36:13 2007
@@ -580,7 +580,6 @@
 #define METHOD_IS_ABSTRACT(METH)     ((METH)->accflags & ACC_ABSTRACT)
 #define METHOD_IS_FINAL(METH)        ((METH)->accflags & ACC_FINAL)
 
-#define METHOD_IS_NATIVE(METH)       ((METH)->accflags & ACC_NATIVE)
 #define METHOD_IS_STRICT(METH)       ((METH)->accflags & ACC_STRICT)
 #define METHOD_IS_SYNCHRONISED(METH) ((METH)->accflags & ACC_SYNCHRONISED)
 
@@ -778,6 +777,14 @@
  * Initialize internal global variables of the class pool.
  */
 void KaffeVM_initClassPool(void);
+
+/**
+ * Test if a method is a native method.
+ *
+ * @param meth method to test.
+ * @return true if the method is a native method.
+ */
+bool methodIsNative(Method * method);
 
 extern Utf8Const* init_name;		/* "<clinit>" */
 extern Utf8Const* constructor_name;	/* "<init>" */
Index: kaffe/kaffe/kaffevm/classPool.c
diff -u kaffe/kaffe/kaffevm/classPool.c:1.41 kaffe/kaffe/kaffevm/classPool.c:1.42
--- kaffe/kaffe/kaffevm/classPool.c:1.41	Sat Sep 22 17:00:12 2007
+++ kaffe/kaffe/kaffevm/classPool.c	Sat Sep 22 17:36:13 2007
@@ -619,7 +619,7 @@
 			miscfixed += SIZE_IFNONZERO(m->declared_exceptions);
 			misc += SIZE_IFNONZERO(m->exception_table);
 			/* bytecode or jitted code */
-			if (!METHOD_IS_NATIVE(m)) {
+			if (!methodIsNative(m)) {
 				if (METHOD_TRANSLATED(m)) {
 					jitmem += SIZE_IFNONZERO(getMethodCodeStart(m));
 				} else {
Index: kaffe/kaffe/kaffevm/stackTrace.c
diff -u kaffe/kaffe/kaffevm/stackTrace.c:1.54 kaffe/kaffe/kaffevm/stackTrace.c:1.55
--- kaffe/kaffe/kaffevm/stackTrace.c:1.54	Sat Sep 22 17:00:12 2007
+++ kaffe/kaffe/kaffevm/stackTrace.c	Sat Sep 22 17:36:13 2007
@@ -199,7 +199,7 @@
 				unhand(element)->methodName
 					= utf8Const2Java(meth->name);
 				unhand(element)->isNative
-				  = METHOD_IS_NATIVE(meth);
+				  = methodIsNative(meth);
 				unhand_array(result)->body[frame - first_frame]
 					= (Hjava_lang_Object*)element;
 			}
@@ -260,7 +260,7 @@
 				       + 64));
 
 		if (linenr == -1) {
-		  if (METHOD_IS_NATIVE(meth)) {
+		  if (methodIsNative(meth)) {
 		    sprintf(buf, "   at %s.%s (%s:native)",
 			    class_dot_name,
 			    meth->name->data, 
Index: kaffe/kaffe/kaffevm/intrp/machine.c
diff -u kaffe/kaffe/kaffevm/intrp/machine.c:1.58 kaffe/kaffe/kaffevm/intrp/machine.c:1.59
--- kaffe/kaffe/kaffevm/intrp/machine.c:1.58	Sat Sep 22 17:00:12 2007
+++ kaffe/kaffe/kaffevm/intrp/machine.c	Sat Sep 22 17:36:13 2007
@@ -184,7 +184,7 @@
 	  soft_enter_method(((jvalue*)arg)[0].l, meth);
 #endif
 
-	if (METHOD_IS_NATIVE(meth)) {
+	if (methodIsNative(meth)) {
 NDBG(		dprintf("Call to native %s.%s%s.\n", meth->class->name->data, meth->name->data, METHOD_SIGD(meth)); );
 		if (methaccflags & ACC_STATIC) {
 			KaffeVM_callMethodA(meth, meth, 0, (jvalue*)arg, (jvalue*)retval, 1);
Index: kaffe/kaffe/kaffevm/intrp/methodcalls.c
diff -u kaffe/kaffe/kaffevm/intrp/methodcalls.c:1.17 kaffe/kaffe/kaffevm/intrp/methodcalls.c:1.18
--- kaffe/kaffe/kaffevm/intrp/methodcalls.c:1.17	Sat Sep 22 17:00:12 2007
+++ kaffe/kaffe/kaffevm/intrp/methodcalls.c	Sat Sep 22 17:36:13 2007
@@ -88,7 +88,7 @@
 {
 	Method *meth = (Method *)call->function;
 
-	if (!METHOD_IS_NATIVE(meth)) {
+	if (!methodIsNative(meth)) {
 	  jint i;
 	  jint numArgs;
 	  errorInfo einfo;
Index: kaffe/kaffe/kaffevm/jit/machine.c
diff -u kaffe/kaffe/kaffevm/jit/machine.c:1.88 kaffe/kaffe/kaffevm/jit/machine.c:1.89
--- kaffe/kaffe/kaffevm/jit/machine.c:1.88	Sat Sep 22 17:00:13 2007
+++ kaffe/kaffe/kaffevm/jit/machine.c	Sat Sep 22 17:36:13 2007
@@ -241,7 +241,7 @@
     );
 
 	/* If this code block is native, then just set it up and return */
-	if (METHOD_IS_NATIVE(meth) {
+	if (methodIsNative(meth) {
 		void *func = native(meth, einfo);
 
 		if (func == NULL) {
Index: kaffe/kaffe/kaffevm/jit/methodcalls.c
diff -u kaffe/kaffe/kaffevm/jit/methodcalls.c:1.13 kaffe/kaffe/kaffevm/jit/methodcalls.c:1.14
--- kaffe/kaffe/kaffevm/jit/methodcalls.c:1.13	Sat Sep 22 17:00:13 2007
+++ kaffe/kaffe/kaffevm/jit/methodcalls.c	Sat Sep 22 17:36:13 2007
@@ -117,7 +117,7 @@
 	 *
 	 * NB: If we'll ever support CNI, revisit this.
 	 */
-	if (CLASS_GCJ((meth)->class) && METHOD_IS_NATIVE(meth) &&
+	if (CLASS_GCJ((meth)->class) && methodIsNative(meth) &&
 		meth->idx != -1)
 		return (true);
 
@@ -173,7 +173,7 @@
 		 * anchors so we can patch them up before they're invoked.
 		 */
 		if (!(CLASS_GCJ((meth)->class)
-			&& METHOD_IS_NATIVE(meth)))
+			&& methodIsNative(meth)))
 		{
 			assert(*where == NULL ||
 				!!!"Cannot override trampoline anchor");
Index: kaffe/kaffe/kaffevm/jit3/machine.c
diff -u kaffe/kaffe/kaffevm/jit3/machine.c:1.85 kaffe/kaffe/kaffevm/jit3/machine.c:1.86
--- kaffe/kaffe/kaffevm/jit3/machine.c:1.85	Sat Sep 22 17:00:13 2007
+++ kaffe/kaffe/kaffevm/jit3/machine.c	Sat Sep 22 17:36:13 2007
@@ -237,7 +237,7 @@
 	}
 
 	/* If this code block is native, then just set it up and return */
-	if (METHOD_IS_NATIVE(xmeth)) {
+	if (methodIsNative(xmeth)) {
 		void *func = native(xmeth, einfo);
 		if (func != NULL) {
 			engine_create_wrapper(xmeth, func);
Index: kaffe/kaffe/kaffevm/jni/jni.c
diff -u kaffe/kaffe/kaffevm/jni/jni.c:1.47 kaffe/kaffe/kaffevm/jni/jni.c:1.48
--- kaffe/kaffe/kaffevm/jni/jni.c:1.47	Sat Sep 22 17:00:13 2007
+++ kaffe/kaffe/kaffevm/jni/jni.c	Sat Sep 22 17:36:13 2007
@@ -697,7 +697,7 @@
 		for (i = 0; i < nmeth; i++) {
 			if (strcmp(meth[i].name->data, methodArray[j].name) == 0 &&
 			    strcmp(METHOD_SIGD(&meth[i]), methodArray[j].signature) == 0 &&
-			    METHOD_IS_NATIVE(&meth[i])) {
+			    methodIsNative(&meth[i])) {
 				meth[i].kFlags |= KFLAG_JNI;
 				engine_create_wrapper(&meth[i], methodArray[j].fnPtr); 
 				goto found;
Index: kaffe/kaffe/kaffevm/verifier/verify.c
diff -u kaffe/kaffe/kaffevm/verifier/verify.c:1.17 kaffe/kaffe/kaffevm/verifier/verify.c:1.18
--- kaffe/kaffe/kaffevm/verifier/verify.c:1.17	Sun Jun 11 23:12:12 2006
+++ kaffe/kaffe/kaffevm/verifier/verify.c	Sat Sep 22 17:36:13 2007
@@ -292,7 +292,7 @@
 				     METHOD_NAMED(method), METHOD_SIGD(method)); );
 		
 		/* if it's abstract or native, no verification necessary */
-		if (!(METHOD_IS_ABSTRACT(method) || METHOD_IS_NATIVE(method))) {
+		if (!(METHOD_IS_ABSTRACT(method) || methodIsNative(method))) {
 			DBG(VERIFY3, dprintf("  verifying method %s\n", METHOD_NAMED(method)); );
 			
 			if (!parseMethodTypeDescriptor(METHOD_SIGD(method))) {
Index: kaffe/kaffe/kaffevm/verifier/verify2.c
diff -u kaffe/kaffe/kaffevm/verifier/verify2.c:1.8 kaffe/kaffe/kaffevm/verifier/verify2.c:1.9
--- kaffe/kaffe/kaffevm/verifier/verify2.c:1.8	Sun Jun 11 23:12:12 2006
+++ kaffe/kaffe/kaffevm/verifier/verify2.c	Sat Sep 22 17:36:14 2007
@@ -140,7 +140,7 @@
 	/* enforce access flag rules of the JVML spec. for abstract methods */
 	if (METHOD_IS_PRIVATE(method))           { return abstractMethodError(method, einfo, "private");      }
 	else if (METHOD_IS_FINAL(method))        { return abstractMethodError(method, einfo, "final");        }
-	else if (METHOD_IS_NATIVE(method))       { return abstractMethodError(method, einfo, "native");       }
+	else if (methodIsNative(method))       { return abstractMethodError(method, einfo, "native");       }
 	else if (METHOD_IS_STATIC(method))       { return abstractMethodError(method, einfo, "static");       }
 	else if (METHOD_IS_STRICT(method))       { return abstractMethodError(method, einfo, "strictfp");     }
 	
@@ -190,7 +190,7 @@
 		if (checkAbstractMethod(method, einfo) == false) {
 			return(false);
 		}
-	} else if (!METHOD_IS_NATIVE(method)) {
+	} else if (!methodIsNative(method)) {
 	        /* code length static constraints */
 		
 		if (METHOD_BYTECODE_LEN(method) == 0) {
Index: kaffe/kaffe/xprof/feedback.c
diff -u kaffe/kaffe/xprof/feedback.c:1.7 kaffe/kaffe/xprof/feedback.c:1.8
--- kaffe/kaffe/xprof/feedback.c:1.7	Sat Sep 22 17:00:13 2007
+++ kaffe/kaffe/xprof/feedback.c	Sat Sep 22 17:36:14 2007
@@ -156,7 +156,7 @@
 					if( (meth = findMethodLocal(cls,
 								    u8mname,
 								    u8sig)) &&
-					    !METHOD_IS_NATIVE(meth) )
+					    !methodIsNative(meth) )
 					{
 						if( translate(meth, &info) )
 						{




More information about the kaffe mailing list