Changeset: 04e3babe57d2 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=04e3babe57d2 Modified Files: monetdb5/modules/mal/batExtensions.c monetdb5/modules/mal/batExtensions.h Branch: default Log Message:
Clean up: remove functions that are no longer used. diffs (214 lines): diff --git a/monetdb5/modules/mal/batExtensions.c b/monetdb5/modules/mal/batExtensions.c --- a/monetdb5/modules/mal/batExtensions.c +++ b/monetdb5/modules/mal/batExtensions.c @@ -193,57 +193,6 @@ CMDBATnewint(Client cntxt, MalBlkPtr m, return (str) BKCnewBAT(res, &ht, &tt, &cap); } -str -CMDBBPproject(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ - int *result, *bid, tt; - ptr *p; - BAT *b, *bn; - - (void) cntxt; - result = (int *) getArgReference(stk, pci, 0); - bid = (int *) getArgReference(stk, pci, 1); - p = (ptr *) getArgReference(stk, pci, 2); - tt = getArgType(mb, pci, 2); - if ((b = BATdescriptor(*bid)) == NULL) { - throw(MAL, "bat.project", INTERNAL_BAT_ACCESS); - } - - if (tt >= TYPE_str) { - if (p == 0 || *(str *) p == 0) - p = (ptr *) str_nil; - else - p = *(ptr **) p; - } - bn = BATconst(b, tt, p); - BBPunfix(b->batCacheid); - if (bn) { - *result = bn->batCacheid; - BBPkeepref(bn->batCacheid); - return MAL_SUCCEED; - } - throw(MAL, "bat.project", INTERNAL_OBJ_CREATE); -} - -str -CMDBBPprojectNil(int *ret, int *bid) -{ - BAT *b, *bn; - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(MAL, "bat.project", INTERNAL_BAT_ACCESS); - } - - bn = BATconst(b, TYPE_void, (ptr) &int_nil); - BBPunfix(b->batCacheid); - if (bn) { - *ret = bn->batCacheid; - BBPkeepref(bn->batCacheid); - return MAL_SUCCEED; - } - throw(MAL, "bat.project", INTERNAL_OBJ_CREATE); -} - /* * @- * If the optimizer has not determined the partition bounds we derive one here. @@ -333,132 +282,3 @@ CMDbatpartition2(Client cntxt, MalBlkPtr BBPunfix(b->batCacheid); return MAL_SUCCEED; } - -str -CMDsetBase(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ - int i; - oid o= 0; - BAT *b; - (void) mb; - (void) cntxt; - - for( i= pci->retc; i < pci->argc; i++){ - b= BATdescriptor(*(int*) getArgReference(stk,pci,i)); - if( b == NULL) - throw(MAL,"bat.setBase",INTERNAL_BAT_ACCESS); - BATseqbase(b,o); - o= o + (oid) BATcount(b); - BBPunfix(b->batCacheid); - } - return MAL_SUCCEED; -} - -/* - * The fetch operations are all pretty straight forward, provided - * you know the underlying type. Often it is cheaper to use - * the extended BAT iterator, because then it can re-use the - * BAT descriptor. - */ -str -CMDgetHead(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ - BAT *b; - oid *cursor; - int *bid; - BUN limit; - ValPtr head; - oid o; - - (void) cntxt; - cursor = (oid *) getArgReference(stk, pci, 2); - bid = (int *) getArgReference(stk, pci, 1); - head = getArgReference(stk,pci,0); - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(MAL, "chop.getHead", INTERNAL_BAT_ACCESS); - } - limit = BUNlast(b); - if (*cursor == oid_nil || *cursor >= (oid) limit) { - BBPunfix(b->batCacheid); - throw(MAL, "mal.getHead", RANGE_ERROR); - } - - /* get head = ... */ - if( getArgType(mb,pci,3) == TYPE_void){ - o = (oid)*cursor + b->hseqbase; - VALinit(head, TYPE_oid, &o); - } else { - BATiter bi = bat_iterator(b); - VALinit(head, getArgType(mb, pci, 3), BUNhead(bi, (BUN)*cursor)); - } - BBPunfix(b->batCacheid); - return MAL_SUCCEED; -} - -str -CMDgetTail(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ - BATiter bi; - BAT *b; - oid *cursor; - int *bid; - BUN limit; - ValPtr tail; - - (void) cntxt; - cursor = (oid *) getArgReference(stk, pci, 2); - bid = (int *) getArgReference(stk, pci, 1); - tail = getArgReference(stk,pci,0); - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(MAL, "chop.getTail", INTERNAL_BAT_ACCESS); - } - limit = BUNlast(b); - if (*cursor == oid_nil || *cursor >= (oid) limit) { - BBPunfix(b->batCacheid); - throw(OUTOFBNDS, "mal.getTail", RANGE_ERROR); - } - - /* get tail = ... */ - bi = bat_iterator(b); - VALinit(tail, getArgType(mb, pci, 3), BUNtail(bi, (BUN)*cursor)); - BBPunfix(b->batCacheid); - return MAL_SUCCEED; -} - -str -ALGprojectCstBody(bat *result, int *bid, ptr *p, int tt){ - BAT *b, *bn; - - if ((b = BATdescriptor(*bid)) == NULL) { - throw(MAL, "bbp.project", INTERNAL_BAT_ACCESS); - } - - if (ATOMvarsized(tt)) { - if (p == 0 || *(str *) p == 0) - p = (ptr *) str_nil; - else - p = *(ptr **) p; - } - bn = BATconst(b, tt, p); - BBPunfix(b->batCacheid); - if (bn) { - *result = bn->batCacheid; - BBPkeepref(bn->batCacheid); - return MAL_SUCCEED; - } - throw(MAL, "bbp.project", INTERNAL_OBJ_CREATE); -} - -str -ALGprojectCst(Client cntxt,MalBlkPtr mb, MalStkPtr stk, InstrPtr pci) -{ - int *result = (int *) getArgReference(stk, pci, 0); - int *bid = (int *) getArgReference(stk, pci, 1); - ptr *p = (ptr *) getArgReference(stk, pci, 2); - int tt = getArgType(mb, pci, 2); - - (void) cntxt; - return ALGprojectCstBody(result, bid, p, tt); -} diff --git a/monetdb5/modules/mal/batExtensions.h b/monetdb5/modules/mal/batExtensions.h --- a/monetdb5/modules/mal/batExtensions.h +++ b/monetdb5/modules/mal/batExtensions.h @@ -41,16 +41,7 @@ be_export str CMDBATnew(Client cntxt, Ma be_export str CMDBATnewDerived(Client cntxt, MalBlkPtr m, MalStkPtr s, InstrPtr p); be_export str CMDBATderivedByName(int *ret, str *nme); be_export str CMDBATnewint(Client cntxt, MalBlkPtr m, MalStkPtr s, InstrPtr p); -be_export str CMDBBPproject(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); -be_export str CMDBBPprojectNil(int *ret, int *bid); be_export str CMDbatpartition(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); be_export str CMDbatpartition2(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); -be_export str CMDsetBase(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); - -be_export str CMDgetHead(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); -be_export str CMDgetTail(Client cntxt, MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); - -be_export str ALGprojectCst(Client cntxt,MalBlkPtr mb, MalStkPtr stk, InstrPtr pci); -be_export str ALGprojectCstBody(bat *result, int *bid, ptr *p, int tt); #endif /* _BAT_EXTENSIONS_ */ _______________________________________________ Checkin-list mailing list Checkin-list@monetdb.org http://mail.monetdb.org/mailman/listinfo/checkin-list