[kaffe] CVS kaffe (robilad): Further const cleanups

Kaffe CVS cvs-commits at kaffe.org
Sat Nov 6 12:12:40 PST 2004


PatchSet 5407 
Date: 2004/11/06 20:02:04
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Further const cleanups

2004-11-06  Eric Anholt  <eta at lclark.edu>

        * kaffe/kaffevm/access.c,
        kaffe/kaffevm/soft.c,
        replace/getaddrinfo.c:
        Const cleanups to shut the compiler up some more.

Members: 
	ChangeLog:1.2956->1.2957 
	kaffe/kaffevm/access.c:1.7->1.8 
	kaffe/kaffevm/soft.c:1.66->1.67 
	replace/getaddrinfo.c:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.2956 kaffe/ChangeLog:1.2957
--- kaffe/ChangeLog:1.2956	Sat Nov  6 16:23:08 2004
+++ kaffe/ChangeLog	Sat Nov  6 20:02:04 2004
@@ -1,5 +1,12 @@
 2004-11-06  Eric Anholt  <eta at lclark.edu>
 
+	* kaffe/kaffevm/access.c,
+	kaffe/kaffevm/soft.c,
+	replace/getaddrinfo.c:
+	Const cleanups to shut the compiler up some more.
+
+2004-11-06  Eric Anholt  <eta at lclark.edu>
+
 	* test/regression/Preempt.java:
 	Increased the timeout to make test pass on amd64-freebsd.
 
Index: kaffe/kaffe/kaffevm/access.c
diff -u kaffe/kaffe/kaffevm/access.c:1.7 kaffe/kaffe/kaffevm/access.c:1.8
--- kaffe/kaffe/kaffevm/access.c:1.7	Sun Jul 11 18:09:08 2004
+++ kaffe/kaffe/kaffevm/access.c	Sat Nov  6 20:02:07 2004
@@ -26,7 +26,7 @@
 
 char *checkAccessFlags(access_type_t type, accessFlags access_flags)
 {
-	char *retval = 0;
+	const char *retval = 0;
 
 	if( (type == ACC_TYPE_CLASS) &&
 	    (access_flags & ACC_INTERFACE) &&
Index: kaffe/kaffe/kaffevm/soft.c
diff -u kaffe/kaffe/kaffevm/soft.c:1.66 kaffe/kaffe/kaffevm/soft.c:1.67
--- kaffe/kaffe/kaffevm/soft.c:1.66	Thu Aug 19 19:29:02 2004
+++ kaffe/kaffe/kaffevm/soft.c	Sat Nov  6 20:02:07 2004
@@ -236,7 +236,6 @@
 soft_lookupinterfacemethod(Hjava_lang_Object* obj, Hjava_lang_Class* ifclass, int idx)
 {
 	Hjava_lang_Class* cls;
-	Method* meth;
 	void*	ncode;
 	register int i;
 	register short* implementors;
@@ -401,12 +400,12 @@
 		if (c->loader != OBJECT_CLASS(o)->loader) {
 			const char *toloader = c->loader?CLASS_CNAME(OBJECT_CLASS((Hjava_lang_Object *)c->loader)):"bootstrap";
 			const char *fromloader = OBJECT_CLASS(o)->loader?CLASS_CNAME(OBJECT_CLASS((Hjava_lang_Object *)OBJECT_CLASS(o)->loader)):"bootstrap";
-			char *format = "can't cast `%s' (%s@%p) to `%s' (%s@%p)";
+			const char *format = "can't cast `%s' (%s@%p) to `%s' (%s@%p)";
 			buf = checkPtr(KMALLOC(strlen(fromtype) + 12 + strlen(fromloader)+
 				+ strlen(totype) + 12 + strlen(toloader) + strlen(format)));
 			sprintf(buf, format, fromtype, fromloader, OBJECT_CLASS(o)->loader, totype, toloader, c->loader);
 		} else {
-			char* format = "can't cast `%s' to `%s'";
+			const char* format = "can't cast `%s' to `%s'";
 			buf = checkPtr(KMALLOC(strlen(fromtype)+strlen(totype)+strlen(format)));
 			sprintf(buf, format, fromtype, totype);
 		}
Index: kaffe/replace/getaddrinfo.c
diff -u kaffe/replace/getaddrinfo.c:1.4 kaffe/replace/getaddrinfo.c:1.5
--- kaffe/replace/getaddrinfo.c:1.4	Wed Jun 30 19:37:31 2004
+++ kaffe/replace/getaddrinfo.c	Sat Nov  6 20:02:08 2004
@@ -144,7 +144,7 @@
 /*
  * Error messages for gai_strerror().
  */
-static char *eai_errlist[] = {
+static const char *eai_errlist[] = {
     N_("Success"),
 
     /* EAI_ADDRFAMILY */
@@ -269,7 +269,7 @@
 is_address(s)
     const char *s;
 {
-    const static char delimiters[] = {'.', '.', '.', '\0'};
+    static const char delimiters[] = {'.', '.', '.', '\0'};
     int i, j;
     int octet;
 
@@ -559,7 +559,7 @@
 	if (flags & NI_NUMERICHOST)
 	    hostent = NULL;
 	else {
-	    hostent = gethostbyaddr((char *)&sa_in->sin_addr, 
+	    hostent = gethostbyaddr((const char *)&sa_in->sin_addr, 
 		sizeof(struct in_addr), AF_INET);
 	}
 	if (hostent != NULL) {




More information about the kaffe mailing list