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

xid.c: bit pattern does not require anding with XIDMASK


diffs (40 lines):

diff --git a/monetdb5/modules/mal/xid.c b/monetdb5/modules/mal/xid.c
--- a/monetdb5/modules/mal/xid.c
+++ b/monetdb5/modules/mal/xid.c
@@ -32,7 +32,8 @@
 #define XIDRANGEINC 3
 #define XIDRANGEDEC 4
 #define XIDPOINT    5
-#define XIDMASK     7  /* we keep some reserve for runlength compression */
+/* must be < 2^XID_TAG_BITS i.e. < 1<<XID_TAG_BITS */
+/* we keep some reserve for runlength compression  */
 
 typedef oid xid;
 #define SIZEOF_XID   SIZEOF_OID
@@ -59,7 +60,7 @@ XIDencode(BUN *rtrn, XIDcolumn col, oid 
                if (o > XID_VAL_MAX)
                        throw(MAL, "xid.compress", "value too large in 
XIDencode()");
                v = (xid) o;
-               switch ( col[i].tag & XIDMASK ) {
+               switch ( col[i].tag ) {
                case XIDBASE:
                        col[i].tag = XIDPOINT;
                        col[i].value = v;
@@ -306,7 +307,7 @@ XIDdecode(BUN *rtrn, XIDcolumn col, oid 
                if (cnt >= cap)
                        throw(MAL, "xid.decompress", "result BAT capacity 
exceeded in XIDdecode()");
                v = col[i].value;
-               switch ( col[i].tag & XIDMASK ) {
+               switch ( col[i].tag ) {
                case XIDSETINC:
                        v= col[i-1].value;
                        for ( j=0; j< XID_VAL_BITS; j++) 
@@ -452,7 +453,7 @@ XIDcolumndump(stream *f, XIDcolumn col, 
 
        for ( i=1 ; i<lim; i++) {
                v = col[i].value;
-               switch ( col[i].tag & XIDMASK ) {
+               switch ( col[i].tag ) {
                case XIDBASE:
                        mnstr_printf(f,"x:" XIDFMT "", v);
                        break;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to