use the "bool" data type instead of "int"

"bool" should be used in C99 programs for boolean values.
This commit is contained in:
Max Kellermann
2008-10-08 11:03:39 +02:00
parent 71351160b1
commit b084bc28ed
20 changed files with 74 additions and 65 deletions

View File

@@ -31,7 +31,7 @@ void notify_init(struct notify *notify)
if (ret != 0)
FATAL("pthread_mutex_init() failed");
notify->pending = 0;
notify->pending = false;
}
void notify_deinit(struct notify *notify)
@@ -45,14 +45,14 @@ void notify_wait(struct notify *notify)
pthread_mutex_lock(&notify->mutex);
while (!notify->pending)
pthread_cond_wait(&notify->cond, &notify->mutex);
notify->pending = 0;
notify->pending = false;
pthread_mutex_unlock(&notify->mutex);
}
void notify_signal(struct notify *notify)
{
pthread_mutex_lock(&notify->mutex);
notify->pending = 1;
notify->pending = true;
pthread_cond_signal(&notify->cond);
pthread_mutex_unlock(&notify->mutex);
}