From 2cb7ca6d0aa997474b63f240c165e1a941cf6124 Mon Sep 17 00:00:00 2001 From: Brian Demsky Date: Tue, 10 Jul 2012 15:01:44 -0700 Subject: [PATCH] fix bug get rid of annoying compiler warning --- hashtable.h | 4 ++-- main.cc | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hashtable.h b/hashtable.h index f372f9e7..b544988e 100644 --- a/hashtable.h +++ b/hashtable.h @@ -19,7 +19,7 @@ template table = (struct hashlistnode<_Key,_Val> **) calloc(initialcapacity, sizeof(struct hashlistnode<_Key,_Val> *)); loadfactor = factor; capacity = initialcapacity; - threshold = initialcapacity*loadfactor; + threshold = (unsigned int) (initialcapacity*loadfactor); mask = (capacity << _Shift)-1; size = 0; // Initial number of elements in the hash } @@ -111,7 +111,7 @@ template table = newtable; //Update the global hashtable upon resize() capacity = newsize; - threshold = newsize * loadfactor; + threshold = (unsigned int) (newsize * loadfactor); mask = (newsize << _Shift)-1; for(unsigned int i = 0; i < oldcapacity; i++) { diff --git a/main.cc b/main.cc index b38f7ef4..a400fe3c 100644 --- a/main.cc +++ b/main.cc @@ -6,6 +6,8 @@ #include "common.h" #include "threads.h" +#include "datarace.h" + /* global "model" object */ #include "model.h" #include "snapshot-interface.h" @@ -54,6 +56,8 @@ static void thread_wait_finish(void) { void real_main() { thrd_t user_thread; ucontext_t main_context; + //Initialize race detector + initRaceDetector(); //Create the singleton SnapshotStack object snapshotObject = new SnapshotStack(); -- 2.34.1