Changeset: 69cb8e9d0899 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=69cb8e9d0899
Modified Files:
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_private.h
Branch: Jul2017
Log Message:
Cleanup some macros.
diffs (85 lines):
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1764,6 +1764,8 @@ HEAPcommitpersistence(Heap *hp, int writ
}
+#define ATOMappendpriv(t, h) (ATOMstorage(t) != TYPE_str || GDK_ELIMDOUBLES(h))
+
/* change the heap modes at a commit */
gdk_return
BATcheckmodes(BAT *b, int existing)
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -531,7 +531,18 @@ BATappend(BAT *b, BAT *n, BAT *s, bit fo
assert(b->theap.parentid == 0);
ALIGNapp(b, "BATappend", force, GDK_FAIL);
- BATcompatible(b, n, GDK_FAIL, "BATappend");
+
+ if (ATOMstorage(ATOMtype(b->ttype)) != ATOMstorage(ATOMtype(n->ttype)))
{
+ GDKerror("Incompatible operands.\n");
+ return GDK_FAIL;
+ }
+ CHECKDEBUG {
+ if (BATttype(b) != BATttype(n) &&
+ ATOMtype(b->ttype) != ATOMtype(n->ttype)) {
+ fprintf(stderr,"#Interpreting %s as %s.\n",
+ ATOMname(BATttype(n)), ATOMname(BATttype(b)));
+ }
+ }
if (BATcount(b) == 0)
BAThseqbase(b, s ? s->hseqbase : n->hseqbase);
@@ -874,15 +885,6 @@ BATdel(BAT *b, BAT *d)
return GDK_SUCCEED;
}
-#define TYPEcheck(t1,t2,func) \
- do { \
- if (TYPEerror(t1, t2)) { \
- GDKerror("%s: Incompatible types %s and %s.\n", \
- func, ATOMname(t2), ATOMname(t1)); \
- return GDK_FAIL; \
- } \
- } while (0)
-
/*
* The last in this series is a BATreplace, which replaces all the
* buns mentioned.
diff --git a/gdk/gdk_private.h b/gdk/gdk_private.h
--- a/gdk/gdk_private.h
+++ b/gdk/gdk_private.h
@@ -279,8 +279,6 @@ extern MT_Lock GDKthreadLock;
extern MT_Lock GDKtmLock;
extern MT_Lock MT_system_lock;
-#define ATOMappendpriv(t, h) (ATOMstorage(t) != TYPE_str || GDK_ELIMDOUBLES(h))
-
#define BBPdirty(x) (BBP_dirty=(x))
#define BATcheck(tst, msg, err)
\
@@ -300,21 +298,6 @@ extern MT_Lock MT_system_lock;
return (err); \
} \
} while (0)
-#define BATcompatible(P1,P2,E,F) \
- do { \
- ERRORcheck((P1) == NULL, F ": BAT required\n", E); \
- ERRORcheck((P2) == NULL, F ": BAT required\n", E); \
- if (TYPEerror(BATttype(P1),BATttype(P2))) { \
- GDKerror("Incompatible operands.\n"); \
- return (E); \
- } \
- if (BATttype(P1) != BATttype(P2) && \
- ATOMtype((P1)->ttype) != ATOMtype((P2)->ttype)) { \
- CHECKDEBUG fprintf(stderr,"#Interpreting %s as %s.\n", \
- ATOMname(BATttype(P2)),
ATOMname(BATttype(P1))); \
- } \
- } while (0)
-#define TYPEerror(t1,t2) (ATOMstorage(ATOMtype(t1)) !=
ATOMstorage(ATOMtype(t2)))
#define GDKswapLock(x) GDKbatLock[(x)&BBP_BATMASK].swap
#define GDKhashLock(x) GDKbatLock[(x)&BBP_BATMASK].hash
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list