Changeset: c8e444562382 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=c8e444562382
Modified Files:
gdk/gdk_select.c
monetdb5/modules/mal/urlbox.c
monetdb5/optimizer/opt_statistics.c
sql/backends/monet5/datacell/basket.c
sql/backends/monet5/datacell/emitter.c
sql/backends/monet5/datacell/petrinet.c
sql/backends/monet5/datacell/receptor.c
sql/backends/monet5/sql.c
Branch: Jan2014
Log Message:
Cleanup: use void-headed BATs where possible.
diffs (truncated from 349 to 300 lines):
diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c
--- a/gdk/gdk_select.c
+++ b/gdk/gdk_select.c
@@ -60,7 +60,6 @@ BATslice2(BAT *b, BUN l1, BUN h1, BUN l2
BUN p, q;
BAT *bn;
BATiter bi = bat_iterator(b);
- int tt = b->ttype;
BATcheck(b, "BATslice");
if (h2 > BATcount(b))
@@ -79,31 +78,21 @@ BATslice2(BAT *b, BUN l1, BUN h1, BUN l2
return NULL;
}
- if (tt == TYPE_void && b->T->seq != oid_nil)
- tt = TYPE_oid;
- bn = BATnew(ATOMtype(b->htype), tt, h1 - l1 + h2 - l2);
+ bn = BATnew(TYPE_void, ATOMtype(b->htype), h1 - l1 + h2 - l2);
if (bn == NULL)
return bn;
for (p = (BUN) l1, q = (BUN) h1; p < q; p++) {
- bunfastins(bn, BUNhead(bi, p), BUNtail(bi, p));
+ bunfastins(bn, NULL, BUNhead(bi, p));
}
for (p = (BUN) l2, q = (BUN) h2; p < q; p++) {
- bunfastins(bn, BUNhead(bi, p), BUNtail(bi, p));
+ bunfastins(bn, NULL, BUNhead(bi, p));
}
- bn->hsorted = BAThordered(b);
- bn->tsorted = BATtordered(b);
- bn->hrevsorted = BAThrevordered(b);
- bn->trevsorted = BATtrevordered(b);
- BATkey(bn, BAThkey(b));
- BATkey(BATmirror(bn), BATtkey(b));
- bn->H->nonil = b->H->nonil;
- bn->T->nonil = b->T->nonil;
- if (bn->hkey && bn->htype == TYPE_oid) {
- if (BATcount(bn) == 0) {
- bn->hdense = TRUE;
- BATseqbase(bn, 0);
- }
- }
+ BATseqbase(bn, 0);
+ bn->tsorted = BAThordered(b);
+ bn->trevsorted = BAThrevordered(b);
+ BATkey(BATmirror(bn), BAThkey(b));
+ bn->T->nonil = b->H->nonil;
+ bn->T->nil = 0;
if (bn->tkey && bn->ttype == TYPE_oid) {
if (BATcount(bn) == 0) {
bn->tdense = TRUE;
@@ -1225,10 +1214,9 @@ BATsubselect(BAT *b, BAT *s, const void
} else {
v = VIEWhead(b); /* [oid,nil] */
}
- bn = BATslice(v, low, high);
+ bn = BATmirror(BATslice(v, low, high));
}
BBPunfix(v->batCacheid);
- bn = BATmirror(bn);
bn->hseqbase = 0;
bn->hkey = 1;
bn->hsorted = 1;
diff --git a/monetdb5/modules/mal/urlbox.c b/monetdb5/modules/mal/urlbox.c
--- a/monetdb5/modules/mal/urlbox.c
+++ b/monetdb5/modules/mal/urlbox.c
@@ -456,7 +456,7 @@ URLBOXgetCount(int *r){
int i;
lng cnt;
- b= BATnew(TYPE_oid,TYPE_lng, urlDepth+1);
+ b= BATnew(TYPE_void,TYPE_lng, urlDepth+1);
if( b== NULL)
throw(MAL, "urlbox.getNames", MAL_MALLOC_FAIL);
BATseqbase(b,0);
diff --git a/monetdb5/optimizer/opt_statistics.c
b/monetdb5/optimizer/opt_statistics.c
--- a/monetdb5/optimizer/opt_statistics.c
+++ b/monetdb5/optimizer/opt_statistics.c
@@ -36,7 +36,7 @@ static BAT *qotStat[4] = { NULL };
static MT_Lock qotlock MT_LOCK_INITIALIZER("qotlock");
static BAT *
-QOT_create(str hnme, str tnme, int ht, int tt)
+QOT_create(str hnme, str tnme, int tt)
{
BAT *b;
char buf[128];
@@ -46,7 +46,7 @@ QOT_create(str hnme, str tnme, int ht, i
if (b)
return b;
- b = BATnew(ht, tt, 256);
+ b = BATnew(TYPE_void, tt, 256);
if (b == NULL)
return NULL;
@@ -66,13 +66,13 @@ static void QOTstatisticsInit(void){
#endif
MT_lock_set(&qotlock, "QOT statistics");
- qotStat[QOTnames]= QOT_create("opt","names",TYPE_void,TYPE_str);
+ qotStat[QOTnames]= QOT_create("opt","names",TYPE_str);
BATseqbase(qotStat[QOTnames],o);
- qotStat[QOTcalls]= QOT_create("opt","calls",TYPE_void,TYPE_int);
+ qotStat[QOTcalls]= QOT_create("opt","calls",TYPE_int);
BATseqbase(qotStat[QOTcalls],o);
- qotStat[QOTactions]= QOT_create("opt","actions",TYPE_void,TYPE_int);
+ qotStat[QOTactions]= QOT_create("opt","actions",TYPE_int);
BATseqbase(qotStat[QOTactions],o);
- qotStat[QOTtimings]= QOT_create("opt","timings",TYPE_void,TYPE_lng);
+ qotStat[QOTtimings]= QOT_create("opt","timings",TYPE_lng);
BATseqbase(qotStat[QOTtimings],o);
/* recover from errors */
diff --git a/sql/backends/monet5/datacell/basket.c
b/sql/backends/monet5/datacell/basket.c
--- a/sql/backends/monet5/datacell/basket.c
+++ b/sql/backends/monet5/datacell/basket.c
@@ -584,40 +584,40 @@ BSKTtable(int *nameId, int *thresholdId,
BAT *timeslice = NULL, *timestride = NULL;
int i;
- name = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ name = BATnew(TYPE_void, TYPE_str, BATTINY);
if (name == 0)
goto wrapup;
BATseqbase(name, 0);
- threshold = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ threshold = BATnew(TYPE_void, TYPE_int, BATTINY);
if (threshold == 0)
goto wrapup;
BATseqbase(threshold, 0);
- winsize = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ winsize = BATnew(TYPE_void, TYPE_int, BATTINY);
if (winsize == 0)
goto wrapup;
BATseqbase(winsize, 0);
- winstride = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ winstride = BATnew(TYPE_void, TYPE_int, BATTINY);
if (winstride == 0)
goto wrapup;
BATseqbase(winstride, 0);
- beat = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ beat = BATnew(TYPE_void, TYPE_int, BATTINY);
if (beat == 0)
goto wrapup;
BATseqbase(beat, 0);
- seen = BATnew(TYPE_oid, TYPE_timestamp, BATTINY);
+ seen = BATnew(TYPE_void, TYPE_timestamp, BATTINY);
if (seen == 0)
goto wrapup;
BATseqbase(seen, 0);
- events = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ events = BATnew(TYPE_void, TYPE_int, BATTINY);
if (events == 0)
goto wrapup;
BATseqbase(events, 0);
- timeslice = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ timeslice = BATnew(TYPE_void, TYPE_int, BATTINY);
if (timeslice == 0)
goto wrapup;
BATseqbase(timeslice, 0);
- timestride = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ timestride = BATnew(TYPE_void, TYPE_int, BATTINY);
if (timestride == 0)
goto wrapup;
BATseqbase(timestride, 0);
diff --git a/sql/backends/monet5/datacell/emitter.c
b/sql/backends/monet5/datacell/emitter.c
--- a/sql/backends/monet5/datacell/emitter.c
+++ b/sql/backends/monet5/datacell/emitter.c
@@ -448,44 +448,44 @@ EMtable(int *nameId, int *hostId, int *p
BAT *protocol = NULL, *mode = NULL, *status = NULL, *port = NULL, *host
= NULL;
Emitter em = emAnchor;
- name = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ name = BATnew(TYPE_void, TYPE_str, BATTINY);
if (name == 0)
goto wrapup;
BATseqbase(name, 0);
- host = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ host = BATnew(TYPE_void, TYPE_str, BATTINY);
if (host == 0)
goto wrapup;
BATseqbase(host, 0);
- port = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ port = BATnew(TYPE_void, TYPE_int, BATTINY);
if (port == 0)
goto wrapup;
BATseqbase(port, 0);
- protocol = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ protocol = BATnew(TYPE_void, TYPE_str, BATTINY);
if (protocol == 0)
goto wrapup;
BATseqbase(protocol, 0);
- mode = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ mode = BATnew(TYPE_void, TYPE_str, BATTINY);
if (mode == 0)
goto wrapup;
BATseqbase(mode, 0);
- seen = BATnew(TYPE_oid, TYPE_timestamp, BATTINY);
+ seen = BATnew(TYPE_void, TYPE_timestamp, BATTINY);
if (seen == 0)
goto wrapup;
BATseqbase(seen, 0);
- cycles = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ cycles = BATnew(TYPE_void, TYPE_int, BATTINY);
if (cycles == 0)
goto wrapup;
BATseqbase(cycles, 0);
- pending = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ pending = BATnew(TYPE_void, TYPE_int, BATTINY);
if (pending == 0)
goto wrapup;
BATseqbase(pending, 0);
- sent = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ sent = BATnew(TYPE_void, TYPE_int, BATTINY);
if (sent == 0)
goto wrapup;
BATseqbase(sent, 0);
- status = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ status = BATnew(TYPE_void, TYPE_str, BATTINY);
if (status == 0)
goto wrapup;
BATseqbase(status, 0);
diff --git a/sql/backends/monet5/datacell/petrinet.c
b/sql/backends/monet5/datacell/petrinet.c
--- a/sql/backends/monet5/datacell/petrinet.c
+++ b/sql/backends/monet5/datacell/petrinet.c
@@ -666,35 +666,35 @@ PNtable(int *nameId, int *statusId, int
BAT *name = NULL, *def = NULL, *status = NULL, *seen = NULL, *cycles =
NULL, *events = NULL, *time = NULL, *error = NULL;
int i;
- name = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ name = BATnew(TYPE_void, TYPE_str, BATTINY);
if (name == 0)
goto wrapup;
BATseqbase(name, 0);
- def = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ def = BATnew(TYPE_void, TYPE_str, BATTINY);
if (def == 0)
goto wrapup;
BATseqbase(def, 0);
- status = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ status = BATnew(TYPE_void, TYPE_str, BATTINY);
if (status == 0)
goto wrapup;
BATseqbase(status, 0);
- seen = BATnew(TYPE_oid, TYPE_timestamp, BATTINY);
+ seen = BATnew(TYPE_void, TYPE_timestamp, BATTINY);
if (seen == 0)
goto wrapup;
BATseqbase(seen, 0);
- cycles = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ cycles = BATnew(TYPE_void, TYPE_int, BATTINY);
if (cycles == 0)
goto wrapup;
BATseqbase(cycles, 0);
- events = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ events = BATnew(TYPE_void, TYPE_int, BATTINY);
if (events == 0)
goto wrapup;
BATseqbase(events, 0);
- time = BATnew(TYPE_oid, TYPE_lng, BATTINY);
+ time = BATnew(TYPE_void, TYPE_lng, BATTINY);
if (time == 0)
goto wrapup;
BATseqbase(time, 0);
- error = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ error = BATnew(TYPE_void, TYPE_str, BATTINY);
if (error == 0)
goto wrapup;
BATseqbase(error, 0);
diff --git a/sql/backends/monet5/datacell/receptor.c
b/sql/backends/monet5/datacell/receptor.c
--- a/sql/backends/monet5/datacell/receptor.c
+++ b/sql/backends/monet5/datacell/receptor.c
@@ -903,44 +903,44 @@ RCtable(int *nameId, int *hostId, int *p
BAT *protocol = NULL, *mode = NULL, *status = NULL, *port = NULL, *host
= NULL;
Receptor rc = rcAnchor;
- name = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ name = BATnew(TYPE_void, TYPE_str, BATTINY);
if (name == 0)
goto wrapup;
BATseqbase(name, 0);
- host = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ host = BATnew(TYPE_void, TYPE_str, BATTINY);
if (host == 0)
goto wrapup;
BATseqbase(host, 0);
- port = BATnew(TYPE_oid, TYPE_int, BATTINY);
+ port = BATnew(TYPE_void, TYPE_int, BATTINY);
if (port == 0)
goto wrapup;
BATseqbase(port, 0);
- protocol = BATnew(TYPE_oid, TYPE_str, BATTINY);
+ protocol = BATnew(TYPE_void, TYPE_str, BATTINY);
if (protocol == 0)
goto wrapup;
BATseqbase(protocol, 0);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list