Changeset: d8710070c1ef for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d8710070c1ef
Modified Files:
        gdk/gdk_logger.c
        monetdb5/optimizer/opt_dict.c
Branch: default
Log Message:

Use bool.


diffs (130 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -2350,9 +2350,9 @@ log_flush(logger *lg, ulng ts)
                }
                /* we read the full file because skipping is impossible with 
current log format */
                log_lock(lg);
-               lg->flushing = 1;
+               lg->flushing = true;
                res = log_read_transaction(lg);
-               lg->flushing = 0;
+               lg->flushing = false;
                log_unlock(lg);
                if (res == LOG_EOF) {
                        log_close_input(lg);
@@ -2860,7 +2860,7 @@ left_truncate_flush_queue(logger *lg, in
                MT_sema_up(&lg->flush_queue_semaphore);
 }
 
-static int
+static bool
 number_in_flush_queue(logger *lg, unsigned int number) {
        MT_lock_set(&lg->flush_queue_lock);
        const int fql = lg->flush_queue_length;
@@ -2868,10 +2868,10 @@ number_in_flush_queue(logger *lg, unsign
        for (int i = 0; i < fql; i++) {
                const int idx = (lg->flush_queue_begin + i) % FLUSH_QUEUE_SIZE;
                if (lg->flush_queue[idx] == number) {
-                       return 1;
+                       return true;
                }
        }
-       return 0;
+       return false;
 }
 
 static int
diff --git a/monetdb5/optimizer/opt_dict.c b/monetdb5/optimizer/opt_dict.c
--- a/monetdb5/optimizer/opt_dict.c
+++ b/monetdb5/optimizer/opt_dict.c
@@ -74,7 +74,7 @@ OPTdictImplementation(Client cntxt, MalB
                        freeInstruction(p);
                        continue;
                }
-               int done = 0;
+               bool done = false;
                for(j=p->retc; j< p->argc; j++){
                        k = getArg(p,j);
                        if (varisdict[k]) { // maybe we could delay this usage
@@ -92,7 +92,7 @@ OPTdictImplementation(Client cntxt, MalB
                                        dictunique[l] = dictunique[k];
                                        pushInstruction(mb,r);
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else if (p->argc == 2 && p->retc == 1 && 
p->barrier == ASSIGNsymbol) {
                                        /* a = b */
@@ -101,7 +101,7 @@ OPTdictImplementation(Client cntxt, MalB
                                        vardictvalue[l] = vardictvalue[k];
                                        dictunique[l] = dictunique[k];
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else if (getModuleId(p) == algebraRef && 
getFunctionId(p) == subsliceRef) {
                                        /* pos = subslice(col, l, h) with col = 
dict.decompress(o,u)
@@ -110,7 +110,7 @@ OPTdictImplementation(Client cntxt, MalB
                                        getArg(r, j) = varisdict[k];
                                        pushInstruction(mb,r);
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else if ((getModuleId(p) == batRef && 
getFunctionId(p) == mirrorRef) || (getModuleId(p) == batcalcRef && 
getFunctionId(p) == identityRef)) {
                                        /* id = mirror/identity(col) with col = 
dict.decompress(o,u)
@@ -119,7 +119,7 @@ OPTdictImplementation(Client cntxt, MalB
                                        getArg(r, j) = varisdict[k];
                                        pushInstruction(mb,r);
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else if (isSelect(p)) {
                                        if (getFunctionId(p) == thetaselectRef) 
{
@@ -182,7 +182,7 @@ OPTdictImplementation(Client cntxt, MalB
                                                pushInstruction(mb,t);
                                        }
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else if (j == 2 && p->argc > j+1 && 
getModuleId(p) == algebraRef && getFunctionId(p) == joinRef
                                                && varisdict[getArg(p, j+1)] && 
vardictvalue[k] == vardictvalue[getArg(p, j+1)]) {
@@ -196,7 +196,7 @@ OPTdictImplementation(Client cntxt, MalB
                                        getArg(r, j+1) = varisdict[l];
                                        pushInstruction(mb,r);
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else if (j == 2 && p->argc > j+1 && 
getModuleId(p) == algebraRef && getFunctionId(p) == joinRef
                                                && varisdict[getArg(p, j+1)] && 
vardictvalue[k] != vardictvalue[getArg(p, j+1)]) {
@@ -218,7 +218,7 @@ OPTdictImplementation(Client cntxt, MalB
                                        r = addArgument(mb, r, getArg(p, 7));
                                        pushInstruction(mb,r);
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else if ((isMapOp(p) || isMap2Op(p)) && 
allConstExcept(mb, p, j)) {
                                        /* batcalc.-(1, col) with col = 
dict.decompress(o,u)
@@ -236,7 +236,7 @@ OPTdictImplementation(Client cntxt, MalB
                                        dictunique[l] = 0;
                                        pushInstruction(mb,r);
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else if (getModuleId(p) == groupRef &&
                                                (getFunctionId(p) == 
subgroupRef || getFunctionId(p) == subgroupdoneRef ||
@@ -269,7 +269,7 @@ OPTdictImplementation(Client cntxt, MalB
                                        getArg(r, j) = input;
                                        pushInstruction(mb,r);
                                        freeInstruction(p);
-                                       done = 1;
+                                       done = true;
                                        break;
                                } else {
                                        /* need to decompress */
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to