Update of /cvsroot/monetdb/MonetDB5/src/modules/mal/crackers
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv29611

Modified Files:
        crackers.mx crackers_AVL_index.mx crackers_AVL_tree.mx 
        crackers_core_ordered.mx crackers_index.mx crackers_joins.mx 
        crackers_select_ops.mx crackers_sideways.mx 
        crackers_validation.mx 
Log Message:
fixed many/all? of the other compliler warnings/errors


Index: crackers_AVL_index.mx
===================================================================
RCS file: 
/cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers_AVL_index.mx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- crackers_AVL_index.mx       14 Jan 2008 22:24:14 -0000      1.4
+++ crackers_AVL_index.mx       15 Jan 2008 11:05:05 -0000      1.5
@@ -109,8 +109,8 @@
 str
 [EMAIL PROTECTED](int *k, int *bid){
        BUN last, cur;
-       int indexPos;
-       lng curPos;
+       oid indexPos;
+       oid curPos;
        BAT *b;
 
        (void) k;
@@ -168,7 +168,7 @@
        BAT *b, *result;
        int indexPos;
        struct Node *cur;
-       lng  resSize;
+       oid  resSize;
        BUN first; 
        oid *resh;
        @1 *rest;
@@ -342,7 +342,7 @@
 }
 
 static void
[EMAIL PROTECTED](int m,  lng position, BAT * b){
[EMAIL PROTECTED](int m,  oid position, BAT * b){
         BUN base;
 
         if (position == 0){
@@ -365,11 +365,11 @@
         [EMAIL PROTECTED](m, position, *(@1*)Tloc(b,base+position), 
AVLIndex[m].Tree, b, base);
 }
 
-static lng 
[EMAIL PROTECTED](@1 *low, @1 *hgh, bit *inclusiveLow, bit *inclusiveHgh, lng 
resSize, BAT *b, BUN first, struct Node * cur, oid *resh, @1 *rest, @1 prevL){
+static oid 
[EMAIL PROTECTED](@1 *low, @1 *hgh, bit *inclusiveLow, bit *inclusiveHgh, oid 
resSize, BAT *b, BUN first, struct Node * cur, oid *resh, @1 *rest, @1 prevL){
        oid *rh = resh;
        @1  *rt = rest;
-       lng size = resSize;
+       oid size = resSize;
        
        @1 value = *(@1*)Tloc(b,first+cur->position);
        if (cur->deleted == FALSE){

Index: crackers_AVL_tree.mx
===================================================================
RCS file: 
/cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers_AVL_tree.mx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- crackers_AVL_tree.mx        14 Jan 2008 22:24:15 -0000      1.4
+++ crackers_AVL_tree.mx        15 Jan 2008 11:05:05 -0000      1.5
@@ -298,9 +298,9 @@
        }
        cur = base + current->position;
        if (current->deleted == FALSE) {
-               printf("\n index: "SZFMT", indexLocal: "SZFMT", Val: %d, 
pieceID: %d  ", *(oid*)Hloc(b, cur), current->indexLocal, *(int*)Tloc(b, cur), 
current->pieceBAT);
+               printf("\n index: "OIDFMT", indexLocal: "OIDFMT", Val: %d, 
pieceID: %d  ", *(oid*)Hloc(b, cur), current->indexLocal, *(int*)Tloc(b, cur), 
current->pieceBAT);
        } else
-               printf("\n DELETED "SZFMT", %d  Hols:"SZFMT" ", *(oid*)Hloc(b, 
cur), *(int*)Tloc(b, cur), current->hols );
+               printf("\n DELETED "OIDFMT", %d  Hols:"OIDFMT , *(oid*)Hloc(b, 
cur), *(int*)Tloc(b, cur), current->hols );
        if (current->localBound == TRUE) printf(" local: TRUE ");       
        else printf(" local: FALSE ");
        if (current->first == TRUE) printf(" first: TRUE ");    
@@ -321,9 +321,9 @@
 
        cur = base + current->position;
        if (current->deleted == FALSE) {
-               printf("\n Pos: "SZFMT", PosBat: "SZFMT", Val: %d,  Hols: 
"SZFMT", Slice: %d ", current->position, *(oid*)Hloc(b, cur), *(int*)Tloc(b, 
cur), current->hols, current->slice );
+               printf("\n Pos: "OIDFMT", PosBat: "OIDFMT", Val: %d,  Hols: 
"OIDFMT", Slice: %d ", current->position, *(oid*)Hloc(b, cur), *(int*)Tloc(b, 
cur), current->hols, current->slice );
        } else
-               printf("\n DELETED "SZFMT", %d  Hols:"SZFMT" ", *(oid*)Hloc(b, 
cur), *(int*)Tloc(b, cur), current->hols );
+               printf("\n DELETED "OIDFMT", %d  Hols:"OIDFMT , *(oid*)Hloc(b, 
cur), *(int*)Tloc(b, cur), current->hols );
        
        if (current->left != NULL)
                 printAVLTree(current->left, b, base);

Index: crackers_validation.mx
===================================================================
RCS file: 
/cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers_validation.mx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- crackers_validation.mx      14 Jan 2008 22:24:15 -0000      1.4
+++ crackers_validation.mx      15 Jan 2008 11:05:06 -0000      1.5
@@ -156,7 +156,7 @@
        int position = -1;
        BUN idxFirst, crkFirst, cur;
        @1 *crkt, *idxt, *crkLast, *bnd;
-       lng *idxh;
+       oid *idxh;
        struct Node * hghIndexNode;
        bit prevIncl;
        @1 prevVal;
@@ -192,7 +192,7 @@
 
        indexEntries++;
        cur = idxFirst + hghIndexNode->position;
-       idxh = (lng*)Hloc(c, cur);
+       idxh = (oid*)Hloc(c, cur);
        idxt = (@1 *)Tloc(c, cur);
        bnd  = (@1 *)Tloc(b, crkFirst + (*idxh - hghIndexNode->hols));
 
@@ -220,7 +220,7 @@
                        break;
                indexEntries++;
                cur = idxFirst + hghIndexNode->position;
-               idxh = (lng*)Hloc(c, cur);
+               idxh = (oid*)Hloc(c, cur);
                idxt = (@1 *)Tloc(c, cur);
                bnd  = (@1 *)Tloc(b, crkFirst + (*idxh - hghIndexNode->hols));
 

Index: crackers_select_ops.mx
===================================================================
RCS file: 
/cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers_select_ops.mx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- crackers_select_ops.mx      14 Jan 2008 22:24:15 -0000      1.4
+++ crackers_select_ops.mx      15 Jan 2008 11:05:06 -0000      1.5
@@ -493,9 +493,9 @@
        BAT *b,*c,*bo;
        BAT *view;
        int  m;
-       oid vl, vh, posl, posh;
+       oid vl=0, vh=0, posl, posh;
        /* vl and vh are the low and high index values to create the view with 
the result */
-       oid cl1, ch1, cl2, ch2;
+       oid cl1=0, ch1=0, cl2=0, ch2=0;
        /* index values in the case we have to crack
                |cl1...........ch1|.....................|cl2.........ch2|
                if we have to crack only one piece, i.e., if our range falls
@@ -582,7 +582,7 @@
                        throw(MAL, "crackers.crackRange", "Cannot access 
cracker BAT");
        
                posl = BUNfirst(b);
-               posh = BUNlast(b)-(oid)1;
+               posh = BUNlast(b)-1;
 
                @:crkThreeTree(@1,posl,posh)@
                goto createView;
@@ -730,8 +730,8 @@
        BAT *b,*c,*bo;
        BAT *view;
        int  m;
-       oid vl=-1, vh=-1;
-       oid cl2, ch2;
+       oid vl=0, vh=0;
+       oid cl2=0, ch2=0;
        bit HBound,foundHgh=0;
        int gapH = 1;
        
@@ -826,8 +826,8 @@
        BAT *b,*c,*bo;
        BAT *view;
        int  m;
-       oid vl=-1, vh=-1;
-       oid cl1, ch1;
+       oid vl=0, vh=0;
+       oid cl1=0, ch1=0;
        bit foundLow=0;
        int gapL = 1;
        

Index: crackers_joins.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers_joins.mx,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- crackers_joins.mx   14 Jan 2008 22:24:15 -0000      1.1
+++ crackers_joins.mx   15 Jan 2008 11:05:06 -0000      1.2
@@ -375,7 +375,7 @@
        }                               
        [EMAIL PROTECTED] = [EMAIL PROTECTED] + [EMAIL PROTECTED]>position;
         [EMAIL PROTECTED] =  *(@1 *)Tloc([EMAIL PROTECTED], [EMAIL PROTECTED]);
-        [EMAIL PROTECTED]   =  *(lng*)Hloc([EMAIL PROTECTED], [EMAIL 
PROTECTED]);
+        [EMAIL PROTECTED]   =  *(oid*)Hloc([EMAIL PROTECTED], [EMAIL 
PROTECTED]);
 @
 
 
@@ -527,11 +527,11 @@
 
        curTupleLeft = baseLeft + curNodeLeft->position;
         curValueLeft =  *(@1*)Tloc(indexLeft, curTupleLeft);
-        curPosLeft   = *(lng*)Hloc(indexLeft, curTupleLeft);
+        curPosLeft   = *(oid*)Hloc(indexLeft, curTupleLeft);
 
         curTupleRight = baseRight + curNodeRight->position;
         curValueRight =  *(@1*)Tloc(indexRight, curTupleRight);
-        curPosRight   = *(lng*)Hloc(indexRight, curTupleRight);
+        curPosRight   = *(oid*)Hloc(indexRight, curTupleRight);
 
        @:JoinTwoPieces()@
        
@@ -584,7 +584,7 @@
        bit crackedRight;
 
        BAT *res;
-       oid newPosition;
+       oid newPosition=0;
 
        lng crackedOperationsLeft = 0 , crackedOperationsRight = 0, joinsDone = 
0;
 
@@ -876,7 +876,7 @@
        bit crackedRight, existsHashTableRight;
 
        BAT *res;
-       oid newPosition;
+       oid newPosition=0;
 
        lng crackedOperationsLeft = 0 , crackedOperationsRight = 0, joinsDone = 
0;
 
@@ -1371,11 +1371,11 @@
        oid numberOfTuplesLeft;
        bit HBound;     
        @1 low, hgh;
-       oid vl, vh, posl, posh, _vl;
-       oid cl1, ch1, cl2, ch2;
+       oid vl=0, vh=0, posl, posh, _vl;
+       oid cl1=0, ch1=0, cl2=0, ch2=0;
        int foundLow, foundHgh;
        oid viewCount, resCount=0;
-       int gapL,gapH;
+       int gapL=0,gapH=0;
        
        if (*inclusiveHgh == TRUE) HBound = FALSE;
        else    HBound = TRUE;                          
@@ -1404,7 +1404,7 @@
        hgh  = currentValue + *c2;                      
 
        posl = BUNfirst(b);
-       posh = BUNlast(b)-(oid)1;
+       posh = BUNlast(b)-1;
 
        @:crackDoubleSidedBound(@1,posl,posh)@
        @:addPartialResult()@
@@ -1538,7 +1538,7 @@
 }
 
 void alignStep(BAT *mapLeft, struct Node *curNodeRight, oid startPos, oid 
endPos, BAT *indexRight, BUN baseRight, BAT * indexLeft, int mapLpos){
-       oid newPosition;
+       oid newPosition=0;
        @1 bound = *(@1*)Tloc(indexRight, baseRight + curNodeRight->position);
        
        if (curNodeRight->inclusive == TRUE)

Index: crackers_sideways.mx
===================================================================
RCS file: 
/cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers_sideways.mx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- crackers_sideways.mx        14 Jan 2008 22:24:15 -0000      1.4
+++ crackers_sideways.mx        15 Jan 2008 11:05:06 -0000      1.5
@@ -66,8 +66,9 @@
 };
 
 struct storageManagement{
-       lng totalTuples;        
-       lng threshold;
+       oid totalTuples;        
+       oid threshold;
+       bit setThreshold;
        struct mapSetNode *nextMapSet;  /* the list of map set nodes are 
holding info on map sets based on mapSetNode->batId
                                           Each map set node has a list of 
mapNodes for each map that exists in this map set
                                           Each mapNode has a list of Nodes 
linking directly to the cracker indices of the respective maps
@@ -120,7 +121,7 @@
 crackers_export str DeleteCrackerMap(int *k, int *bid, int *pbid);
 crackers_export str getCrackerMap(int *k, int *bid, int *pbid);
 crackers_export str CRKgetTotalStorage(int *k);
-crackers_export str CRKsetStorageThreshold(int *k, lng * threshold);
+crackers_export str CRKsetStorageThreshold(int *k, oid * threshold);
 crackers_export str CRKaddReference(int* res, int *bid, int *pbid);
 crackers_export str CRKaddReferenceFullMaps(int* res, int *bid, int *pbid);
 crackers_export str CRKclearReferences(int* res, int *bid);
@@ -286,14 +287,14 @@
 CRKgetTotalStorage(int *k){
         (void) k;
 
-       printf("\n\nTotal Storage: %lld tuples  \n\n", 
StorageInfo->totalTuples);
+       printf("\n\nTotal Storage: "OIDFMT" tuples  \n\n", 
StorageInfo->totalTuples);
 
         return MAL_SUCCEED;
 }
 
 
 str
-CRKsetStorageThreshold(int *k, lng *threshold){
+CRKsetStorageThreshold(int *k, oid *threshold){
         (void) k;
 
        if (StorageInfo == NULL){
@@ -303,9 +304,8 @@
                 StorageInfo->references  = NULL;
         }
 
-       printf("\n\nchaning the threshold to %lld \n\n", *threshold);
        StorageInfo->threshold = *threshold;    
-       printf("\n\n new threshold is %lld \n\n", StorageInfo->threshold);
+       StorageInfo->setThreshold = TRUE;
 
         return MAL_SUCCEED;
 }
@@ -557,11 +557,11 @@
         BAT *b, *p, *r, *c, *pair;
         @1 *pairh, *rest;
        bit *pivott; 
-        lng size, fsize;
-        lng skip;
+        oid size, fsize;
+        oid skip;
        int m;
-       oid cl1,cl2,ch1,ch2;
-       lng j;
+       oid cl1=0,cl2=0,ch1=0,ch2=0;
+       oid j;
 
        m = existsCrackerIndexSideways(*bid, *pbid);
        if (m==-1){     
@@ -632,11 +632,11 @@
         BAT *b, *p, *r, *c, *slice;
         @2 *pairt, *rest;
        bit *pivott;
-        lng size, fsize;
-        lng skip;
+        oid size, fsize;
+        oid skip;
        int m;
-       oid cl1,cl2,ch1,ch2;
-       lng j;
+       oid cl1=0,cl2=0,ch1=0,ch2=0;
+       oid j;
        bit newMap = TRUE;
 
        /* If the necessary map does not exits, then create it */       
@@ -663,9 +663,9 @@
            Note. We know that this search leads to an exact match sice a 
project call always 
            follows a select call with the same restriction in the same query. 
            Then this restriction is on the cracker tape. */
-        [EMAIL PROTECTED](*low, *inclusiveLow, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl1, &ch1, 0, BUNlast(b)-(oid)1);
+        [EMAIL PROTECTED](*low, *inclusiveLow, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl1, &ch1, 0, BUNlast(b)-1);
 
-        [EMAIL PROTECTED](*hgh, *inclusiveHgh, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl2, &ch2, 0, BUNlast(b)-(oid)1);
+        [EMAIL PROTECTED](*hgh, *inclusiveHgh, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl2, &ch2, 0, BUNlast(b)-1);
 
        if (cl1 != 0) cl1++;
 
@@ -724,10 +724,10 @@
         BAT *b, *p, *r, *c;
         @2 *pairt, *rest;
        bit *pivott;
-        lng size, fsize;
-        lng skip;
+        oid size, fsize;
+        oid skip;
        int m;
-       lng j;
+       oid j;
 
        /* If the necessary map does not exits, then create it */       
        m = existsCrackerIndexSideways(*bid, *pbid);
@@ -1031,7 +1031,8 @@
                StorageInfo = (struct storageManagement 
*)GDKmalloc(sizeof(struct storageManagement));
                 StorageInfo->nextMapSet  = NULL;
                 StorageInfo->totalTuples = 0;
-                StorageInfo->threshold   = -1;
+                StorageInfo->threshold   = 0;
+                StorageInfo->setThreshold   = FALSE;
                 StorageInfo->references  = NULL;
        }
 
@@ -1233,7 +1234,7 @@
 }
 
 void 
-registerPieceForStorageManagement(int batId, int tailBatId, struct Node * 
localFirst, lng tuples){
+registerPieceForStorageManagement(int batId, int tailBatId, struct Node * 
localFirst, oid tuples){
        struct mapSetNode *curMapSet, *prevMapSet, *newMapSet;  
        struct mapNode *curMap, *newMap, *prevMap;
 
@@ -1607,7 +1608,7 @@
        oid *crackerBATHead;
        BUN tailBATFirst; 
        @2 *mapTail;
-       lng size;
+       oid size;
        oid pos1,pos2;
 
        if (nodeLow == NULL)
@@ -1628,7 +1629,7 @@
        crackerBATHead = (oid*)Hloc(crackerBAT, BUNfirst(crackerBAT)+pos1);
        crackerBATTail = (@1 *)Tloc(crackerBAT, BUNfirst(crackerBAT)+pos1);
 
-       for(int i=0;i<size;i++){
+       for(oid i=0;i<size;i++){
                *mapHead = *crackerBATTail;
                *mapTail = *(@2*)Tloc(tailBAT, tailBATFirst + *crackerBATHead);
 
@@ -1645,12 +1646,12 @@
         pieceMap->batRestricted= BAT_READ;
         BATmode(pieceMap,PERSISTENT);
 
-       if (StorageInfo->threshold > 0){
+       if (StorageInfo->setThreshold == TRUE){
 
                /* remove pieces until we have enough space left for the new 
one */
                while (StorageInfo->totalTuples + size > 
StorageInfo->threshold){
                        struct Node *localFirstNodeOfPieceToRemove = NULL;
-                       int batId, tailBatId;
+                       int batId=0, tailBatId=0;
                        localFirstNodeOfPieceToRemove = 
getTheLeastUsedMapPiece(CBindex, &batId, &tailBatId); 
                        if (localFirstNodeOfPieceToRemove == NULL)
                                 printf("\n crackers.createPieceMap Unexpected 
case: Could not find a piece to remove \n ");
@@ -1773,7 +1774,7 @@
 [EMAIL PROTECTED](int batId, int tailBatId, struct Node *localFirst){
        int CBindex, Lindex;
        BAT *ci, *li, *piece;
-       struct Node *CBnodeFirst, *CBnodeLast;
+       struct Node *CBnodeFirst=NULL, *CBnodeLast=NULL;
        bit found = FALSE;
 
        removePieceFromStorageInfo(batId, tailBatId, localFirst->pieceBAT);
@@ -2042,8 +2043,8 @@
        oid syncs;
        oid size;
 
-        oid vl, vh;
-        oid cl1, ch1, cl2, ch2;
+        oid vl=0, vh=0;
+        oid cl1=0, ch1=0, cl2=0, ch2=0;
         oid _vl;
         bit HBound, foundLow=0, foundHgh=0;
         int gapL = 1;
@@ -2203,7 +2204,7 @@
        oid size;
        struct Node *localNodeLow1, *localNodeHgh1;
 
-        oid vl, _vl;
+        oid vl=0, _vl;
         oid cl1, ch1, base ;
         bit foundLow=0;
         int gapL = 1;
@@ -2301,7 +2302,6 @@
 str
 [EMAIL PROTECTED](int h, @1 low, @1 hgh, bit li, bit hi){
        BAT *h1,*h2,*h1new,*h2new;
-       oid size;       
 
        if ((h1 = BATdescriptor(CrackerIndex[h].chid)) == NULL) 
                 throw(MAL, "crackers.sync", "Cannot access descriptor");
@@ -2309,8 +2309,6 @@
         if ((h2 = BATdescriptor(CrackerIndex[h].hiid)) == NULL) 
                 throw(MAL, "crackers.sync", "Cannot access descriptor");
                                                 
-        size = BATcount(h1);
-
        h1new = BATnew([EMAIL PROTECTED],[EMAIL PROTECTED],1); 
         *(@1*)Hloc(h1new, BUNfirst(h1new)) = low;
         *(@1*)Tloc(h1new, BUNfirst(h1new)) = hgh;
@@ -2367,7 +2365,6 @@
 
 @= CreateResultSideways
 createView:
-{ BAT * viewHead;
        if (tail){
                viewHead = VIEWhead_(BATmirror(b), BAT_READ);
                 view = BATslice(BATmirror( viewHead), vl, vh+1);
@@ -2390,15 +2387,14 @@
 
         *vid = view->batCacheid;
         BBPkeepref(*vid);
-}
 @
 
 @= CreateCrackerMap
                BAT *bo, *bp;
-                lng sizeM;
+                oid sizeM;
                 @2 *ptail, *ntail;
                @1 *nhead, *ctail;
-               lng j;
+               oid j;
 
                 if ((bo = BATdescriptor(*bid)) == NULL)
                         throw(MAL, "crackers.create new map", "Cannot access 
descriptor of map head BAT");
@@ -2434,7 +2430,7 @@
        
                BATsetcount(b, sizeM);
 
-               c = BATnew(TYPE_lng, [EMAIL PROTECTED], IndexEntries);  /* 
TODO: size */
+               c = BATnew(TYPE_oid, [EMAIL PROTECTED], IndexEntries);  /* 
TODO: size */
 
                 m = [EMAIL PROTECTED](*bid, b->batCacheid, *pbid, 
c->batCacheid);
                CrackerIndex[m].creationTimestamp = GDKusec();
@@ -2446,11 +2442,12 @@
                        StorageInfo = (struct storageManagement 
*)GDKmalloc(sizeof(struct storageManagement));
                        StorageInfo->nextMapSet  = NULL;
                        StorageInfo->totalTuples = 0;
-                       StorageInfo->threshold   = -1;
+                       StorageInfo->threshold   = 0;
+                       StorageInfo->setThreshold   = FALSE;
                        StorageInfo->references  = NULL;
                }else{
                        int MapToDropIndex = -1;
-                       if (StorageInfo->threshold >0){
+                       if (StorageInfo->setThreshold == TRUE){
                                if (StorageInfo->totalTuples + sizeM > 
StorageInfo->threshold){
                                        MapToDropIndex = getLeastUsedMap();     
                                        if (MapToDropIndex >=0)
@@ -2510,7 +2507,8 @@
                StorageInfo = (struct storageManagement 
*)GDKmalloc(sizeof(struct storageManagement));
                StorageInfo->nextMapSet = NULL;
                StorageInfo->totalTuples = 0;
-               StorageInfo->threshold = -1;
+               StorageInfo->threshold = 0;
+               StorageInfo->setThreshold = FALSE;
        }
 
 }
@@ -2907,6 +2905,7 @@
 @
 
 @= RangeSelectBody
+       BAT *viewHead;
         BAT *b, *c, *view=NULL;
         int  m, h;
         oid vl, vh, posl, posh, cl1, ch1, cl2, ch2;
@@ -3336,18 +3335,19 @@
 
         BAT *b, *c, *cm, *tailBAT, *piece;
         int  m, h;
-        oid vl=-1, vh=-1, posl, posh;
-       struct Node 
*localNodeLow1=NULL,*localNodeLow2=NULL,*localNodeHgh1=NULL,*localNodeHgh2=NULL,
 *nodeLow1,*nodeHgh1, *nodeLow2,*nodeHgh2, *localFirst; 
+        oid vl=0, vh=0, posl, posh;
+       struct Node 
*localNodeLow1=NULL,*localNodeLow2=NULL,*localNodeHgh1=NULL,*localNodeHgh2=NULL,
 
+                       *nodeLow1=NULL,*nodeHgh1=NULL, 
*nodeLow2=NULL,*nodeHgh2=NULL, *localFirst=NULL; 
        struct Node *curCBatNodeLast=NULL, *curPieceNodeLast=NULL;
-       oid cl1, ch1, cl2, ch2;
-        int _vl=-1;
+       oid cl1=0, ch1=0, cl2=0, ch2=0;
+        int _vl=0;
         int gapL = 1, gapH = 1;
         bit HBound, foundLow=0, foundHgh=0, done=FALSE;
         BAT *p;     
         bit *pivott;        
-       lng size=0;
+       oid size=0;
        @2 *pairt;
-       lng j, tuplesToAnalyze, base;
+       oid j, tuplesToAnalyze, base;
        bit newMapSet = FALSE;
        bit newMap = FALSE;
        bit newPiece = FALSE;
@@ -3380,7 +3380,7 @@
                @:CreateCrackerBAT(@1)@         
 
                 posl = BUNfirst(b);
-                posh = BUNlast(b)-(oid)1;
+                posh = BUNlast(b)-1;
                 @:crkThreeTree(@1,@2,posl,posh)@
                
                cm = BATnew(TYPE_oid, [EMAIL PROTECTED], IndexEntries); /* 
TODO: size */
@@ -3401,7 +3401,7 @@
         h = existsCrackerIndexSideways(*bid, *pbid);
        if (h == -1){
                newMap = TRUE;
-               cm = BATnew(TYPE_lng, [EMAIL PROTECTED], IndexEntries); /* 
TODO: size */
+               cm = BATnew(TYPE_oid, [EMAIL PROTECTED], IndexEntries); /* 
TODO: size */
                 h  = [EMAIL PROTECTED](*bid, -1, *pbid, cm->batCacheid);
        }
        
@@ -3650,7 +3650,7 @@
 static str
 [EMAIL PROTECTED]@2(int *vid, int *bid, int *pbid, @1 *low, @1 *hgh, bit 
*inclusiveLow, bit *inclusiveHgh, @2 *low2, @2 *hgh2, bit *inclusiveLow2, bit 
*inclusiveHgh2){
        @:RangeSelectBody(@1,@2,@3,@4)@
-
+       (void)viewHead;
        (void)view;
        /* Define resulting view: a contiguous area on the map */       
         @:CreateDisjunctiveResultSideways(@1,@2,@3,@4)@
@@ -3755,6 +3755,7 @@
        maxt = (@2*)Tloc(p, BUNfirst(p));
 
        @:IncrementalCrackingBasicBodyB(@1,@2,@3,@4,MaxTail)@   
+       (void)pivott;
 
         p->hsorted = FALSE;
         p->tsorted = FALSE;
@@ -3813,9 +3814,9 @@
         @2 *pairt;
        bit *pivott;        
        oid size;
-       lng skip;
+       oid skip;
        int m;
-       oid cl1,cl2,ch1,ch2;
+       oid cl1=0,cl2=0,ch1=0,ch2=0;
        oid j;
        bit newMap = FALSE;
 
@@ -3836,9 +3837,9 @@
        [EMAIL PROTECTED]@2(m,existsCrackerIndexSideways(*bid, -1));
 
 
-        [EMAIL PROTECTED](*low1, *inclusiveLow1, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl1, &ch1, 0, BUNlast(b)-(oid)1);
+        [EMAIL PROTECTED](*low1, *inclusiveLow1, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl1, &ch1, 0, BUNlast(b)-1);
 
-        [EMAIL PROTECTED](*hgh1, *inclusiveHgh1, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl2, &ch2, 0, BUNlast(b)-(oid)1);
+        [EMAIL PROTECTED](*hgh1, *inclusiveHgh1, CrackerIndex[m].Tree, c, 
BUNfirst(c), &cl2, &ch2, 0, BUNlast(b)-1);
 
        if (cl1 != 0) cl1++;
 
@@ -3880,7 +3881,7 @@
         @2 *pairt;
        bit *pivott;        
        oid size;
-       lng skip;
+       oid skip;
        int m;
        oid j;
 

Index: crackers_core_ordered.mx
===================================================================
RCS file: 
/cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers_core_ordered.mx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- crackers_core_ordered.mx    14 Jan 2008 22:24:15 -0000      1.4
+++ crackers_core_ordered.mx    15 Jan 2008 11:05:05 -0000      1.5
@@ -85,7 +85,7 @@
 [EMAIL PROTECTED] (int *res, int *bid, @1 *mid){
         BAT *b;
         str msg;
-       lng pos;
+       oid pos;
 
         if ((b = BATdescriptor(*bid)) == NULL) 
                 throw(MAL, "crackers.crack_zeroOrdered", "Cannot access 
descriptor");
@@ -115,7 +115,7 @@
 [EMAIL PROTECTED] (int *res, int *bid, @1 *low, @1 *hgh){
        BAT *b;
        str msg;
-       lng posl,posh;
+       oid posl,posh;
 
        if ((b = BATdescriptor(*bid)) == NULL) 
                throw(MAL, "crackers.crack_threeOrdered", "Cannot access 
descriptor");
@@ -201,7 +201,8 @@
                        ht @6= 1;
                }
        }
-       for (i= hil-1; i >= 0; i--){
+       i=hil-1;
+       while(1){
                if (*tmpt @5){
                        *hh = *tmph;
                        *ht = *tmpt;
@@ -212,7 +213,24 @@
                *tmpt = scr_t[i];
                tmpt @6= 1;
                tmph @6= 1;
+               
+               i--;
+               if (i==0) {
+                       if (*tmpt @5){
+                               *hh = *tmph;
+                               *ht = *tmpt;
+                               hh @6= 1;
+                               ht @6= 1;
+                       }
+                       *tmph = scr_h[i];
+                       *tmpt = scr_t[i];
+                       tmpt @6= 1;
+                       tmph @6= 1;
+               
+                       break;
+               }
        }
+
        i = mids + 1;
        for (; i <= scrH; i++){
                 if (*tmpt @5){
@@ -230,14 +248,14 @@
 
 @= crackInThreeOrderedPieces
 static str
[EMAIL PROTECTED]@[EMAIL PROTECTED](BAT *b, @1 low, @1 hgh, int idx_first, int 
idx_last){
[EMAIL PROTECTED]@[EMAIL PROTECTED](BAT *b, @1 low, @1 hgh, oid idx_first, oid 
idx_last){
        oid *hh, *tmph, *ch, *fh;
        @1  *ht, *tmpt, *ct, *ft, *s, *t;
        oid *scr_h;
        @1  *scr_t;
-       int scr_size = idx_last - idx_first +1;
-       int hghShrinked = 0, lowShrinked = 0, scrH, hil, mids, probe, j;
-       int i;
+       oid scr_size = idx_last - idx_first +1;
+       oid hghShrinked = 0, lowShrinked = 0, scrH, hil, mids, probe, j;
+       oid i;
        BUN first;
 
        first = BUNfirst(b);
@@ -285,14 +303,14 @@
 
 @= crackInThreeOrderedPiecesL
 static str
[EMAIL PROTECTED]@[EMAIL PROTECTED](BAT *b, @1 low, @1 hgh, lng idx_first, lng 
idx_last, lng *posl, lng *posh){
[EMAIL PROTECTED]@[EMAIL PROTECTED](BAT *b, @1 low, @1 hgh, oid idx_first, oid 
idx_last, oid *posl, oid *posh){
        oid *lh, *hh, *tmph, *fh, *mh;
        @1 *lt, *ht, *tmpt, *ft, *mt, *t, *s, *t0;
        oid *scr_h,*mscr_h;
        @1  *scr_t,*mscr_t;
-       int scr_size = idx_last - idx_first +1;
-       int hghShrinked = 0, lowShrinked = 0, scrH, hp, hil, mids, mmids, j, 
probe;
-       lng pos1, pos2;
+       oid scr_size = idx_last - idx_first +1;
+       oid hghShrinked = 0, lowShrinked = 0, scrH, hp, hil, mids, mmids, j, 
probe;
+       oid pos1, pos2;
        BUN first;
 
        first = BUNfirst(b);
@@ -366,7 +384,7 @@
 @= OThreeLateCopying
 {
        @1 *tmp1, *tmp2;
-       int i;
+       oid i;
 
        while (*tmpt @5){
                tmpt @2= 1;
@@ -418,7 +436,8 @@
                        mmids++;        
                }
        }
-       for (i= hil-1; i >= 0; i--){
+       i= hil-1;
+       while (1){
                if (*tmpt @5){
                        *hh = *tmph;
                        *ht = *tmpt;
@@ -434,6 +453,27 @@
                *tmpt = scr_t[i];
                tmpt @6= 1;
                tmph @6= 1;
+
+               i--;
+               if (i==0){
+                       if (*tmpt @5){
+                               *hh = *tmph;
+                               *ht = *tmpt;
+                               hh @6= 1;
+                               ht @6= 1;
+                       }       
+                       if (*tmpt @8 low && *tmpt @9 hgh){
+                               mscr_h[mmids] = *tmph;
+                               mscr_t[mmids] = *tmpt;                          
+                               mmids++;        
+                       }
+                       *tmph = scr_h[i];
+                       *tmpt = scr_t[i];
+                       tmpt @6= 1;
+                       tmph @6= 1;
+
+                       break;
+               }
        }
 
        pos2 = tmpt - t0; 
@@ -581,14 +621,14 @@
 
 @= crackInTwoOrderedPieces
 static str
[EMAIL PROTECTED]@1(BAT *b, @1 mid, lng idx_first, lng idx_last, lng *pos){
[EMAIL PROTECTED]@1(BAT *b, @1 mid, oid idx_first, oid idx_last, oid *pos){
        oid *hh, *tmph, *fh, *ch;
        @1  *ht, *tmpt, *ft, *ct, *t, *s, *t0;
        oid *scr_h;
        @1  *scr_t;
-       lng hghShrinked = 0, lowShrinked = 0;
-       int j=0, hil=0, scr_size, probe = 25;
-       int i;
+       oid hghShrinked = 0, lowShrinked = 0;
+       oid j=0, hil=0, scr_size, probe = 25;
+       lng i;
        BUN first;
 
        first = BUNfirst(b);

Index: crackers_index.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers_index.mx,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- crackers_index.mx   14 Jan 2008 22:24:15 -0000      1.4
+++ crackers_index.mx   15 Jan 2008 11:05:06 -0000      1.5
@@ -59,7 +59,7 @@
 
 struct referencesNode{
        int             batId;
-       lng             cursor;
+       oid             cursor;
        struct referencesNode *next;
 };
 
@@ -96,7 +96,7 @@
        lng             creationTimestamp;
        lng             accesses;
        lng             dropped;
-       lng             tuples;
+       oid             tuples;
 
        /* Used on the cracker BAT side in the case of incremental maps */
        struct referencesNode *references;      /* maps that use this piece */
@@ -144,7 +144,7 @@
        lng             creationTimestamp;
        lng             accesses;
        lng             dropped;
-       lng             tuples;
+       oid             tuples;
 
 } CrackerIndexNode;
 

Index: crackers.mx
===================================================================
RCS file: /cvsroot/monetdb/MonetDB5/src/modules/mal/crackers/crackers.mx,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- crackers.mx 14 Jan 2008 22:24:15 -0000      1.5
+++ crackers.mx 15 Jan 2008 11:05:05 -0000      1.6
@@ -572,7 +572,7 @@
 extern int IndexEntries;
 extern int IndexSize;
 extern int IndexStop;
-struct storageManagement *StorageInfo;
+extern struct storageManagement *StorageInfo;
 #endif
 
 #endif /* _CRACKERS_H */


-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Monetdb-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-checkins

Reply via email to