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

Kaffe CVS cvs-commits at kaffe.org
Sun Dec 19 18:34:03 PST 2004


PatchSet 5676 
Date: 2004/12/20 02:29:50
Author: doogie
Branch: HEAD
Tag: (none) 
Log:
Sparse NULL-constant fixes.

Members: 
	ChangeLog:1.3221->1.3222 
	kaffe/kaffevm/systems/unix-pthreads/lock-impl.c:1.13->1.14 
	kaffe/kaffevm/systems/unix-pthreads/signal.c:1.14->1.15 
	kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.23->1.24 
	kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.60->1.61 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3221 kaffe/ChangeLog:1.3222
--- kaffe/ChangeLog:1.3221	Mon Dec 20 02:12:50 2004
+++ kaffe/ChangeLog	Mon Dec 20 02:29:50 2004
@@ -1,5 +1,13 @@
 2004-12-19  Adam Heath  <doogie at brainfood.com>
 
+	* kaffe/kaffevm/systems/unix-pthreads/lock-impl.c,
+	  kaffe/kaffevm/systems/unix-pthreads/signal.c,
+	  kaffe/kaffevm/systems/unix-pthreads/syscalls.c,
+	  kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:
+	  Sparse NULL-constant fixes.
+
+2004-12-19  Adam Heath  <doogie at brainfood.com>
+
 	* kaffe/kaffevm/locks.c, kaffe/kaffevm/lookup.c,
 	  kaffe/kaffevm/object.c, kaffe/kaffevm/readClass.c,
 	  kaffe/kaffevm/reflect.c, kaffe/kaffevm/soft.c,
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/lock-impl.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/lock-impl.c:1.13 kaffe/kaffe/kaffevm/systems/unix-pthreads/lock-impl.c:1.14
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/lock-impl.c:1.13	Sun Dec 19 06:25:11 2004
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/lock-impl.c	Mon Dec 20 02:29:52 2004
@@ -50,7 +50,7 @@
    * This is needed for Darwin's pthreads.
    */
   if (cur->status == THREAD_KILL)
-    pthread_exit(0);
+    pthread_exit(NULL);
 }
 
 void
@@ -103,7 +103,7 @@
   else
     {
       /* timeout is in millisecs, timeval in microsecs, and timespec in nanosecs */
-      gettimeofday( &now, 0);
+      gettimeofday( &now, NULL);
       abst.tv_sec = now.tv_sec + (timeout / 1000);
       if( abst.tv_sec < now.tv_sec )
 	{
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.14 kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.15
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c:1.14	Sat Dec 11 04:01:01 2004
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/signal.c	Mon Dec 20 02:29:52 2004
@@ -307,7 +307,7 @@
 
 	sigemptyset(&nsig);
 	sigaddset(&nsig, sig);
-	sigprocmask(SIG_UNBLOCK, &nsig, 0);
+	sigprocmask(SIG_UNBLOCK, &nsig, NULL);
 }
 
 
@@ -327,7 +327,7 @@
 #if defined(SIGVTALRM)
 	sigaddset(&nsig, SIGVTALRM);
 #endif
-	sigprocmask(SIG_UNBLOCK, &nsig, 0);
+	sigprocmask(SIG_UNBLOCK, &nsig, NULL);
 	
 }
 
@@ -347,7 +347,7 @@
 #if defined(SIGVTALRM)
 	sigaddset(&nsig, SIGVTALRM);
 #endif
-	sigprocmask(SIG_BLOCK, &nsig, 0);
+	sigprocmask(SIG_BLOCK, &nsig, NULL);
 	
 }
 
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.23 kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.24
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c:1.23	Sun Dec 19 22:46:29 2004
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/syscalls.c	Mon Dec 20 02:29:52 2004
@@ -123,7 +123,7 @@
 currentTime(void)
 {
     struct timeval tm;
-    gettimeofday(&tm, 0);
+    gettimeofday(&tm, NULL);
     return (((jlong)tm.tv_sec * 1000L) + ((jlong)tm.tv_usec / 1000L));
 }
 
@@ -696,7 +696,7 @@
 	 * reenable signals in the child after we cleaned up.
 	 */
 	sigfillset(&nsig);
-	sigprocmask(SIG_BLOCK, &nsig, 0);
+	sigprocmask(SIG_BLOCK, &nsig, NULL);
 
 	pid = fork();
 
@@ -709,7 +709,7 @@
 		}
 
 		/* now reenable interrupts */
-		sigprocmask(SIG_UNBLOCK, &nsig, 0);
+		sigprocmask(SIG_UNBLOCK, &nsig, NULL);
 
 		/* set stdin, stdout, and stderr up from the pipes */
 		dup2(fds[IN_IN], 0);
@@ -752,7 +752,7 @@
 		err = errno;
 		/* Close all pipe fds */
 		close_fds(fds, 8);
-		sigprocmask(SIG_UNBLOCK, &nsig, 0);
+		sigprocmask(SIG_UNBLOCK, &nsig, NULL);
 		return (err);
 
 	default:
@@ -769,7 +769,7 @@
 		ioes[2] = fds[ERR_IN];
 		ioes[3] = fds[SYNC_OUT];
 
-		sigprocmask(SIG_UNBLOCK, &nsig, 0);
+		sigprocmask(SIG_UNBLOCK, &nsig, NULL);
 		*outpid = pid;
 		return (0);
 	}
Index: kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c
diff -u kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.60 kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.61
--- kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c:1.60	Sun Dec 19 06:25:11 2004
+++ kaffe/kaffe/kaffevm/systems/unix-pthreads/thread-impl.c	Mon Dec 20 02:29:52 2004
@@ -318,7 +318,7 @@
 	usleep( 5000);
   }
 
-  return 0;
+  return NULL;
 }
 
 static
@@ -337,7 +337,7 @@
 #endif
   pthread_attr_setstacksize( &attr, 4096);
 
-  pthread_create( &deadlockWatchdog, &attr, tWatchdogRun, 0);
+  pthread_create( &deadlockWatchdog, &attr, tWatchdogRun, NULL);
 }
 #endif /* KAFFE_VMDEBUG */
 
@@ -660,7 +660,7 @@
   /* create the jthread* thingy */
   nt = thread_malloc( sizeof(struct _jthread) );
 
-  nt->func         = 0;
+  nt->func         = NULL;
   nt->suspendState = 0;
 #if defined(KAFFEMD_STACKSIZE)
   stackSize = mdGetStackSize();
@@ -680,7 +680,7 @@
   stackSize = MAINSTACKSIZE;
 #endif
   detectStackBoundaries(nt, stackSize);
-  nt->stackCur     = 0; 
+  nt->stackCur     = NULL; 
   nt->daemon       = isDaemon;
 
   /* link everything together */
@@ -761,7 +761,7 @@
 	}
 
 	/* unlink Java and native thread */
-	cur->data.jlThread = 0;
+	cur->data.jlThread = NULL;
 	cur->suspendState = 0;
 
 	/* link into cache list (if still within limit) */
@@ -794,7 +794,7 @@
 
   tDispose( cur);
 
-  return 0;
+  return NULL;
 }
 
 
@@ -866,7 +866,7 @@
 	nt->data.jlThread = jlThread;
 	nt->daemon = isDaemon;
 	nt->func = func;
-	nt->stackCur = 0;
+	nt->stackCur = NULL;
 	nt->status = THREAD_RUNNING;
 
 #if defined(SCHEDULE_POLICY)
@@ -899,9 +899,9 @@
 	nt->data.jlThread       = jlThread;
 	nt->func         = func;
 	nt->suspendState = 0;
-	nt->stackMin     = 0;
-	nt->stackMax     = 0;
-	nt->stackCur     = 0;
+	nt->stackMin     = NULL;
+	nt->stackMax     = NULL;
+	nt->stackCur     = NULL;
 	nt->daemon	 = isDaemon;
 	nt->status = THREAD_RUNNING;
 	pthread_mutex_init(&nt->suspendLock, NULL);
@@ -947,7 +947,7 @@
 	  repsem_destroy( &nt->sem);
 	  unprotectThreadList(cur);
 	  KGC_rmRef(threadCollector, nt);
-	  return 0;
+	  return NULL;
 	}
 
 	/* wait until the thread specific data has been set, and the new thread
@@ -1049,7 +1049,7 @@
 	  }
 
 	  unprotectThreadList(cur);
-	  pthread_exit( 0);
+	  pthread_exit( NULL);
 
 	  /* we shouldn't get here, this is a last safeguard */
 	  EXIT(0);
@@ -1070,7 +1070,7 @@
 
 	for ( t=activeThreads; (t != NULL) && (t->next != cur); t=t->next );
 	assert( t != NULL);
-	t->next = 0;
+	t->next = NULL;
 
 	unprotectThreadList(cur);
 
@@ -1173,7 +1173,7 @@
   
   DBG( JTHREADDETAIL, dprintf("sigwait return: %p\n", cur));
     
-  cur->stackCur     = 0;
+  cur->stackCur     = NULL;
   cur->suspendState = 0;
   
   /* notify the critSect owner we are leaving the handler */




More information about the kaffe mailing list