diff --git a/CMakeLists.txt b/CMakeLists.txt index 6146b18..42a1721 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,8 +168,8 @@ LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/src/stasis) IF ( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" ) SET(COMMON_LIBRARIES stasis m pthread stdc++ ${DBUG}) # profiler) - SET(CMAKE_C_FLAGS "-g -Wall -pedantic -std=gnu99 -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_C_FLAGS}") - SET(CMAKE_CXX_FLAGS "-g -Wall -Wno-long-long -pedantic -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_CXX_FLAGS}") + SET(CMAKE_C_FLAGS "-g -Wall -ansi -pedantic -std=gnu99 -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_C_FLAGS}") + SET(CMAKE_CXX_FLAGS "-g -Wall -ansi -Wno-long-long -pedantic -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_CXX_FLAGS}") ELSEIF ( "${CMAKE_C_COMPILER_ID}" STREQUAL "SunPro" ) SET(COMMON_LIBRARIES stasis m pthread Crun Cstd) SET(CMAKE_C_FLAGS "-g -xc99=all -DPBL_COMPAT -D_FILE_OFFSET_BITS=64 ${CMAKE_C_FLAGS}") diff --git a/benchmarks/rose.cpp b/benchmarks/rose.cpp index 5ea8db9..97d4a53 100644 --- a/benchmarks/rose.cpp +++ b/benchmarks/rose.cpp @@ -561,12 +561,12 @@ void run_test2(int engine, int multicolumn, unsigned int inserts, column_count = 1; switch(engine) { case Rle::PLUGIN_ID: { - run_test,val_t>,Rle,typeof(begin), + run_test,val_t>,Rle,ITER, val_t,val_t> (inserts, column_count,buildTree,begin,end,INT_CMP,rowsize,scratch); } break; case For::PLUGIN_ID: { - run_test,val_t>,For,typeof(begin), + run_test,val_t>,For,ITER, val_t,val_t> (inserts, column_count,buildTree,begin,end,INT_CMP,rowsize,scratch); } break; diff --git a/src/stasis/logger/reorderingHandle.c b/src/stasis/logger/reorderingHandle.c index 82713c9..2968ace 100644 --- a/src/stasis/logger/reorderingHandle.c +++ b/src/stasis/logger/reorderingHandle.c @@ -7,7 +7,7 @@ long stasis_log_reordering_usleep_after_flush = 0; static void* stasis_log_reordering_handle_worker(void * a) { - stasis_log_reordering_handle_t * h = (typeof(h))a; + stasis_log_reordering_handle_t * h = (stasis_log_reordering_handle_t*)a; pthread_mutex_lock(&h->mut); while(h->cur_len || !h->closed) { while(h->cur_len) { diff --git a/src/stasis/transactional2.c b/src/stasis/transactional2.c index f9ba7dc..23ec1ba 100644 --- a/src/stasis/transactional2.c +++ b/src/stasis/transactional2.c @@ -204,7 +204,7 @@ void Tupdate(int xid, pageid_t page, const void * dat, size_t datlen, int op) { void TreorderableUpdate(int xid, void * hp, pageid_t page, const void *dat, size_t datlen, int op) { - stasis_log_reordering_handle_t * h = (typeof(h))hp; + stasis_log_reordering_handle_t * h = (stasis_log_reordering_handle_t *)hp; assert(stasis_transaction_table_is_active(stasis_transaction_table, xid)); Page * p = loadPage(xid, page); assert(p); diff --git a/stasis/experimental/lsmTable.h b/stasis/experimental/lsmTable.h index 5da6046..896aa85 100644 --- a/stasis/experimental/lsmTable.h +++ b/stasis/experimental/lsmTable.h @@ -39,6 +39,8 @@ namespace rose { template struct merge_args { + typedef typename ITERB::handle IN_HANDLE; + typedef typename ITERA::handle OUT_HANDLE; int worker_id; pageid_t(*pageAlloc)(int,void*); void *pageAllocState; @@ -55,11 +57,11 @@ namespace rose { pageid_t * out_tree_size; pageid_t max_size; pageid_t r_i; - typename ITERB::handle ** in_tree; + IN_HANDLE ** in_tree; void * in_tree_allocer; - typename ITERA::handle ** out_tree; + OUT_HANDLE ** out_tree; void * out_tree_allocer; - typename ITERA::handle my_tree; + OUT_HANDLE my_tree; epoch_t * last_complete_xact; column_number_t ts_col; recordid tree; @@ -319,7 +321,8 @@ namespace rose { pthread_cond_wait(a->out_block_needed_cond, a->block_ready_mut); } - *a->out_tree = (typeof(*a->out_tree))malloc(sizeof(**a->out_tree)); + *a->out_tree = (typename merge_args::OUT_HANDLE*)malloc(sizeof(void*)); +// *a->out_tree = (typeof(*a->out_tree))malloc(sizeof(**a->out_tree)); **a->out_tree = new typename ITERA::treeIteratorHandle(scratch_tree->r_); *(recordid*)(a->out_tree_allocer) = *scratchAllocState; @@ -419,6 +422,9 @@ namespace rose { template struct lsmTableHandle { + typedef typename std::set + SCRATCH_SET; pthread_t merge1_thread; pthread_t merge2_thread; bool * still_open; @@ -428,9 +434,10 @@ namespace rose { typename PAGELAYOUT::FMT::TUP::stl_cmp>, typename PAGELAYOUT::FMT::TUP>::handle ** input_handle; bool * input_needed; - typename std::set + SCRATCH_SET * scratch_tree; +/* typename std::set * scratch_tree; + typename PAGELAYOUT::FMT::TUP::stl_cmp> * scratch_tree; */ pthread_mutex_t * mut; pthread_cond_t * input_ready_cond; pthread_cond_t * input_needed_cond; @@ -516,7 +523,7 @@ namespace rose { ret->input_handle = block0_scratch; ret->input_needed = block0_needed; - ret->scratch_tree = new typeof(*ret->scratch_tree); + ret->scratch_tree = new typename lsmTableHandle::SCRATCH_SET; //new typeof(*ret->scratch_tree); ret->mut = block_ready_mut; @@ -562,7 +569,7 @@ namespace rose { tree }; *ret->args1 = tmpargs1; - void * (*merger1)(void*) = mergeThread; + void * (*merger1)(void*) = &mergeThread; ridp = (recordid*)malloc(sizeof(recordid)); *ridp = h.mediumTreeAllocState; @@ -631,12 +638,13 @@ namespace rose { gettimeofday(&stop_tv,0); stop = tv_to_double(stop_tv); - typeof(h->scratch_tree)* tmp_ptr = (typeof(h->scratch_tree)*) malloc(sizeof(void*)); + typename lsmTableHandle::SCRATCH_SET** tmp_ptr = (typename lsmTableHandle::SCRATCH_SET**)malloc(sizeof(void*)); +// typeof(h->scratch_tree)* tmp_ptr = (typeof(h->scratch_tree)*) malloc(sizeof(void*)); *tmp_ptr = h->scratch_tree; *(h->input_handle) = tmp_ptr; pthread_cond_signal(h->input_ready_cond); - h->scratch_tree = new typeof(*h->scratch_tree); + h->scratch_tree = new typename lsmTableHandle::SCRATCH_SET;//new typeof(*h->scratch_tree); pthread_mutex_unlock(h->mut); diff --git a/test/stasis/check_bTree.c b/test/stasis/check_bTree.c index a543e0c..06f63d3 100644 --- a/test/stasis/check_bTree.c +++ b/test/stasis/check_bTree.c @@ -83,7 +83,7 @@ START_TEST(bTreeTest) { assert(!TbtreeLookup(xid, rid, NULL, (byte*)&i, sizeof(i), (byte**)&scratch, &scratchsize)); TbtreeInsert(xid, rid, NULL, (byte*)&i, sizeof(i), (byte*)&i, sizeof(i)); assert(TbtreeLookup(xid, rid, NULL, (byte*)&i, sizeof(i), (byte**)&scratch, &scratchsize)); - assert(*(typeof(&i))scratch == i); + assert(*(int*)scratch == i); assert(scratchsize == sizeof(i)); free(scratch); }