Changeset: 8b43ca0ab186 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8b43ca0ab186
Modified Files:
        gdk/gdk_bat.c
        gdk/gdk_search.c
        gdk/gdk_search.h
Branch: default
Log Message:

Use basetype more consistently when dealing with hash.


diffs (102 lines):

diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1320,7 +1320,7 @@ BUNfnd(BAT *b, const void *v)
                        return SORTfnd(b, v);
        }
        bi = bat_iterator(b);
-       switch (ATOMstorage(b->ttype)) {
+       switch (ATOMbasetype(b->ttype)) {
        case TYPE_bte:
                HASHfnd_bte(r, bi, v);
                break;
@@ -1328,10 +1328,14 @@ BUNfnd(BAT *b, const void *v)
                HASHfnd_sht(r, bi, v);
                break;
        case TYPE_int:
-       case TYPE_flt:
                HASHfnd_int(r, bi, v);
                break;
+       case TYPE_flt:
+               HASHfnd_flt(r, bi, v);
+               break;
        case TYPE_dbl:
+               HASHfnd_dbl(r, bi, v);
+               break;
        case TYPE_lng:
                HASHfnd_lng(r, bi, v);
                break;
diff --git a/gdk/gdk_search.c b/gdk/gdk_search.c
--- a/gdk/gdk_search.c
+++ b/gdk/gdk_search.c
@@ -467,24 +467,16 @@ BAThash(BAT *b, BUN masksize)
                        case TYPE_sht:
                                starthash(sht);
                                break;
+                       case TYPE_flt:
+                               starthash(flt);
+                               break;
                        case TYPE_int:
-                       case TYPE_flt:
-#if SIZEOF_OID == SIZEOF_INT
-                       case TYPE_oid:
-#endif
-#if SIZEOF_WRD == SIZEOF_INT
-                       case TYPE_wrd:
-#endif
                                starthash(int);
                                break;
                        case TYPE_dbl:
+                               starthash(dbl);
+                               break;
                        case TYPE_lng:
-#if SIZEOF_OID == SIZEOF_LNG
-                       case TYPE_oid:
-#endif
-#if SIZEOF_WRD == SIZEOF_LNG
-                       case TYPE_wrd:
-#endif
                                starthash(lng);
                                break;
 #ifdef HAVE_HGE
@@ -517,23 +509,15 @@ BAThash(BAT *b, BUN masksize)
                        finishhash(sht);
                        break;
                case TYPE_int:
-               case TYPE_flt:
-#if SIZEOF_OID == SIZEOF_INT
-               case TYPE_oid:
-#endif
-#if SIZEOF_WRD == SIZEOF_INT
-               case TYPE_wrd:
-#endif
                        finishhash(int);
                        break;
+               case TYPE_flt:
+                       finishhash(flt);
+                       break;
                case TYPE_dbl:
+                       finishhash(dbl);
+                       break;
                case TYPE_lng:
-#if SIZEOF_OID == SIZEOF_LNG
-               case TYPE_oid:
-#endif
-#if SIZEOF_WRD == SIZEOF_LNG
-               case TYPE_wrd:
-#endif
                        finishhash(lng);
                        break;
 #ifdef HAVE_HGE
diff --git a/gdk/gdk_search.h b/gdk/gdk_search.h
--- a/gdk/gdk_search.h
+++ b/gdk/gdk_search.h
@@ -205,6 +205,8 @@ gdk_export BUN HASHlist(Hash *h, BUN i);
 #ifdef HAVE_HGE
 #define HASHfnd_hge(x,y,z)     HASHfnd_TYPE(x,y,z,hge)
 #endif
+#define HASHfnd_flt(x,y,z)     HASHfnd_TYPE(x,y,z,flt)
+#define HASHfnd_dbl(x,y,z)     HASHfnd_TYPE(x,y,z,dbl)
 
 /*
  * A new entry is added with HASHins using the BAT, the BUN index, and
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to