Changeset: 2d1c9579480e for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2d1c9579480e
Modified Files:
gdk/gdk_system.c
sql/storage/sql_storage.h
sql/storage/store.c
Branch: default
Log Message:
Use bool.
diffs (91 lines):
diff --git a/gdk/gdk_system.c b/gdk/gdk_system.c
--- a/gdk/gdk_system.c
+++ b/gdk/gdk_system.c
@@ -428,7 +428,7 @@ static struct posthread {
pthread_t tid;
void (*func)(void *);
void *arg;
- int exited;
+ bool exited;
} *posthreads = NULL;
static pthread_mutex_t posthread_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -494,7 +494,7 @@ thread_starter(void *arg)
/* *p may have been freed by join_threads, so try to find it
* again before using it */
if ((p = find_posthread_locked(pthread_self())) != NULL)
- p->exited = 1;
+ p->exited = true;
pthread_mutex_unlock(&posthread_lock);
return NULL;
}
@@ -594,7 +594,7 @@ MT_create_thread(MT_Id *t, void (*f) (vo
}
p->func = f;
p->arg = arg;
- p->exited = 0;
+ p->exited = false;
if (d == MT_THR_DETACHED) {
pf = thread_starter;
newtp = &p->tid;
@@ -634,7 +634,7 @@ MT_exiting_thread(void)
pthread_mutex_lock(&posthread_lock);
if ((p = find_posthread_locked(tid)) != NULL)
- p->exited = 1;
+ p->exited = true;
pthread_mutex_unlock(&posthread_lock);
}
diff --git a/sql/storage/sql_storage.h b/sql/storage/sql_storage.h
--- a/sql/storage/sql_storage.h
+++ b/sql/storage/sql_storage.h
@@ -359,7 +359,7 @@ extern int store_next_oid(void);
extern sql_trans *sql_trans_create(backend_stack stk, sql_trans *parent, const
char *name);
extern sql_trans *sql_trans_destroy(sql_trans *tr);
-extern int sql_trans_validate(sql_trans *tr);
+extern bool sql_trans_validate(sql_trans *tr);
extern int sql_trans_commit(sql_trans *tr);
extern sql_type *sql_trans_create_type(sql_trans *tr, sql_schema *s, const
char *sqlname, int digits, int scale, int radix, const char *impl);
diff --git a/sql/storage/store.c b/sql/storage/store.c
--- a/sql/storage/store.c
+++ b/sql/storage/store.c
@@ -4004,7 +4004,7 @@ sql_trans_create(backend_stack stk, sql_
return tr;
}
-int
+bool
sql_trans_validate(sql_trans *tr)
{
node *n;
@@ -4012,12 +4012,12 @@ sql_trans_validate(sql_trans *tr)
/* depends on the iso level */
if (tr->schema_number != store_schema_number())
- return 0;
+ return false;
/* since we protect usage through private copies both the iso levels
read uncommited and read commited always succeed.
if (tr->level == ISO_READ_UNCOMMITED || tr->level == ISO_READ_COMMITED)
- return 1;
+ return true;
*/
/* If only 'inserts' occurred on the read columns the repeatable reads
@@ -4035,10 +4035,10 @@ sql_trans_validate(sql_trans *tr)
os = find_sql_schema(tr->parent, s->base.name);
if (os && (s->base.wtime != 0 || s->base.rtime != 0)) {
if (!validate_tables(s, os))
- return 0;
+ return false;
}
}
- return 1;
+ return true;
}
#ifdef CAT_DEBUG
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list