Changeset: 7b3467c08c99 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=7b3467c08c99
Modified Files:
        gdk/gdk_atoms.h
        gdk/gdk_calc.c
        gdk/gdk_calc_compare.h
Branch: Jan2014
Log Message:

merged with Feb2013


diffs (82 lines):

diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -8375,7 +8375,7 @@ BATcalcbetween_intern(const void *src, i
 {
        BAT *bn;
        BUN nils = 0;
-       BUN i, j, k, l;
+       BUN i, j, k, l, soff = 0, loff = 0, hoff = 0;
        bit *dst;
        const void *nil;
        int (*atomcmp)(const void *, const void *);
@@ -8432,12 +8432,13 @@ BATcalcbetween_intern(const void *src, i
                             k = start * incr3,
                             l = start;
                     l < end;
-                    i += incr1, j += incr2, k += incr3, l++) {
+                    i += incr1, j += incr2, k += incr3, l++, 
+                    soff+=wd1, loff+= wd2, hoff+= wd3 ) {
                        const void *p1, *p2, *p3;
                        CHECKCAND(dst, l, seqbase, bit_nil);
-                       p1 = hp1 ? (const void *) (hp1 + VarHeapVal(src, i, 
wd1)) : src;
-                       p2 = hp2 ? (const void *) (hp2 + VarHeapVal(lo, j, 
wd2)) : lo;
-                       p3 = hp3 ? (const void *) (hp3 + VarHeapVal(hi, k, 
wd3)) : hi;
+                       p1 = hp1 ? (const void *) (hp1 + VarHeapVal(src, i, 
wd1)) : (const void *) ((const char *) src + soff);
+                       p2 = hp2 ? (const void *) (hp2 + VarHeapVal(lo, j, 
wd2)) : (const void *) ((const char *) lo + loff);
+                       p3 = hp3 ? (const void *) (hp3 + VarHeapVal(hi, k, 
wd3)) : (const void *) ((const char *) hi + hoff);
                        if (p1 == NULL || p2 == NULL || p3 == NULL ||
                            (*atomcmp)(p1, nil) == 0 ||
                            (*atomcmp)(p2, nil) == 0 ||
@@ -8448,12 +8449,6 @@ BATcalcbetween_intern(const void *src, i
                                dst[l] = (bit) ((*atomcmp)(p1, p2) >= 0 &&
                                                (*atomcmp)(p1, p3) <= 0);
                        }
-                       if (hp1 == NULL && incr1)
-                               src = (const void *) ((const char *) src + wd1);
-                       if (hp2 == NULL && incr2)
-                               lo = (const void *) ((const char *) lo + wd2);
-                       if (hp3 == NULL && incr3)
-                               hi = (const void *) ((const char *) hi + wd3);
                }
                break;
        }
diff --git a/gdk/gdk_calc_compare.h b/gdk/gdk_calc_compare.h
--- a/gdk/gdk_calc_compare.h
+++ b/gdk/gdk_calc_compare.h
@@ -26,7 +26,7 @@ op_typeswitchloop(const void *lft, int t
                  const oid *candend, oid candoff, int nonil, const char *func)
 {
        BUN nils = 0;
-       BUN i, j, k;
+       BUN i, j, k, loff = 0, roff = 0;
        const void *nil;
        int (*atomcmp)(const void *, const void *);
 
@@ -456,11 +456,12 @@ op_typeswitchloop(const void *lft, int t
                nil = ATOMnilptr(tp1);
                CANDLOOP(dst, k, TPE_nil, 0, start);
                for (i = start * incr1, j = start * incr2, k = start;
-                    k < end; i += incr1, j += incr2, k++) {
+                    k < end; i += incr1, j += incr2, k++,
+                    loff+= wd1, roff+= wd2) {
                        const void *p1, *p2;
                        CHECKCAND(dst, k, candoff, TPE_nil);
-                       p1 = hp1 ? (const void *) (hp1 + VarHeapVal(lft, i, 
wd1)) : lft;
-                       p2 = hp2 ? (const void *) (hp2 + VarHeapVal(rgt, i, 
wd2)) : rgt;
+                       p1 = hp1 ? (const void *) (hp1 + VarHeapVal(lft, i, 
wd1)) : (const void *) ((const char *) lft + loff);
+                       p2 = hp2 ? (const void *) (hp2 + VarHeapVal(rgt, j, 
wd2)) : (const void *) ((const char *) rgt + roff);
                        if (p1 == NULL || p2 == NULL ||
                            (*atomcmp)(p1, nil) == 0 ||
                            (*atomcmp)(p2, nil) == 0) {
@@ -470,10 +471,6 @@ op_typeswitchloop(const void *lft, int t
                                int x = (*atomcmp)(p1, p2);
                                dst[k] = OP(x, 0);
                        }
-                       if (hp1 == NULL && incr1)
-                               lft = (const void *) ((const char *) lft + wd1);
-                       if (hp2 == NULL && incr2)
-                               rgt = (const void *) ((const char *) rgt + wd2);
                }
                CANDLOOP(dst, k, TPE_nil, end, cnt);
                break;
_______________________________________________
checkin-list mailing list
checkin-list@monetdb.org
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to