[kaffe] CVS kaffe (robilad): Fixed compiler warning

Kaffe CVS cvs-commits at kaffe.org
Fri Sep 9 07:46:49 PDT 2005


PatchSet 6885 
Date: 2005/09/09 14:41:42
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Fixed compiler warning

2005-09-09  Dalibor Topic  <robilad at kaffe.org>

        * kaffe/kaffevm/classMethod.h (Hjava_lang_Class):
        Made total_interface_len unsigned to fix compiler warning.

        * kaffe/kaffevm/soft.c (instanceof_interface):
        Made i unsigned since it's used as an array subscript.
        Rewritten a loop to go from 0 to total_interface_len.

Members: 
	ChangeLog:1.4406->1.4407 
	kaffe/kaffevm/classMethod.h:1.85->1.86 
	kaffe/kaffevm/soft.c:1.79->1.80 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.4406 kaffe/ChangeLog:1.4407
--- kaffe/ChangeLog:1.4406	Fri Sep  9 13:53:32 2005
+++ kaffe/ChangeLog	Fri Sep  9 14:41:42 2005
@@ -1,5 +1,14 @@
 2005-09-09  Dalibor Topic  <robilad at kaffe.org>
 
+	* kaffe/kaffevm/classMethod.h (Hjava_lang_Class):
+	Made total_interface_len unsigned to fix compiler warning.
+
+	* kaffe/kaffevm/soft.c (instanceof_interface):
+	Made i unsigned since it's used as an array subscript.
+	Rewritten a loop to go from 0 to total_interface_len.
+
+2005-09-09  Dalibor Topic  <robilad at kaffe.org>
+
 	* kaffe/kaffevm/classMethod.c (processClass): 
 	Added missing cast to fix compiler warning.
 
Index: kaffe/kaffe/kaffevm/classMethod.h
diff -u kaffe/kaffe/kaffevm/classMethod.h:1.85 kaffe/kaffe/kaffevm/classMethod.h:1.86
--- kaffe/kaffe/kaffevm/classMethod.h:1.85	Sat Aug 20 23:44:53 2005
+++ kaffe/kaffe/kaffevm/classMethod.h	Fri Sep  9 14:41:45 2005
@@ -141,7 +141,7 @@
 	short*			if2itable;	/* redundant now */
 	void**			itable2dtable;
 	short			interface_len;
-	short			total_interface_len;
+	unsigned short		total_interface_len;
 	/* pointers to all itable2dtable entries of classes implementing this interface */
 	void***			implementors;	/* interfaces only */
         int			impl_index;    /* index of the class in the implementors array. */
Index: kaffe/kaffe/kaffevm/soft.c
diff -u kaffe/kaffe/kaffevm/soft.c:1.79 kaffe/kaffe/kaffevm/soft.c:1.80
--- kaffe/kaffe/kaffevm/soft.c:1.79	Tue Jul 19 16:27:35 2005
+++ kaffe/kaffe/kaffevm/soft.c	Fri Sep  9 14:41:45 2005
@@ -301,7 +301,7 @@
 jint
 instanceof_interface(Hjava_lang_Class* c, Hjava_lang_Class* oc)
 {
-	int i;
+	unsigned int i;
 	Hjava_lang_Class **impl_clazz;
 
 	if (oc->state < CSTATE_PREPARED || c->state < CSTATE_PREPARED || CLASS_IS_ARRAY(oc) || CLASS_IS_INTERFACE(oc))
@@ -310,7 +310,7 @@
 	     * prepared the dumb way is the only way. Arrays and interface do not have
 	     * any implementors too so we have to go through the all list.
 	     */
-	    for (i = oc->total_interface_len - 1; i >= 0; i--) {
+	    for (i = 0; i < oc->total_interface_len; i++) {
 	      if (c == oc->interfaces[i]) {
 		return 1;
 	      }




More information about the kaffe mailing list