[kaffe] CVS kaffe (doogie): Sparse NULL-constant fixes.

Kaffe CVS cvs-commits at kaffe.org
Sun Dec 19 14:17:17 PST 2004


PatchSet 5666 
Date: 2004/12/19 22:13:05
Author: doogie
Branch: HEAD
Tag: (none) 
Log:
Sparse NULL-constant fixes.

Members: 
	ChangeLog:1.3211->1.3212 
	include/errors.h:1.15->1.16 
	kaffe/kaffevm/external.c:1.71->1.72 
	kaffe/kaffevm/findInJar.c:1.61->1.62 
	kaffe/kaffevm/gcFuncs.c:1.59->1.60 
	kaffe/kaffevm/hashtab.c:1.13->1.14 
	kaffe/kaffevm/inflate.c:1.13->1.14 
	kaffe/kaffevm/itypes.c:1.32->1.33 
	kaffe/kaffevm/jar.c:1.32->1.33 
	kaffe/kaffevm/kaffe.def:1.34->1.35 
	kaffe/kaffevm/jit/methodcalls.c:1.3->1.4 
	kaffe/kaffevm/jit/native-wrapper.c:1.2->1.3 
	kaffe/kaffevm/jit3/funcs.c:1.13->1.14 
	kaffe/kaffevm/jit3/labels.c:1.15->1.16 
	kaffe/kaffevm/jit3/machine.c:1.61->1.62 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3211 kaffe/ChangeLog:1.3212
--- kaffe/ChangeLog:1.3211	Sun Dec 19 22:03:39 2004
+++ kaffe/ChangeLog	Sun Dec 19 22:13:05 2004
@@ -1,5 +1,15 @@
 2004-12-19  Adam Heath  <doogie at brainfood.com>
 
+	* include/errors.h, kaffe/kaffevm/external.c, kaffe/kaffevm/findInJar.c,
+	  kaffe/kaffevm/gcFuncs.c, kaffe/kaffevm/hashtab.c,
+	  kaffe/kaffevm/inflate.c, kaffe/kaffevm/itypes.c, kaffe/kaffevm/jar.c,
+	  kaffe/kaffevm/kaffe.def, kaffe/kaffevm/jit/methodcalls.c,
+	  kaffe/kaffevm/jit/native-wrapper.c, kaffe/kaffevm/jit3/funcs.c,
+	  kaffe/kaffevm/jit3/labels.c, kaffe/kaffevm/jit3/machine.c:
+	  Sparse NULL-constant fixes.
+
+2004-12-19  Adam Heath  <doogie at brainfood.com>
+
 	* kaffe/kaffevm/kaffe-gc/gc-incremental.c:
 	  Few more gcc warning fixes.
 
Index: kaffe/include/errors.h
diff -u kaffe/include/errors.h:1.15 kaffe/include/errors.h:1.16
--- kaffe/include/errors.h:1.15	Sun Nov 14 13:52:05 2004
+++ kaffe/include/errors.h	Sun Dec 19 22:13:08 2004
@@ -73,19 +73,19 @@
 
 #define NEW_LANG_EXCEPTION(NAME) \
   ((struct Hjava_lang_Throwable*)execute_java_constructor("java.lang." #NAME, \
-	0, 0, "()V"))
+	NULL, NULL, "()V"))
 
 #define NEW_LANG_EXCEPTION_MESSAGE(NAME, MESS) \
   ((struct Hjava_lang_Throwable*)execute_java_constructor("java.lang." #NAME, \
-	0, 0, "(Ljava/lang/String;)V", stringC2Java(MESS)))
+	NULL, NULL, "(Ljava/lang/String;)V", stringC2Java(MESS)))
 
 #define NEW_IO_EXCEPTION(NAME) \
   ((struct Hjava_lang_Throwable*)execute_java_constructor("java.io." #NAME, \
-	0, 0, "()V"))
+	NULL, NULL, "()V"))
 
 #define NEW_IO_EXCEPTION_MESSAGE(NAME, MESS) \
   ((struct Hjava_lang_Throwable*)*/execute_java_constructor("java.io." #NAME, \
-	0, 0, "(Ljava/lang/String;)V", stringC2Java(MESS)))
+	NULL, NULL, "(Ljava/lang/String;)V", stringC2Java(MESS)))
 
 #define NoClassDefFoundError(M) NEW_LANG_EXCEPTION_MESSAGE(NoClassDefFoundError, M)
 #define NoSuchMethodError(M) NEW_LANG_EXCEPTION_MESSAGE(NoSuchMethodError, M)
Index: kaffe/kaffe/kaffevm/external.c
diff -u kaffe/kaffe/kaffevm/external.c:1.71 kaffe/kaffe/kaffevm/external.c:1.72
--- kaffe/kaffe/kaffevm/external.c:1.71	Sun Dec 19 06:25:08 2004
+++ kaffe/kaffe/kaffevm/external.c	Sun Dec 19 22:13:07 2004
@@ -381,7 +381,7 @@
 		KaffeLib_Unload(lib->desc);
 		unblockAsyncSignals();
 		KFREE(lib->name);
-		lib->desc = 0;
+		lib->desc = NULL;
 	}
 }
 
Index: kaffe/kaffe/kaffevm/findInJar.c
diff -u kaffe/kaffe/kaffevm/findInJar.c:1.61 kaffe/kaffe/kaffevm/findInJar.c:1.62
--- kaffe/kaffe/kaffevm/findInJar.c:1.61	Sun Dec 19 06:25:08 2004
+++ kaffe/kaffe/kaffevm/findInJar.c	Sun Dec 19 22:13:07 2004
@@ -82,7 +82,7 @@
 	char *buf;
 	classFile hand;
 	const char* cname;
-	Hjava_lang_Class* class = 0;
+	Hjava_lang_Class* class = NULL;
 
 	cname = centry->name->data;
 
@@ -127,7 +127,7 @@
 				     JAVA_LANG(ClassNotFoundException),
 				     "%s",
 				     centry->name->data);
-		return (0);
+		return (NULL);
 	}
 
 	switch (hand.type) {
@@ -137,7 +137,7 @@
 		if (class == 0) {
 			postOutOfMemory(einfo);
 			KFREE(hand.base);
-			return (0);
+			return (NULL);
 		}
 
 		utf8ConstAssign(class->name, centry->name);
@@ -169,7 +169,7 @@
 		dprintf("Cannot find essential class '%s' in class library ... aborting.\n", cname);
 		ABORT();
 	}
-	return (0);
+	return (NULL);
 }
 
 /*
@@ -519,7 +519,7 @@
 	if (*cp == '\0')
 		return (0);
 
-	lptr = 0;
+	lptr = NULL;
 	for (ptr = classpath; ptr != 0; ptr = ptr->next) {
 		if (strcmp(ptr->path, cp) == 0) {
 			/* Already in */
@@ -543,7 +543,7 @@
 		classpath = ptr;
 	}
 	else {
-		ptr->next = 0;
+		ptr->next = NULL;
 		lptr->next = ptr;
 	}
 	return(1);
@@ -621,12 +621,12 @@
 	/* Locate manifest entry in jar */
 	mf = lookupJarFile(file, "META-INF/MANIFEST.MF");
 	if (mf == 0)
-		return (0);
+		return (NULL);
 
 	/* Read it */
 	mfdata = getDataJarFile(file, mf);
 	if (mfdata == 0)
-		return (0);
+		return (NULL);
 
 	/* Look for the desired entry */
 	attrEntry = mfdata;
@@ -661,7 +661,7 @@
 		}
 	}
 	KFREE(mfdata);
-	return (0);
+	return (NULL);
 }
 
 
@@ -704,7 +704,7 @@
 		/* Insert manifest classpath entries */
 
 		newEntry = KMALLOC(sizeof(classpathEntry));
-		newEntry->u.jar = 0;
+		newEntry->u.jar = NULL;
 
 		/* Manifest classpath entries can be either absolute or
 		   relative to the location of the jar file. */
@@ -798,5 +798,5 @@
    }
 #endif
    
-   return 0;
+   return NULL;
 }
Index: kaffe/kaffe/kaffevm/gcFuncs.c
diff -u kaffe/kaffe/kaffevm/gcFuncs.c:1.59 kaffe/kaffe/kaffevm/gcFuncs.c:1.60
--- kaffe/kaffe/kaffevm/gcFuncs.c:1.59	Sun Dec 19 06:25:08 2004
+++ kaffe/kaffe/kaffevm/gcFuncs.c	Sun Dec 19 22:13:07 2004
@@ -109,7 +109,7 @@
         if (!CLASS_IS_ARRAY(clazz) && CLASS_METHODS(clazz) != 0) {
                 Method *m = CLASS_METHODS(clazz);
                 for (i = 0; i < CLASS_NMETHODS(clazz); i++) {
-			void *ncode = 0;
+			void *ncode = NULL;
 
 			if (!CLASS_IS_INTERFACE(clazz))
 			{
@@ -547,7 +547,7 @@
 		str = (Hjava_lang_String*)mem;
 		strcpy(buf, "java.lang.String `");
 		c = buf + strlen(buf);
-		jc = unhand(str)->value ? STRING_DATA(str) : 0;
+		jc = unhand(str)->value ? STRING_DATA(str) : NULL;
 		l = STRING_SIZE(str);
 		while (jc && l-- > 0 && c < buf + sizeof(buf) - 2) {
 			*c++ = (char)*jc++;
@@ -595,22 +595,22 @@
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_JAVASTRING,
 	    stringWalk, KGC_OBJECT_NORMAL, stringDestroy, "j.l.String");
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_NOWALK,
-	    0, KGC_OBJECT_NORMAL, 0, "other-nowalk");
+	    NULL, KGC_OBJECT_NORMAL, NULL, "other-nowalk");
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_NORMALOBJECT,
-	    walkObject, KGC_OBJECT_NORMAL, 0, "obj-no-final");
+	    walkObject, KGC_OBJECT_NORMAL, NULL, "obj-no-final");
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_PRIMARRAY,
-	    0, KGC_OBJECT_NORMAL, 0, "prim-arrays");
+	    NULL, KGC_OBJECT_NORMAL, NULL, "prim-arrays");
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_REFARRAY,
-	    walkRefArray, KGC_OBJECT_NORMAL, 0, "ref-arrays");
+	    walkRefArray, KGC_OBJECT_NORMAL, NULL, "ref-arrays");
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_CLASSOBJECT,
 	    walkClass, KGC_OBJECT_NORMAL, destroyClass, "j.l.Class");
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_FINALIZEOBJECT,
-	    walkObject, finalizeObject, 0, "obj-final");
+	    walkObject, finalizeObject, NULL, "obj-final");
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_JAVALOADER,
 	    walkLoader, finalizeObject, destroyClassLoader,
 	    "j.l.ClassLoader");
 	KGC_registerGcTypeByIndex(gc, KGC_ALLOC_THREADCTX, 
-	    0, KGC_OBJECT_NORMAL, 0, "thread-ctxts");
+	    NULL, KGC_OBJECT_NORMAL, NULL, "thread-ctxts");
 
 	KGC_registerFixedTypeByIndex(gc, KGC_ALLOC_STATIC_THREADDATA, "thread-data");
 	KGC_registerFixedTypeByIndex(gc, KGC_ALLOC_BYTECODE, "java-bytecode");
Index: kaffe/kaffe/kaffevm/hashtab.c
diff -u kaffe/kaffe/kaffevm/hashtab.c:1.13 kaffe/kaffe/kaffevm/hashtab.c:1.14
--- kaffe/kaffe/kaffevm/hashtab.c:1.13	Sat Dec 11 07:00:50 2004
+++ kaffe/kaffe/kaffevm/hashtab.c	Sun Dec 19 22:13:07 2004
@@ -59,7 +59,7 @@
 		tab = alloc(sizeof(*tab));
 	}
 	if (tab == 0) {
-		return (0);
+		return (NULL);
 	}
 	tab->hash = hash;
 	tab->comp = comp;
@@ -108,7 +108,7 @@
 	if (NEED_RESIZE(tab)) {
 		if (hashResize(tab) == 0) {
 			/* XXX OutOfMemoryError? */
-			return (0);
+			return (NULL);
 		}
 	}
 	i = hashFindSlot(tab, ptr);
@@ -237,7 +237,7 @@
 	}
 
 	if (newList == NULL) {
-		return (0);
+		return (NULL);
 	}
 
 	/* Rehash old list contents into new list */
Index: kaffe/kaffe/kaffevm/inflate.c
diff -u kaffe/kaffe/kaffevm/inflate.c:1.13 kaffe/kaffe/kaffevm/inflate.c:1.14
--- kaffe/kaffe/kaffevm/inflate.c:1.13	Sat Jul 17 07:57:13 2004
+++ kaffe/kaffe/kaffevm/inflate.c	Sun Dec 19 22:13:07 2004
@@ -287,7 +287,7 @@
     if ((i = huft_build(pG, l, 288, 257, cplens, cplext,
                         &pG->fixed_tl, &pG->fixed_bl)) != 0)
     {
-      pG->fixed_tl = 0;
+      pG->fixed_tl = NULL;
       return i;
     }
 
@@ -299,7 +299,7 @@
                         &pG->fixed_td, &pG->fixed_bd)) > 1)
     {
       huft_free(pG->fixed_tl);
-      pG->fixed_tl = 0;
+      pG->fixed_tl = NULL;
       return i;
     }
   }
@@ -363,7 +363,7 @@
 
   /* build decoding table for trees--single level, 7 bit lookup */
   bl = 7;
-  i = huft_build(pG, ll, 19, 19, 0, 0, &tl, &bl);
+  i = huft_build(pG, ll, 19, 19, NULL, NULL, &tl, &bl);
   if (bl == 0)                        /* no bit lengths */
     i = 1;
   if (i)
@@ -526,16 +526,16 @@
 
 	info = gc_malloc(sizeof(inflateInfo), KGC_ALLOC_FIXED);
 	if (!info) {
-		return 0;
+		return NULL;
 	}
-	info->fixed_tl = 0;
-	info->fixed_td = 0;
+	info->fixed_tl = NULL;
+	info->fixed_td = NULL;
 	info->fixed_bl = 0;
 	info->fixed_bd = 0;
 	info->slide = gc_malloc(WSIZE, KGC_ALLOC_FIXED);
 	if (!info->slide){
 		gc_free(info);
-		return 0;
+		return NULL;
 	}
 
 	return (info);
@@ -614,7 +614,7 @@
     if (pG->fixed_tl != 0) {
       huft_free(pG->fixed_td);
       huft_free(pG->fixed_tl);
-      pG->fixed_td = pG->fixed_tl = 0;
+      pG->fixed_td = pG->fixed_tl = NULL;
     }
     gc_free(pG->slide);
     gc_free(pG);
@@ -664,7 +664,7 @@
   } while (--i);
   if (c[0] == n)                /* null input--all zero length codes */
   {
-    *t = 0;
+    *t = NULL;
     *m = 0;
     return 0;
   }
@@ -717,8 +717,8 @@
   p = v;                        /* grab values in bit order */
   h = -1;                       /* no tables yet--level -1 */
   w = l[-1] = 0;                /* no bits decoded yet */
-  u[0] = 0;   /* just to keep compilers happy */
-  q = 0;      /* ditto */
+  u[0] = NULL;   /* just to keep compilers happy */
+  q = NULL;      /* ditto */
   z = 0;                        /* ditto */
 
   /* go through the bit lengths (k already is bits in shortest code) */
@@ -761,7 +761,7 @@
         }
         pG->hufts += z + 1;         /* track memory usage */
         *t = q + 1;             /* link to list for huft_free() */
-        *(t = &(q->v.t)) = 0;
+        *(t = &(q->v.t)) = NULL;
         u[h] = ++q;             /* table starts after link */
 
         /* connect to last table, if there is one */
Index: kaffe/kaffe/kaffevm/itypes.c
diff -u kaffe/kaffe/kaffevm/itypes.c:1.32 kaffe/kaffe/kaffevm/itypes.c:1.33
--- kaffe/kaffe/kaffevm/itypes.c:1.32	Sun Dec 19 06:25:08 2004
+++ kaffe/kaffe/kaffevm/itypes.c	Sun Dec 19 22:13:07 2004
@@ -72,7 +72,7 @@
 	assert(strlen(name) <= 8);
 	sprintf(entryName, ";%s", name);
 	uname = utf8ConstNew(entryName, -1);
-	centry = lookupClassEntry(uname, 0, &info);
+	centry = lookupClassEntry(uname, NULL, &info);
 	utf8ConstRelease(uname);
 
 	if (centry == 0) {
@@ -183,7 +183,7 @@
 		utf8 = utf8ConstNew(start, end - start);
 		if (!utf8) {
 			postOutOfMemory(einfo);
-			return (0);
+			return (NULL);
 		}
 		cl = loadClass(utf8, loader, einfo);
 		utf8ConstRelease(utf8);
@@ -209,7 +209,7 @@
 	Hjava_lang_Class *cls = classFromSig(&sig, loader, einfo);
 
 	/* name must consume all characters in string */
-	if (cls != 0 && *sig == 0) {
+	if (cls != NULL && *sig == NULL) {
 		return (cls);
 	}
 	/* 
@@ -218,7 +218,7 @@
 	 * Class.forName()
 	 */
 	postExceptionMessage(einfo, JAVA_LANG(NoClassDefFoundError), "%s", sig0);
-	return (0);
+	return (NULL);
 }
 
 /*
Index: kaffe/kaffe/kaffevm/jar.c
diff -u kaffe/kaffe/kaffevm/jar.c:1.32 kaffe/kaffe/kaffevm/jar.c:1.33
--- kaffe/kaffe/kaffevm/jar.c:1.32	Tue Oct 12 05:20:04 2004
+++ kaffe/kaffe/kaffevm/jar.c	Sun Dec 19 22:13:07 2004
@@ -105,12 +105,12 @@
  */
 static jarFile *findJarFile(char *name)
 {
-	jarFile *curr, **prev, *retval = 0;
+	jarFile *curr, **prev, *retval = NULL;
 #if !defined(KAFFEH)
 	int iLockRoot;
 #endif
 
-	assert(name != 0);
+	assert(name != NULL);
 	
 	lockStaticMutex(&jarCache.lock);
 	curr = jarCache.files;
@@ -118,7 +118,7 @@
 	while( curr && !retval )
 	{
 		assert(curr != NULL);
-		assert(curr->fileName != 0);
+		assert(curr->fileName != NULL);
 		
 		if( !strcmp(curr->fileName, name) )
 		{
@@ -153,7 +153,7 @@
 		addToCounter(&jarmem, "vmmem-jar files",
 			     1, -(jlong)GCSIZEOF(jf->table));
 		gc_free(jf->table);
-		jf->table = 0;
+		jf->table = NULL;
 	}
 }
 
@@ -162,7 +162,7 @@
  */
 static void collectJarFile(jarFile *jf)
 {
-	assert(jf != 0);
+	assert(jf != NULL);
 	assert(jf->users == 0);
 	assert(!(jf->flags & JFF_CACHED));
 	
@@ -197,7 +197,7 @@
  */
 static jarFile *cacheJarFile(jarFile *jf)
 {
-	jarFile *curr, **prev, **lru = 0, *dead_jar = 0, *retval = jf;
+	jarFile *curr, **prev, **lru = NULL, *dead_jar = NULL, *retval = jf;
 	int already_cached = 0;
 #if !defined(KAFFEH)
 	int iLockRoot;
@@ -323,7 +323,7 @@
 	int iLockRoot;
 #endif
 
-	assert(jf != 0);
+	assert(jf != NULL);
 
 	/* Make sure its actually in the cache. */
 	if( jf->flags & JFF_CACHED )
@@ -335,14 +335,14 @@
 			/* Find `jf' on the list and... */
 			while( curr != jf )
 			{
-				assert(curr != 0);
+				assert(curr != NULL);
 				
 				prev = &curr->next;
 				curr = curr->next;
 			}
 			/* unlink it */
 			*prev = curr->next;
-			jf->next = 0;
+			jf->next = NULL;
 			jf->flags &= ~JFF_CACHED;
 			jarCache.count--;
 		}
@@ -712,7 +712,7 @@
 
 		/* Instantiate the header */
 		jarInstantiate(jf, (uint8 *)&cdr, instantiateCentralDir);
-		je->next = 0;
+		je->next = NULL;
 		/* Allocate space for our name */
 		(*name_strings) -= cdr.fileNameLength + 1;
 		je->fileName = *name_strings;
@@ -727,7 +727,7 @@
 		if( (read_size = jarRead(jf,
 					 (uint8*) je->fileName,
 					 cdr.fileNameLength,
-					 0)) >= 0 )
+					 NULL)) >= 0 )
 		{
 			/* Make sure its terminated */
 			je->fileName[cdr.fileNameLength] = 0;
@@ -885,12 +885,12 @@
 static uint8 *inflateJarData(jarFile *jf, jarEntry *je,
 			     jarLocalHeader *lh, uint8 *buf)
 {
-	uint8 *retval = 0;
+	uint8 *retval = NULL;
 
-	assert(jf != 0);
-	assert(je != 0);
-	assert(lh != 0);
-	assert(buf != 0);
+	assert(jf != NULL);
+	assert(je != NULL);
+	assert(lh != NULL);
+	assert(buf != NULL);
 	
 	switch( je->compressionMethod )
 	{
@@ -919,7 +919,7 @@
 			{
 				jf->error = JAR_ERROR_DECOMPRESSION_FAILED;
 				gc_free(retval);
-				retval = 0;
+				retval = NULL;
 			}
 		}
 		else
@@ -938,7 +938,7 @@
 
 uint8 *getDataJarFile(jarFile *jf, jarEntry *je)
 {
-	uint8 *buf = 0, *retval = 0;
+	uint8 *buf = NULL, *retval = NULL;
 	jarLocalHeader lh;
 #if !defined(KAFFEH)
 	int iLockRoot;
@@ -963,10 +963,10 @@
 		if( (buf = (uint8 *)gc_malloc(je->compressedSize,
 					      KGC_ALLOC_JAR)) )
 		{
-			if( jarRead(jf, buf, je->compressedSize, 0) < 0 )
+			if( jarRead(jf, buf, je->compressedSize, NULL) < 0 )
 			{
 				gc_free(buf);
-				buf = 0;
+				buf = NULL;
 				jf->error = JAR_ERROR_IO;
 			}
 		}
@@ -991,10 +991,10 @@
  */
 static jarFile *delayedOpenJarFile(jarFile *jf)
 {
-	jarFile *retval = 0;
+	jarFile *retval = NULL;
 	int fd, rc;
 
-	assert(jf != 0);
+	assert(jf != NULL);
 
 	/* Open the file and check for a different modified time */
 	if( !(rc = KOPEN(jf->fileName, O_RDONLY|O_BINARY, 0, &fd)) )
@@ -1049,9 +1049,9 @@
 
 jarFile *openJarFile(char *name)
 {
-	jarFile *retval = 0;
+	jarFile *retval = NULL;
 
-	assert(name != 0);
+	assert(name != NULL);
 	
 	/* Look for it in the cache first */
 	if( (retval = findJarFile(name)) )
@@ -1083,9 +1083,9 @@
 		retval->users = 1;
 		retval->lastModified = 0;
 		retval->count = 0;
-		retval->error = 0;
+		retval->error = NULL;
 		retval->fd = -1;
-		retval->table = 0;
+		retval->table = NULL;
 		retval->tableSize = 0;
 #ifdef HAVE_MMAP
  		retval->data = MAP_FAILED;
@@ -1174,7 +1174,7 @@
 			/* Something went wrong, cleanup our mess */
 			retval->users = 0;
 			collectJarFile(retval);
-			retval = 0;
+			retval = NULL;
 		}
 	}
 
@@ -1236,7 +1236,7 @@
 
 jarEntry *lookupJarFile(jarFile *jf, char *entry_name)
 {
-	jarEntry *retval = 0;
+	jarEntry *retval = NULL;
 
 	assert(jf != 0);
 	assert(entry_name != 0);
Index: kaffe/kaffe/kaffevm/kaffe.def
diff -u kaffe/kaffe/kaffevm/kaffe.def:1.34 kaffe/kaffe/kaffevm/kaffe.def:1.35
--- kaffe/kaffe/kaffevm/kaffe.def:1.34	Thu Aug 19 19:29:02 2004
+++ kaffe/kaffe/kaffevm/kaffe.def	Sun Dec 19 22:13:07 2004
@@ -27,7 +27,7 @@
 	trace_jcode (("aconst 0\n"));
 
 	push(1);
-	move_ref_const(stack(0), 0);
+	move_ref_const(stack(0), NULL);
 }
 
 define_insn(ICONST_M1)
@@ -2725,7 +2725,7 @@
 		}
 #ifdef TRANSLATOR
 		else {
-			tmp = 0;	/* for compiler warning */
+			tmp = NULL;	/* for compiler warning */
 		}
 #endif
 
@@ -2941,7 +2941,7 @@
 		else
 		{
 			/* Push arguments */
-			build_call_frame(method_sig(), 0, idx);
+			build_call_frame(method_sig(), NULL, idx);
 			
 			pop(idx);
 			begin_func_sync();
@@ -3405,7 +3405,7 @@
 	slot_nowriteback(stack(0));
 	begin_sync();
 
-	cbranch_ref_const_eq(rstack(0), 0, reference_code_label(pc+idx));
+	cbranch_ref_const_eq(rstack(0), NULL, reference_code_label(pc+idx));
 	pop(1);
 
 	end_sync();
@@ -3423,7 +3423,7 @@
 
 	begin_sync();
 
-	cbranch_ref_const_ne(rstack(0), 0, reference_code_label(pc+idx));
+	cbranch_ref_const_ne(rstack(0), NULL, reference_code_label(pc+idx));
 	pop(1);
 
 	end_sync();
Index: kaffe/kaffe/kaffevm/jit/methodcalls.c
diff -u kaffe/kaffe/kaffevm/jit/methodcalls.c:1.3 kaffe/kaffe/kaffevm/jit/methodcalls.c:1.4
--- kaffe/kaffe/kaffevm/jit/methodcalls.c:1.3	Fri Aug 27 12:22:05 2004
+++ kaffe/kaffe/kaffevm/jit/methodcalls.c	Sun Dec 19 22:13:08 2004
@@ -162,7 +162,7 @@
 		tramp = (methodTrampoline*)gc_malloc(sizeof(methodTrampoline), KGC_ALLOC_TRAMPOLINE);
 		if (tramp == 0) {
 			postOutOfMemory(einfo);
-			return (0);
+			return (NULL);
 		}
 		FILL_IN_TRAMPOLINE(tramp, meth, where);
 
Index: kaffe/kaffe/kaffevm/jit/native-wrapper.c
diff -u kaffe/kaffe/kaffevm/jit/native-wrapper.c:1.2 kaffe/kaffe/kaffevm/jit/native-wrapper.c:1.3
--- kaffe/kaffe/kaffevm/jit/native-wrapper.c:1.2	Mon Jul  5 16:40:43 2004
+++ kaffe/kaffe/kaffevm/jit/native-wrapper.c	Sun Dec 19 22:13:08 2004
@@ -41,7 +41,7 @@
 	thread_data->jnireferences = table;
 #endif
 	/* No pending exception when we enter JNI routine */
-	thread_data->exceptObj = 0;
+	thread_data->exceptObj = NULL;
 	return( &thread_data->jniEnv ); 
 }
 
@@ -62,7 +62,7 @@
 	/* If we have a pending exception, throw it */
 	eobj = thread_data->exceptObj;
 	if (eobj != 0) {
-		thread_data->exceptObj = 0;
+		thread_data->exceptObj = NULL;
 		throwExternalException(eobj);
 	}
 }
@@ -77,7 +77,7 @@
 	errorInfo info;
 	int count;
 	nativeCodeInfo ncode;
-	SlotInfo* tmp = 0;
+	SlotInfo* tmp = NULL;
 	bool success = true;
 	int j;
 	int an;
@@ -397,13 +397,13 @@
 	 * only needed if we have labels referring to bytecode.  This is
 	 * not the case here.
 	 */
-	success = finishInsnSequence(0, &ncode, &info);
+	success = finishInsnSequence(NULL, &ncode, &info);
 	if (!success) {
 		goto done;
 	}
 
 	assert(xmeth->exception_table == 0);
-	installMethodCode(0, xmeth, &ncode);
+	installMethodCode(NULL, xmeth, &ncode);
 
 	if (use_JNI)
 		xmeth->accflags |= ACC_JNI;
@@ -420,7 +420,7 @@
 		xmeth->jitClicks = end - xmeth->jitClicks;
 	}
 #endif
-	globalMethod = 0;
+	globalMethod = NULL;
 
 	leaveTranslator();
 #if defined(KAFFE_FEEDBACK)
Index: kaffe/kaffe/kaffevm/jit3/funcs.c
diff -u kaffe/kaffe/kaffevm/jit3/funcs.c:1.13 kaffe/kaffe/kaffevm/jit3/funcs.c:1.14
--- kaffe/kaffe/kaffevm/jit3/funcs.c:1.13	Sun Jul 11 19:03:04 2004
+++ kaffe/kaffe/kaffevm/jit3/funcs.c	Sun Dec 19 22:13:08 2004
@@ -42,7 +42,7 @@
 static
 void printCodeLabels(void)
 {
-	label *il, *curr = 0;
+	label *il, *curr = NULL;
 
 	while( (il = getInternalLabel(&curr, CODEPC)) )
 	{
Index: kaffe/kaffe/kaffevm/jit3/labels.c
diff -u kaffe/kaffe/kaffevm/jit3/labels.c:1.15 kaffe/kaffe/kaffevm/jit3/labels.c:1.16
--- kaffe/kaffe/kaffevm/jit3/labels.c:1.15	Sat Dec 11 07:00:51 2004
+++ kaffe/kaffe/kaffevm/jit3/labels.c	Sun Dec 19 22:13:08 2004
@@ -88,7 +88,7 @@
 
 label *getLastEpilogueLabel(void)
 {
-	label* l, *retval = 0;
+	label* l, *retval = NULL;
 
 	for (l = firstLabel; l != currLabel; l = l->next) {
 		if ((l->type & Ltomask) == Lepilogue) {
@@ -260,11 +260,11 @@
 label*
 getInternalLabel(label **lptr, uintp _pc)
 {
-	label *curr, *retval = 0;
+	label *curr, *retval = NULL;
 
-	assert(lptr != 0);
+	assert(lptr != NULL);
 	
-	if( *lptr == 0 )
+	if( *lptr == NULL )
 	{
 		/* Start at the head of the list. */
 		*lptr = firstLabel;
Index: kaffe/kaffe/kaffevm/jit3/machine.c
diff -u kaffe/kaffe/kaffevm/jit3/machine.c:1.61 kaffe/kaffe/kaffevm/jit3/machine.c:1.62
--- kaffe/kaffe/kaffevm/jit3/machine.c:1.61	Sun Dec 19 06:25:09 2004
+++ kaffe/kaffe/kaffevm/jit3/machine.c	Sun Dec 19 22:13:08 2004
@@ -377,9 +377,9 @@
 
 	assert(maxTemp < MAXTEMPS);
 
-	if( finishInsnSequence(0, &ncode, einfo) )
+	if( finishInsnSequence(NULL, &ncode, einfo) )
 	{
-		installMethodCode(0, xmeth, &ncode);
+		installMethodCode(NULL, xmeth, &ncode);
 	}
 	else
 	{
@@ -401,7 +401,7 @@
 		xmeth->jitClicks = end - xmeth->jitClicks;
 	}
 #endif
-	globalMethod = 0;
+	globalMethod = NULL;
 
 DBG(MOREJIT,
     dprintf("Translating %s.%s%s (%s) %p\n",




More information about the kaffe mailing list