Changeset: adecdc638e19 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=adecdc638e19
Added Files:
        monetdb5/modules/mosaic/mosaic_select_template.h
        monetdb5/modules/mosaic/mosaic_select_template2.h
Removed Files:
        monetdb5/modules/mosaic/mosaic_select.h
Modified Files:
        monetdb5/modules/mosaic/Makefile.ag
        monetdb5/modules/mosaic/mosaic.c
        monetdb5/modules/mosaic/mosaic_delta.c
        monetdb5/modules/mosaic/mosaic_dict.c
        monetdb5/modules/mosaic/mosaic_dict256.c
        monetdb5/modules/mosaic/mosaic_frame.c
        monetdb5/modules/mosaic/mosaic_linear.c
        monetdb5/modules/mosaic/mosaic_prefix.c
        monetdb5/modules/mosaic/mosaic_raw.c
        monetdb5/modules/mosaic/mosaic_runlength.c
        monetdb5/modules/mosaic/mosaic_template.h
        monetdb5/modules/mosaic/mosaic_utility.h
Branch: mosaic
Log Message:

Refactor select macro's to template functions.


diffs (truncated from 908 to 300 lines):

diff --git a/monetdb5/modules/mosaic/Makefile.ag 
b/monetdb5/modules/mosaic/Makefile.ag
--- a/monetdb5/modules/mosaic/Makefile.ag
+++ b/monetdb5/modules/mosaic/Makefile.ag
@@ -22,7 +22,7 @@ lib_mosaic = {
                mosaic.c mosaic.h mosaic_template.h \
                mosaic_utility.h \
                mosaic_hdr.c mosaic_hdr.h \
-               mosaic_select.h \
+               mosaic_select.h mosaic_select_template.h 
mosaic_select_template2.h \
                mosaic_projection.h \
                mosaic_join.h \
                mosaic_raw.c mosaic_raw.h \
diff --git a/monetdb5/modules/mosaic/mosaic.c b/monetdb5/modules/mosaic/mosaic.c
--- a/monetdb5/modules/mosaic/mosaic.c
+++ b/monetdb5/modules/mosaic/mosaic.c
@@ -633,16 +633,6 @@ isCompressed(bat bid)
        return r;
 }
 
-MOSselect_generic_DEF(bte)
-MOSselect_generic_DEF(sht)
-MOSselect_generic_DEF(int)
-MOSselect_generic_DEF(lng)
-MOSselect_generic_DEF(flt)
-MOSselect_generic_DEF(dbl)
-#ifdef HAVE_HGE
-MOSselect_generic_DEF(hge)
-#endif
-
 /* The algebra operators should fall back to their default
  * when we know that the heap is not compressed
  * The actual decompression should wait until we know that
diff --git a/monetdb5/modules/mosaic/mosaic_delta.c 
b/monetdb5/modules/mosaic/mosaic_delta.c
--- a/monetdb5/modules/mosaic/mosaic_delta.c
+++ b/monetdb5/modules/mosaic/mosaic_delta.c
@@ -263,13 +263,25 @@ MOSdecompress_DEF(hge)
     }\
 }
 
-MOSselect_DEF(delta, bte)
-MOSselect_DEF(delta, sht)
-MOSselect_DEF(delta, int)
-MOSselect_DEF(delta, lng)
+#define NAME delta
+#define TPE bte
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE sht
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE int
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE lng
+#include "mosaic_select_template.h"
+#undef TPE
 #ifdef HAVE_HGE
-MOSselect_DEF(delta, hge)
+#define TPE hge
+#include "mosaic_select_template.h"
+#undef TPE
 #endif
+#undef NAME
 
 #define projection_loop_delta(TPE, CANDITER_NEXT)\
 {\
diff --git a/monetdb5/modules/mosaic/mosaic_dict.c 
b/monetdb5/modules/mosaic/mosaic_dict.c
--- a/monetdb5/modules/mosaic/mosaic_dict.c
+++ b/monetdb5/modules/mosaic/mosaic_dict.c
@@ -117,15 +117,31 @@ MOSlayout_dict(MOStask* task, BAT *btech
 #define scan_loop_dict(TPE, CI_NEXT, TEST) \
     scan_loop_dictionary(dict, TPE, CI_NEXT, TEST)
 
-MOSselect_DEF(dict, bte)
-MOSselect_DEF(dict, sht)
-MOSselect_DEF(dict, int)
-MOSselect_DEF(dict, lng)
-MOSselect_DEF(dict, flt)
-MOSselect_DEF(dict, dbl)
+#define NAME dict
+#define TPE bte
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE sht
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE int
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE lng
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE flt
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE dbl
+#include "mosaic_select_template.h"
+#undef TPE
 #ifdef HAVE_HGE
-MOSselect_DEF(dict, hge)
+#define TPE hge
+#include "mosaic_select_template.h"
+#undef TPE
 #endif
+#undef NAME
 
 #define projection_loop_dict(TPE, CI_NEXT) \
     projection_loop_dictionary(dict, TPE, CI_NEXT)
diff --git a/monetdb5/modules/mosaic/mosaic_dict256.c 
b/monetdb5/modules/mosaic/mosaic_dict256.c
--- a/monetdb5/modules/mosaic/mosaic_dict256.c
+++ b/monetdb5/modules/mosaic/mosaic_dict256.c
@@ -141,15 +141,31 @@ MOSlayout_dict256(MOStask* task, BAT *bt
 #define scan_loop_dict256(TPE, CI_NEXT, TEST) \
     scan_loop_dictionary(dict256, TPE, CI_NEXT, TEST)
 
-MOSselect_DEF(dict256, bte)
-MOSselect_DEF(dict256, sht)
-MOSselect_DEF(dict256, int)
-MOSselect_DEF(dict256, lng)
-MOSselect_DEF(dict256, flt)
-MOSselect_DEF(dict256, dbl)
+#define NAME dict256
+#define TPE bte
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE sht
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE int
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE lng
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE flt
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE dbl
+#include "mosaic_select_template.h"
+#undef TPE
 #ifdef HAVE_HGE
-MOSselect_DEF(dict256, hge)
+#define TPE hge
+#include "mosaic_select_template.h"
+#undef TPE
 #endif
+#undef NAME
 
 #define projection_loop_dict256(TPE, CI_NEXT) \
     projection_loop_dictionary(dict256, TPE, CI_NEXT)
diff --git a/monetdb5/modules/mosaic/mosaic_frame.c 
b/monetdb5/modules/mosaic/mosaic_frame.c
--- a/monetdb5/modules/mosaic/mosaic_frame.c
+++ b/monetdb5/modules/mosaic/mosaic_frame.c
@@ -247,13 +247,25 @@ MOSdecompress_DEF(hge)
     }\
 }
 
-MOSselect_DEF(frame, bte)
-MOSselect_DEF(frame, sht)
-MOSselect_DEF(frame, int)
-MOSselect_DEF(frame, lng)
+#define NAME frame
+#define TPE bte
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE sht
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE int
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE lng
+#include "mosaic_select_template.h"
+#undef TPE
 #ifdef HAVE_HGE
-MOSselect_DEF(frame, hge)
+#define TPE hge
+#include "mosaic_select_template.h"
+#undef TPE
 #endif
+#undef NAME
 
 #define projection_loop_frame(TPE, CANDITER_NEXT)\
 {\
diff --git a/monetdb5/modules/mosaic/mosaic_linear.c 
b/monetdb5/modules/mosaic/mosaic_linear.c
--- a/monetdb5/modules/mosaic/mosaic_linear.c
+++ b/monetdb5/modules/mosaic/mosaic_linear.c
@@ -194,13 +194,25 @@ MOSdecompress_DEF(hge)
     }\
 }
 
-MOSselect_DEF(linear, bte)
-MOSselect_DEF(linear, sht)
-MOSselect_DEF(linear, int)
-MOSselect_DEF(linear, lng)
+#define NAME linear
+#define TPE bte
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE sht
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE int
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE lng
+#include "mosaic_select_template.h"
+#undef TPE
 #ifdef HAVE_HGE
-MOSselect_DEF(linear, hge)
+#define TPE hge
+#include "mosaic_select_template.h"
+#undef TPE
 #endif
+#undef NAME
 
 #define projection_loop_linear(TPE, CI_NEXT)\
 {\
diff --git a/monetdb5/modules/mosaic/mosaic_prefix.c 
b/monetdb5/modules/mosaic/mosaic_prefix.c
--- a/monetdb5/modules/mosaic/mosaic_prefix.c
+++ b/monetdb5/modules/mosaic/mosaic_prefix.c
@@ -301,13 +301,25 @@ MOSdecompress_DEF(hge)
     }\
 }
 
-MOSselect_DEF(prefix, bte)
-MOSselect_DEF(prefix, sht)
-MOSselect_DEF(prefix, int)
-MOSselect_DEF(prefix, lng)
+#define NAME prefix
+#define TPE bte
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE sht
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE int
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE lng
+#include "mosaic_select_template.h"
+#undef TPE
 #ifdef HAVE_HGE
-MOSselect_DEF(prefix, hge)
+#define TPE hge
+#include "mosaic_select_template.h"
+#undef TPE
 #endif
+#undef NAME
 
 #define projection_loop_prefix(TPE, CI_NEXT)\
 {\
diff --git a/monetdb5/modules/mosaic/mosaic_raw.c 
b/monetdb5/modules/mosaic/mosaic_raw.c
--- a/monetdb5/modules/mosaic/mosaic_raw.c
+++ b/monetdb5/modules/mosaic/mosaic_raw.c
@@ -203,15 +203,31 @@ MOSdecompress_DEF(hge)
     }\
 }
 
-MOSselect_DEF(raw, bte)
-MOSselect_DEF(raw, sht)
-MOSselect_DEF(raw, int)
-MOSselect_DEF(raw, lng)
-MOSselect_DEF(raw, flt)
-MOSselect_DEF(raw, dbl)
+#define NAME raw
+#define TPE bte
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE sht
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE int
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE lng
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE flt
+#include "mosaic_select_template.h"
+#undef TPE
+#define TPE dbl
+#include "mosaic_select_template.h"
+#undef TPE
 #ifdef HAVE_HGE
-MOSselect_DEF(raw, hge)
+#define TPE hge
+#include "mosaic_select_template.h"
+#undef TPE
 #endif
+#undef NAME
 
 #define projection_loop_raw(TPE, CI_NEXT)\
 {      TPE *rt;\
diff --git a/monetdb5/modules/mosaic/mosaic_runlength.c 
b/monetdb5/modules/mosaic/mosaic_runlength.c
--- a/monetdb5/modules/mosaic/mosaic_runlength.c
+++ b/monetdb5/modules/mosaic/mosaic_runlength.c
@@ -197,15 +197,31 @@ MOSdecompress_DEF(hge)
     }\
 }
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to