diff options
author | wtc%netscape.com <devnull@localhost> | 1999-02-18 21:55:58 +0000 |
---|---|---|
committer | wtc%netscape.com <devnull@localhost> | 1999-02-18 21:55:58 +0000 |
commit | 314a948724d6b3f59d08d76e0e171462f7ed3a01 (patch) | |
tree | e1451b7d5782e9e1ad90830f8696aa8fc8f32bcc | |
parent | 043e3c877897e0ef13875499cb371ac778a55017 (diff) | |
download | nspr-hg-314a948724d6b3f59d08d76e0e171462f7ed3a01.tar.gz |
The code should not have actual functions in the assertions.
The patch is contributed by Matthew Zahorik <maz@albany.net>.
-rw-r--r-- | pr/src/bthreads/btcvar.c | 8 | ||||
-rw-r--r-- | pr/src/bthreads/btlocks.c | 5 | ||||
-rw-r--r-- | pr/src/bthreads/btsem.c | 10 | ||||
-rw-r--r-- | pr/src/bthreads/btthread.c | 6 |
4 files changed, 22 insertions, 7 deletions
diff --git a/pr/src/bthreads/btcvar.c b/pr/src/bthreads/btcvar.c index bdb594c5..0e65a58c 100644 --- a/pr/src/bthreads/btcvar.c +++ b/pr/src/bthreads/btcvar.c @@ -34,7 +34,8 @@ PR_IMPLEMENT(PRCondVar*) if( NULL != cv ) { cv->lock = lock; - PR_ASSERT((cv->isem = create_sem( 1, "nspr_sem")) >= B_NO_ERROR ); + cv->isem = create_sem( 1, "nspr_sem"); + PR_ASSERT( cv->isem >= B_NO_ERROR ); } return cv; } /* PR_NewCondVar */ @@ -48,7 +49,10 @@ PR_IMPLEMENT(PRCondVar*) PR_IMPLEMENT(void) PR_DestroyCondVar (PRCondVar *cvar) { - PR_ASSERT( delete_sem( cvar->isem ) == B_NO_ERROR ); + status_t result; + + result = delete_sem( cvar->isem ); + PR_ASSERT( result == B_NO_ERROR ); PR_DELETE( cvar ); } diff --git a/pr/src/bthreads/btlocks.c b/pr/src/bthreads/btlocks.c index d7f90694..b21702e8 100644 --- a/pr/src/bthreads/btlocks.c +++ b/pr/src/bthreads/btlocks.c @@ -53,8 +53,11 @@ PR_IMPLEMENT(PRLock*) PR_IMPLEMENT(void) PR_DestroyLock (PRLock* lock) { + status_t result; + PR_ASSERT(NULL != lock); - PR_ASSERT(delete_sem(lock->semaphoreID) == B_NO_ERROR); + result = delete_sem(lock->semaphoreID); + PR_ASSERT(result == B_NO_ERROR); PR_DELETE(lock); } diff --git a/pr/src/bthreads/btsem.c b/pr/src/bthreads/btsem.c index 3e7cbe8a..54829398 100644 --- a/pr/src/bthreads/btsem.c +++ b/pr/src/bthreads/btsem.c @@ -42,8 +42,11 @@ PR_IMPLEMENT(PRSemaphore*) PR_IMPLEMENT(void) PR_DestroySem (PRSemaphore *sem) { + status_t result; + PR_ASSERT(sem != NULL); - PR_ASSERT(delete_sem(sem->sem) == B_NO_ERROR); + result = delete_sem(sem->sem); + PR_ASSERT(result == B_NO_ERROR); PR_DELETE(sem); } @@ -79,8 +82,11 @@ PR_IMPLEMENT(PRStatus) PR_IMPLEMENT(void) PR_PostSem (PRSemaphore *sem) { + status_t result; + PR_ASSERT(sem != NULL); - PR_ASSERT(release_sem(sem->sem) == B_NO_ERROR); + result = release_sem(sem->sem); + PR_ASSERT(result == B_NO_ERROR); } /* diff --git a/pr/src/bthreads/btthread.c b/pr/src/bthreads/btthread.c index 5f5e6564..cf75a4e3 100644 --- a/pr/src/bthreads/btthread.c +++ b/pr/src/bthreads/btthread.c @@ -198,7 +198,8 @@ _bt_root (void* arg) /* Set within the current thread the pointer to our object. This object will be deleted when the thread termintates. */ - PR_ASSERT( PR_SetThreadPrivate( 0, (void *) thred ) == PR_SUCCESS ); + result = PR_SetThreadPrivate( 0, (void *) thred ); + PR_ASSERT( result == PR_SUCCESS ); thred->startFunc(thred->arg); /* run the dang thing */ @@ -266,7 +267,8 @@ _bt_root (void* arg) /* delete the thread object */ PR_DELETE(thred); - PR_ASSERT( PR_SetThreadPrivate( (PRUint8) 0, (void *) NULL ) == PR_SUCCESS ); + result = PR_SetThreadPrivate( (PRUint8) 0, (void *) NULL ); + PR_ASSERT( result == PR_SUCCESS ); exit_thread( NULL ); } |