[kaffe] CVS kaffe (guilhem): Fixed unused attribute. Marked some variables as being unused.

Kaffe CVS cvs-commits at kaffe.org
Thu Apr 1 08:29:02 PST 2004


PatchSet 4603 
Date: 2004/04/01 16:23:48
Author: guilhem
Branch: HEAD
Tag: (none) 
Log:
Fixed unused attribute. Marked some variables as being unused.

        * m4/gcc_attribute.m4: Really add the unused attribute.

        * config/config.h.in: Regenerated.

        * kaffe/kaffeh/support.c: Marked many variables as unused.
        Added some missing initializer. Removed an extra if.

        * kaffe/kaffevm/systems/unix-jthreads/jthread.h: Renamed "daemon" to
        "isDaemon".

Members: 
	ChangeLog:1.2180->1.2181 
	config/config.h.in:1.94->1.95 
	kaffe/kaffeh/support.c:1.40->1.41 
	kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.53->1.54 
	m4/gcc_attribute.m4:1.1->1.2 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2180 kaffe/ChangeLog:1.2181
--- kaffe/ChangeLog:1.2180	Wed Mar 31 19:22:27 2004
+++ kaffe/ChangeLog	Thu Apr  1 16:23:48 2004
@@ -1,3 +1,15 @@
+2004-04-01  Guilhem Lavaux <guilhem at kaffe.org>
+
+	* m4/gcc_attribute.m4: Really add the unused attribute.
+
+	* config/config.h.in: Regenerated.
+
+	* kaffe/kaffeh/support.c: Marked many variables as unused.
+	Added some missing initializer. Removed an extra if.
+
+	* kaffe/kaffevm/systems/unix-jthreads/jthread.h: Renamed "daemon" to
+	"isDaemon". 
+
 2004-03-31  Guilhem Lavaux <guilhem at kaffe.org>
 
 	* libraries/javalib/bootstrap.classlist: Added missing decoder
Index: kaffe/config/config.h.in
diff -u kaffe/config/config.h.in:1.94 kaffe/config/config.h.in:1.95
--- kaffe/config/config.h.in:1.94	Mon Mar 29 19:45:36 2004
+++ kaffe/config/config.h.in	Thu Apr  1 16:23:49 2004
@@ -798,7 +798,7 @@
 /* GNU C unused functions, or null. */
 #ifndef ATTRUNUSED
 #ifdef HAVE_GNUC25_UNUSED
-#define ATTRUNUSED
+#define ATTRUNUSED unused
 #else
 #define ATTRUNUSED
 #endif
Index: kaffe/kaffe/kaffeh/support.c
diff -u kaffe/kaffe/kaffeh/support.c:1.40 kaffe/kaffe/kaffeh/support.c:1.41
--- kaffe/kaffe/kaffeh/support.c:1.40	Mon Mar 29 21:08:30 2004
+++ kaffe/kaffe/kaffeh/support.c	Thu Apr  1 16:23:50 2004
@@ -118,6 +118,8 @@
         kfstat,
         kstat,
 
+	NULL,		/* truncate */
+	NULL,		/* fsync */
         NULL,		/* mkdir */
         NULL,		/* rmdir */
         NULL,		/* rename */
@@ -147,7 +149,7 @@
         NULL,           /* msync */
         NULL,           /* pipecreate */
         NULL,           /* piperead */
-        NULL,           /* pipewrite */
+        NULL            /* pipewrite */
 };
 
 
@@ -266,17 +268,17 @@
 
 
 bool
-addSourceFile(Hjava_lang_Class* c, int idx, errorInfo *einfo)
+addSourceFile(Hjava_lang_Class* c UNUSED, int idx UNUSED, errorInfo *einfo UNUSED)
 {
 	return true;
 }
 
 bool
-addInnerClasses(Hjava_lang_Class* c, uint32 len, classFile* fp,
-		errorInfo *einfo)
+addInnerClasses(Hjava_lang_Class* c UNUSED, uint32 len, classFile* fp,
+		errorInfo *einfo UNUSED)
 {
 	/* checkBufSize() done in caller. */
-			seekm(fp, len);
+        seekm(fp, len);
 	return true;
 }
 
@@ -381,7 +383,7 @@
 }
 
 int
-startFields(Hjava_lang_Class* this, u2 fct, errorInfo *einfo)
+startFields(Hjava_lang_Class* this, u2 fct, errorInfo *einfo UNUSED)
 {
 	this->fields = malloc(fct * sizeof(Field));
 	CLASS_NFIELDS(this) = 0; /* incremented by addField() */
@@ -391,7 +393,7 @@
 Field*
 addField(Hjava_lang_Class* this,
 	 u2 access_flags, u2 name_index, u2 signature_index,
-	 struct _errorInfo* einfo)
+	 struct _errorInfo* einfo UNUSED)
 {
 	Field* f;
 
@@ -443,7 +445,7 @@
 
 static void
 constValueToString(Hjava_lang_Class* this, u2 idx,
-		   char *cval, int cvalsize)
+		   char *cval, int cvalsize UNUSED)
 {
 	/* XXX use snprintf() */
 
@@ -509,7 +511,7 @@
 }
 
 void
-finishFields(Hjava_lang_Class* this)
+finishFields(Hjava_lang_Class* this UNUSED)
 {
 	if (include == NULL) {
 		return;
@@ -523,7 +525,8 @@
 }
 
 int
-startMethods(Hjava_lang_Class* this, u2 mct, errorInfo *einfo)
+startMethods(Hjava_lang_Class* this UNUSED, u2 mct UNUSED,
+	     errorInfo *einfo UNUSED)
 {
 	return true;
 }
@@ -611,13 +614,11 @@
 		} while (i != methodRing);
 	
 		/* if we didn't find a suitable place, add it at the end of the list */	
-		if (i == methodRing) {
-			  i->prev->next = list;
-			  list->prev = i->prev;
+		i->prev->next = list;
+		list->prev = i->prev;
 
-			  i->prev = list;
-			  list->next = i;
-		}
+		i->prev = list;
+		list->next = i;
 	}
 
 	return (Method*)1;
@@ -715,7 +716,7 @@
 }
 
 bool 
-addCode(Method* m, uint32 len, classFile* fp, errorInfo *einfo)
+addCode(Method* m, uint32 len, classFile* fp, errorInfo *einfo UNUSED)
 {
 	/* Don't try dereferencing m! */
 	assert(m == (Method*)1);
@@ -726,7 +727,7 @@
 }
 
 bool
-addLineNumbers(Method* m, uint32 len, classFile* fp, errorInfo *info)
+addLineNumbers(Method* m, uint32 len, classFile* fp, errorInfo *info UNUSED)
 {
 	/* Don't try dereferencing m! */
 	assert(m == (Method*)1);
@@ -737,7 +738,7 @@
 }
 
 bool
-addLocalVariables(Method* m, uint32 len, classFile* fp, errorInfo *info)
+addLocalVariables(Method* m, uint32 len, classFile* fp, errorInfo *info UNUSED)
 {
 	/* Don't try dereferencing m! */
 	assert(m == (Method*)1);
@@ -749,7 +750,7 @@
 
 bool
 addCheckedExceptions(Method* m, uint32 len, classFile* fp,
-		     errorInfo *info)
+		     errorInfo *info UNUSED)
 {
 	/* Don't try dereferencing m! */
 	assert(m == (Method*)1);
@@ -762,7 +763,7 @@
 
 Hjava_lang_Class*
 setupClass(Hjava_lang_Class* this, u2 thisidx, u2 super, u2 access_flags,
-	   struct Hjava_lang_ClassLoader* loader, struct _errorInfo* einfo)
+	   struct Hjava_lang_ClassLoader* loader, errorInfo* einfo UNUSED)
 {
 	utf8ConstAssign(this->name, CLASS_CONST_UTF8(this, thisidx));
 	this->accflags = access_flags;
@@ -791,7 +792,8 @@
 }
 
 void
-addInterfaces(Hjava_lang_Class* this, u2 icount, Hjava_lang_Class** ifaces)
+addInterfaces(Hjava_lang_Class* this UNUSED, u2 icount UNUSED, 
+	      Hjava_lang_Class** ifaces UNUSED)
 {
 }
 
Index: kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h
diff -u kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.53 kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.54
--- kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h:1.53	Mon Mar 29 21:39:16 2004
+++ kaffe/kaffe/kaffevm/systems/unix-jthreads/jthread.h	Thu Apr  1 16:23:50 2004
@@ -158,7 +158,7 @@
 jthread_t
 jthread_create(unsigned char pri, 	/* initial priority */
 	void (*func)(void *), 		/* start function */
-	int daemon, 			/* is this thread a daemon? */
+	int isDaemon, 			/* is this thread a daemon? */
 	void *jlThread, 		/* cookie for this thread */
 	size_t threadStackSize);	/* stack size to be allocated */
 
@@ -349,7 +349,7 @@
 int jthread_has_run(jthread_t jt);
 
 static inline
-bool jthread_attach_current_thread(bool daemon)
+bool jthread_attach_current_thread(bool isDaemon)
 {
 	return false;
 }
Index: kaffe/m4/gcc_attribute.m4
diff -u kaffe/m4/gcc_attribute.m4:1.1 kaffe/m4/gcc_attribute.m4:1.2
--- kaffe/m4/gcc_attribute.m4:1.1	Mon Mar 29 19:46:21 2004
+++ kaffe/m4/gcc_attribute.m4	Thu Apr  1 16:23:51 2004
@@ -73,7 +73,7 @@
  AH_BOTTOM([/* GNU C unused functions, or null. */
 #ifndef ATTRUNUSED
 #ifdef HAVE_GNUC25_UNUSED
-#define ATTRUNUSED
+#define ATTRUNUSED unused
 #else
 #define ATTRUNUSED
 #endif




More information about the kaffe mailing list