Changeset: c191d4f161f9 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/c191d4f161f9
Modified Files:
        gdk/gdk_logger.c
        gdk/gdk_logger_internals.h
Branch: pax-log
Log Message:

Using unsigned integer is cleaner.


diffs (50 lines):

diff --git a/gdk/gdk_logger.c b/gdk/gdk_logger.c
--- a/gdk/gdk_logger.c
+++ b/gdk/gdk_logger.c
@@ -35,6 +35,7 @@ static gdk_return log_del_bat(logger *lg
 #define LOG_SEQ                7
 #define LOG_CLEAR      8
 #define LOG_BAT_GROUP  9
+#define LOG_COMMIT     10
 
 #ifdef NATIVE_WIN32
 #define getfilepos _ftelli64
@@ -2887,7 +2888,7 @@ log_tend(logger *lg)
 static int
 request_number_flush_queue(logger *lg) {
        // Semaphore protects ring buffer structure in queue against overflowing
-       static int _number = 0;
+       static unsigned int _number = 0;
        int result;
        MT_sema_down(&lg->flush_queue_semaphore);
        MT_lock_set(&lg->flush_queue_lock);
@@ -2912,7 +2913,7 @@ left_truncate_flush_queue(logger *lg, in
 }
 
 static int
-number_in_flush_queue(logger *lg, int number) {
+number_in_flush_queue(logger *lg, unsigned int number) {
        MT_lock_set(&lg->flush_queue_lock);
        const int fql = lg->flush_queue_length;
        MT_lock_unset(&lg->flush_queue_lock);
@@ -2959,7 +2960,7 @@ log_tflush(logger* lg, ulng log_file_id,
        }
 
        if (log_file_id == lg->id) {
-               int number = request_number_flush_queue(lg);
+               unsigned int number = request_number_flush_queue(lg);
 
                MT_lock_set(&lg->flush_lock);
                /* the transaction is not yet flushed */
diff --git a/gdk/gdk_logger_internals.h b/gdk/gdk_logger_internals.h
--- a/gdk/gdk_logger_internals.h
+++ b/gdk/gdk_logger_internals.h
@@ -69,7 +69,7 @@ struct logger {
        size_t bufsize;
 
        /* flush variables */
-       int flush_queue[FLUSH_QUEUE_SIZE]; /* circular array with the current 
transactions' ids waiting to be flushed */
+       unsigned int flush_queue[FLUSH_QUEUE_SIZE]; /* circular array with the 
current transactions' ids waiting to be flushed */
        int flush_queue_begin; /* start index of the queue */
        int flush_queue_length; /* length of the queue */
        MT_Sema flush_queue_semaphore; /*to protect the queue against ring 
buffer overflows */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to