Changeset: edcdb4ebe6cc for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=edcdb4ebe6cc
Modified Files:
        monetdb5/modules/mal/mosaic_prefix.c
Branch: mosaic
Log Message:

Fix usage of compression history


diffs (87 lines):

diff --git a/monetdb5/modules/mal/mosaic_prefix.c 
b/monetdb5/modules/mal/mosaic_prefix.c
--- a/monetdb5/modules/mal/mosaic_prefix.c
+++ b/monetdb5/modules/mal/mosaic_prefix.c
@@ -147,7 +147,7 @@ MOSadvance_prefix(Client cntxt, MOStask 
                        bits = val & (~mask);
                        // be aware that we use longs as bit vectors
                        bytes = sizeof(unsigned long) * ((MOSgetCnt(task->blk) 
* bits)/64 + (((MOSgetCnt(task->blk) * bits) %64) != 0));
-                       task->blk = (MosaicBlk) (((char*) dst)  + 
wordaligned(bytes,bte)); 
+                       task->blk = (MosaicBlk) (((char*) dst)  + 
wordaligned(bytes,lng)); 
                        //mnstr_printf(cntxt->fdout,"advance mask width %d 
bytes %d %d \n",bits,bytes,(int)wordaligned(bytes,int));
                }
                break;
@@ -157,7 +157,7 @@ MOSadvance_prefix(Client cntxt, MOStask 
                        sht val = *dst++;
                        bits = val & (~mask);
                        bytes = sizeof(unsigned long) * ((MOSgetCnt(task->blk) 
* bits)/64 + (((MOSgetCnt(task->blk) * bits) %64) != 0));
-                       task->blk = (MosaicBlk) (((char*) dst)  + 
wordaligned(bytes,sht)); 
+                       task->blk = (MosaicBlk) (((char*) dst)  + 
wordaligned(bytes,lng)); 
                        //mnstr_printf(cntxt->fdout,"advance mask width %d 
bytes %d %d \n",bits,bytes,(int)wordaligned(bytes,int));
                }
                break;
@@ -167,7 +167,7 @@ MOSadvance_prefix(Client cntxt, MOStask 
                        int val = *dst++;
                        bits = val & (~mask);
                        bytes = sizeof(unsigned long) * ((MOSgetCnt(task->blk) 
* bits)/64 + (((MOSgetCnt(task->blk) * bits) %64) != 0));
-                       task->blk = (MosaicBlk) (((char*) dst)  + 
wordaligned(bytes, int)); 
+                       task->blk = (MosaicBlk) (((char*) dst)  + 
wordaligned(bytes, lng)); 
                        //mnstr_printf(cntxt->fdout,"advance mask width %d 
bytes %d %d \n",bits,bytes,(int)wordaligned(bytes,int));
                }
                break;
@@ -233,7 +233,7 @@ MOSestimate_prefix(Client cntxt, MOStask
                                break;
 
                        if( task->range[MOSAIC_PREFIX] > task->start +1 /* need 
at least two*/){
-                               bits = task->range[MOSAIC_PREFIX - task->start] 
* (8-bits);
+                               bits = task->range[MOSAIC_PREFIX] - task->start 
* (8-bits);
                                store = bits/8 + ((bits % 8) >0);
                                store = wordaligned( MosaicBlkSize + 2 * 
sizeof(bte) +  store,bte);
                                if( store >= (flt)i * sizeof(bte))
@@ -269,7 +269,7 @@ MOSestimate_prefix(Client cntxt, MOStask
                                break;
 
                        if( task->range[MOSAIC_PREFIX] > task->start + 1){
-                               bits = task->range[MOSAIC_PREFIX - task->start] 
* (16-bits);
+                               bits = task->range[MOSAIC_PREFIX] - task->start 
* (16-bits);
                                store = bits/8 + ((bits % 8) >0);
                                store = wordaligned( MosaicBlkSize + 2 * 
sizeof(sht) +  store,sht);
                                if( store >= (flt)i * sizeof(sht))
@@ -284,7 +284,7 @@ MOSestimate_prefix(Client cntxt, MOStask
                        }
                        bits = i * (16-bits);
                        store = bits/8 + ((bits % 8) >0);
-                       store = wordaligned( MosaicBlkSize + 2 * sizeof(sht) +  
store,sht);
+                       store = wordaligned( MosaicBlkSize + 2 * sizeof(sht) +  
store,lng);
                        if( store >= (flt)i * sizeof(sht))
                                return 0.0;
                        factor = ( (flt)i * sizeof(sht))/ store;
@@ -305,9 +305,9 @@ MOSestimate_prefix(Client cntxt, MOStask
                                break;
 
                        if( task->range[MOSAIC_PREFIX] > task->start + 1){
-                               bits = task->range[MOSAIC_PREFIX - task->start] 
* (32-bits);
+                               bits = task->range[MOSAIC_PREFIX] - task->start 
* (32-bits);
                                store = bits/8 + ((bits % 8) >0);
-                               store = wordaligned( MosaicBlkSize + 2 * 
sizeof(int) +  store,int);
+                               store = wordaligned( MosaicBlkSize + 2 * 
sizeof(int) +  store,lng);
                                if( store > (flt)i * sizeof(int))
                                        return 0.0;
                                return task->factor[MOSAIC_PREFIX] = ( (flt)i * 
sizeof(int))/ store;
@@ -320,7 +320,7 @@ MOSestimate_prefix(Client cntxt, MOStask
                        }
                        bits = i * (32-bits);
                        store = bits/8 + ((bits % 8) >0);
-                       store = wordaligned( MosaicBlkSize + 2 * sizeof(int) +  
store,int);
+                       store = wordaligned( MosaicBlkSize + 2 * sizeof(int) +  
store,lng);
                        if( store >= (flt)i * sizeof(int))
                                return 0.0;
                        factor = ( (flt)i * sizeof(int))/ store;
@@ -341,7 +341,7 @@ MOSestimate_prefix(Client cntxt, MOStask
                                break;
 
                        if( task->range[MOSAIC_PREFIX] > task->start + 1){
-                               bits = task->range[MOSAIC_PREFIX - task->start] 
* (64-bits);
+                               bits = task->range[MOSAIC_PREFIX] - task->start 
* (64-bits);
                                store = bits/8 + ((bits % 8) >0);
                                store = wordaligned( MosaicBlkSize + 2 * 
sizeof(lng) +  store,lng);
                                if( store >= (flt)i * sizeof(lng))
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to