Changeset: f6f8e065caed for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=f6f8e065caed
Modified Files:
gdk/gdk.h
gdk/gdk_atoms.c
gdk/gdk_atoms.h
gdk/gdk_join.c
Branch: default
Log Message:
Also removed macros simple_CMP and simple_EQ.
diffs (100 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -2768,7 +2768,7 @@ gdk_export void ALIGNsetT(BAT *b1, BAT *
for (hb = HASHget(h, hash_##TYPE(h, v)); \
hb != HASHnil(h); \
hb = HASHgetlink(h,hb)) \
- if (simple_EQ(v, BUNtloc(bi, hb), TYPE))
+ if (* (const TYPE *) v == * (const TYPE *) BUNtloc(bi, hb))
#define HASHloop_bte(bi, h, hb, v) HASHloop_TYPE(bi, h, hb, v, bte)
#define HASHloop_sht(bi, h, hb, v) HASHloop_TYPE(bi, h, hb, v, sht)
diff --git a/gdk/gdk_atoms.c b/gdk/gdk_atoms.c
--- a/gdk/gdk_atoms.c
+++ b/gdk/gdk_atoms.c
@@ -34,45 +34,45 @@
static int
bteCmp(const bte *l, const bte *r)
{
- return simple_CMP(l, r, bte);
+ return (*l > *r) - (*l < *r);
}
static int
shtCmp(const sht *l, const sht *r)
{
- return simple_CMP(l, r, sht);
+ return (*l > *r) - (*l < *r);
}
static int
intCmp(const int *l, const int *r)
{
- return simple_CMP(l, r, int);
+ return (*l > *r) - (*l < *r);
}
static int
fltCmp(const flt *l, const flt *r)
{
- return simple_CMP(l, r, flt);
+ return (*l > *r) - (*l < *r);
}
static int
lngCmp(const lng *l, const lng *r)
{
- return simple_CMP(l, r, lng);
+ return (*l > *r) - (*l < *r);
}
#ifdef HAVE_HGE
static int
hgeCmp(const hge *l, const hge *r)
{
- return simple_CMP(l, r, hge);
+ return (*l > *r) - (*l < *r);
}
#endif
static int
dblCmp(const dbl *l, const dbl *r)
{
- return simple_CMP(l, r, dbl);
+ return (*l > *r) - (*l < *r);
}
/*
diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h
--- a/gdk/gdk_atoms.h
+++ b/gdk/gdk_atoms.h
@@ -12,16 +12,6 @@
#define MAXATOMS 128
/*
- * @- comparison macro's
- * In order to get maximum performance, we extensively use
- * out-factoring of type checks using CPP macros. To catch diverging
- * code in one CPP macro we use the following #defines for comparing
- * atoms:
- */
-#define simple_CMP(x,y,tpe) (((*(const tpe*) (x)) > (*(const tpe*) (y))) -
((*(const tpe*) (x)) < (*(const tpe*) (y))))
-#define simple_EQ(x,y,tpe) ((*(const tpe*) (x)) == (*(const tpe*) (y)))
-
-/*
* @- maximum atomic string lengths
*/
#define bitStrlen 8
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -2387,7 +2387,7 @@ binsearchcand(const oid *cand, BUN lo, B
hb != HASHnil(h); \
hb = HASHgetlink(h,hb)) \
if (hb >= (lo) && hb < (hi) && \
- simple_EQ(v, BUNtloc(bi, hb), TYPE))
+ * (const TYPE *) v == * (const TYPE *) BUNtloc(bi, hb))
#define HASHJOIN(TYPE, WIDTH) \
do { \
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list