Changeset: 7b0d714f5ee2 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b0d714f5ee2
Modified Files:
        geom/monetdb5/geom.c
        geom/monetdb5/geomBulk.c
        geom/monetdb5/sfcgalBulk.c
Branch: sfcgal
Log Message:

BATnew was replaced by COLnew, BATseqbase does not make sense anymore, just 
pass the idx as argument in COLnew


diffs (138 lines):

diff --git a/geom/monetdb5/geom.c b/geom/monetdb5/geom.c
--- a/geom/monetdb5/geom.c
+++ b/geom/monetdb5/geom.c
@@ -1714,7 +1714,7 @@ wkbDump_(bat *parentBAT_id, bat *idBAT_i
                }
 
         if (parent) {
-            if ((parentBAT = BATnew(TYPE_void, ATOMindex("int"), 0, 
TRANSIENT)) == NULL) {
+            if ((parentBAT = COLnew(0, ATOMindex("int"), 0, TRANSIENT)) == 
NULL) {
                 BBPunfix(idBAT->batCacheid);
                 BBPunfix(geomBAT->batCacheid);
                 *parentBAT_id = bat_nil;
@@ -1722,13 +1722,12 @@ wkbDump_(bat *parentBAT_id, bat *idBAT_i
             }
         }
 
-               BATseqbase(idBAT, 0);
                BBPkeepref(*idBAT_id = idBAT->batCacheid);
 
                BBPkeepref(*geomBAT_id = geomBAT->batCacheid);
 
         if (parent) {
-                   BATseqbase(parentBAT, 0);
+                   BAThseqbase(parentBAT, 0);
                BBPkeepref(*parentBAT_id = parentBAT->batCacheid);
         }
 
@@ -1752,12 +1751,11 @@ wkbDump_(bat *parentBAT_id, bat *idBAT_i
        }
 
     if (parent) {
-        if ((parentBAT = BATnew(TYPE_void, ATOMindex("int"), geometriesNum, 
TRANSIENT)) == NULL) {
+        if ((parentBAT = COLnew(0, ATOMindex("int"), geometriesNum, 
TRANSIENT)) == NULL) {
             BBPunfix(idBAT->batCacheid);
             BBPunfix(geomBAT->batCacheid);
             throw(MAL, "geom.Dump", "Error creating new BAT");
         }
-        BATseqbase(parentBAT, 0);
         /*Get the tail and add parentID geometriesNum types*/
         for (i = 0; i < geometriesNum; i++) {
             if (BUNappend(parentBAT, parent, TRUE) != GDK_SUCCEED) {
@@ -6566,22 +6564,21 @@ Intersectssubjoin_intern(bat *lres, bat 
                throw(MAL, "algebra.instersects", RUNTIME_OBJECT_MISSING);
        }
 
-       xl = BATnew(TYPE_void, TYPE_oid, 0, TRANSIENT);
+       xl = COLnew(0, TYPE_oid, 0, TRANSIENT);
        if ( xl == NULL){
                BBPunfix(*lid);
                BBPunfix(*rid);
                throw(MAL, "algebra.instersects", MAL_MALLOC_FAIL);
        }
-       BATseqbase(xl,0);
-
-       xr = BATnew(TYPE_void, TYPE_oid, 0, TRANSIENT);
+       BAThseqbase(xl,0);
+
+       xr = COLnew(0, TYPE_oid, 0, TRANSIENT);
        if ( xr == NULL){
                BBPunfix(*lid);
                BBPunfix(*rid);
                BBPunfix(xl->batCacheid);
                throw(MAL, "algebra.instersects", MAL_MALLOC_FAIL);
        }
-       BATseqbase(xr,0);
 
        /*iterator over the BATs*/
        lBAT_iter = bat_iterator(bl);
diff --git a/geom/monetdb5/geomBulk.c b/geom/monetdb5/geomBulk.c
--- a/geom/monetdb5/geomBulk.c
+++ b/geom/monetdb5/geomBulk.c
@@ -1498,12 +1498,11 @@ wkbAsX3D_bat(bat *outBAT_id, bat *inBAT_
                throw(MAL, "batgeom.SetSRID", "The BAT must have dense head");
        }
        //create a new BAT for the output
-       if ((outBAT = BATnew(TYPE_void, ATOMindex("str"), BATcount(inBAT), 
TRANSIENT)) == NULL) {
+       if ((outBAT = COLnew(inBAT->hseqbase, ATOMindex("str"), 
BATcount(inBAT), TRANSIENT)) == NULL) {
                BBPunfix(inBAT->batCacheid);
                throw(MAL, "batgeom.SetSRID", "Error creating new BAT");
        }
        //set the first idx of the output BAT equal to that of the input BAT
-       BATseqbase(outBAT, inBAT->hseqbase);
 
        //iterator over the BATs
        inBAT_iter = bat_iterator(inBAT);
@@ -1566,15 +1565,12 @@ wkbIntersection_bat(bat *outBAT_id, bat 
     }
     
        //create a new BAT for the output
-       if ((outBAT = BATnew(TYPE_void, ATOMindex("wkb"), BATcount(aBAT), 
TRANSIENT)) == NULL) {
+       if ((outBAT = COLnew(aBAT->hseqbase, ATOMindex("wkb"), BATcount(aBAT), 
TRANSIENT)) == NULL) {
                BBPunfix(aBAT->batCacheid);
                BBPunfix(bBAT->batCacheid);
                throw(MAL, "batgeom.Intersection", "Error creating new BAT");
        }
 
-       //set the first idx of the output BAT equal to that of the input BAT
-       BATseqbase(outBAT, aBAT->hseqbase);
-
        //iterator over the BATs
        aBAT_iter = bat_iterator(aBAT);
        bBAT_iter = bat_iterator(bBAT);
@@ -1662,7 +1658,7 @@ wkbIntersection_bat_s(bat *outBAT_id, ba
        }
     
        //create a new BAT for the output
-       if ((outBAT = BATnew(TYPE_void, ATOMindex("wkb"), BATcount(aBAT), 
TRANSIENT)) == NULL) {
+       if ((outBAT = COLnew(aBAT->hseqbase, ATOMindex("wkb"), BATcount(aBAT), 
TRANSIENT)) == NULL) {
                BBPunfix(aBAT->batCacheid);
                BBPunfix(bBAT->batCacheid);
                BBPunfix(saBAT->batCacheid);
@@ -1670,9 +1666,6 @@ wkbIntersection_bat_s(bat *outBAT_id, ba
                throw(MAL, "batgeom.Intersection", "Error creating new BAT");
        }
 
-       //set the first idx of the output BAT equal to that of the input BAT
-       BATseqbase(outBAT, aBAT->hseqbase);
-
        //iterator over the BATs
        aBAT_iter = bat_iterator(aBAT);
        bBAT_iter = bat_iterator(bBAT);
diff --git a/geom/monetdb5/sfcgalBulk.c b/geom/monetdb5/sfcgalBulk.c
--- a/geom/monetdb5/sfcgalBulk.c
+++ b/geom/monetdb5/sfcgalBulk.c
@@ -30,12 +30,10 @@ geom_sfcgal_triangulate2DZ_bat(bat *outB
                throw(MAL, "batgeom.geom_sfcgal_triangle2DZ", "The BAT must 
have dense head");
        }
        //create a new BAT for the output
-       if ((outBAT = BATnew(TYPE_void, ATOMindex("wkb"), BATcount(inBAT), 
TRANSIENT)) == NULL) {
+       if ((outBAT = COLnew(inBAT->hseqbase, ATOMindex("wkb"), 
BATcount(inBAT), TRANSIENT)) == NULL) {
                BBPunfix(inBAT->batCacheid);
                throw(MAL, "batgeom.geom_sfcgal_triangle2DZ", "Error creating 
new BAT");
        }
-       //set the first idx of the output BAT equal to that of the input BAT
-       BATseqbase(outBAT, inBAT->hseqbase);
 
        //iterator over the BATs
        inBAT_iter = bat_iterator(inBAT);
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to