Changeset: 66492a198c64 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/66492a198c64
Modified Files:
gdk/gdk.h
gdk/gdk_atoms.h
gdk/gdk_bat.c
gdk/gdk_batop.c
gdk/gdk_calc.c
gdk/gdk_calc_compare.h
gdk/gdk_join.c
gdk/gdk_qsort.c
gdk/gdk_search.c
gdk/gdk_ssort.c
gdk/gdk_unique.c
monetdb5/modules/atoms/str.c
monetdb5/modules/mal/pcre.c
monetdb5/modules/mal/txtsim.c
Branch: ustr
Log Message:
VarHeapVal returns type var_t.
diffs (truncated from 323 to 300 lines):
diff --git a/gdk/gdk.h b/gdk/gdk.h
--- a/gdk/gdk.h
+++ b/gdk/gdk.h
@@ -911,7 +911,7 @@ static inline const void *
BUNtvar(const BATiter *bi, BUN p)
{
assert(bi->type && bi->vh);
- size_t off = VarHeapVal(bi->base, p, bi->width);
+ var_t off = VarHeapVal(bi->base, p, bi->width);
return off == 0 ? ATOMnilptr(bi->type) : bi->vh->base + off;
}
@@ -1124,7 +1124,7 @@ BATsettrivprop(BAT *b)
}
b->tseqbase = sqbs;
} else {
- size_t off;
+ var_t off;
if (b->tvheap
? ((off = VarHeapVal(Tloc(b, 0), 0,
b->twidth)) == 0 ||
ATOMeq(b->ttype,
@@ -1154,8 +1154,8 @@ BATsettrivprop(BAT *b)
} else if (b->batCount == 2 && ATOMlinear(b->ttype)) {
int c;
if (b->tvheap) {
- size_t off0 = VarHeapVal(Tloc(b, 0), 0, b->twidth);
- size_t off1 = VarHeapVal(Tloc(b, 0), 1, b->twidth);
+ var_t off0 = VarHeapVal(Tloc(b, 0), 0, b->twidth);
+ var_t off1 = VarHeapVal(Tloc(b, 0), 1, b->twidth);
if (off0 == off1)
c = 0;
else if (off0 == 0)
diff --git a/gdk/gdk_atoms.h b/gdk/gdk_atoms.h
--- a/gdk/gdk_atoms.h
+++ b/gdk/gdk_atoms.h
@@ -449,7 +449,7 @@ strEq(const char *l, const char *r)
}
__attribute__((__pure__))
-static inline size_t
+static inline var_t
VarHeapVal(const void *b, BUN p, int w)
{
size_t off;
diff --git a/gdk/gdk_bat.c b/gdk/gdk_bat.c
--- a/gdk/gdk_bat.c
+++ b/gdk/gdk_bat.c
@@ -1537,7 +1537,7 @@ BUNinplacemulti(BAT *b, const oid *posit
} else if (bi.type == TYPE_msk) {
val = BUNtmsk(&bi, p);
} else if (b->tvheap) {
- size_t off = VarHeapVal(bi.base, p, bi.width);
+ var_t off = VarHeapVal(bi.base, p, bi.width);
if (off == 0)
val = ATOMnilptr(bi.type);
else if (off < bi.vhfree)
diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c
--- a/gdk/gdk_batop.c
+++ b/gdk/gdk_batop.c
@@ -142,7 +142,7 @@ insert_string_bat(BAT *b, BATiter *ni, s
BUN p, r; /* loop variables */
const void *tp = NULL; /* tail value pointer */
var_t v;
- size_t off; /* offset within n's string heap */
+ var_t off; /* offset within n's string heap */
BUN cnt = ci->ncand;
BUN oldcnt = BATcount(b);
@@ -379,7 +379,7 @@ insert_string_bat(BAT *b, BATiter *ni, s
* eliminated and nil is actually
* stored, we need to reuse its offset
* by calling tfastins_nocheckVAR */
- v = (var_t) off;
+ v = off;
switch (b->twidth) {
case 1:
assert(v - GDK_VAROFFSET < ((var_t) 1
<< 8));
@@ -419,7 +419,7 @@ insert_string_bat(BAT *b, BATiter *ni, s
MT_lock_unset(&b->theaplock);
/* maintain hash */
for (r = oldcnt, cnt = BATcount(b); b->thash && r < cnt; r++) {
- size_t off = VarHeapVal(Tloc(b, 0), r, b->twidth);
+ off = VarHeapVal(Tloc(b, 0), r, b->twidth);
HASHappend_locked(b, r, off == 0 ? str_nil : b->tvheap->base +
off);
}
BUN nunique = b->thash ? b->thash->nunique : 0;
@@ -1436,7 +1436,7 @@ BATappend_or_update(BAT *b, BAT *p, cons
* after an update (with a mmapped tail file)
* but before that was committed, then the
* offset may point outside of the vheap */
- size_t off = VarHeapVal(bi.base, updid, bi.width);
+ var_t off = VarHeapVal(bi.base, updid, bi.width);
const void *old = off == 0 ? ATOMnilptr(bi.type) : off
< bi.vhfree ? BUNtvar(&bi, updid) : NULL;
if (old && atomeq(old, new)) {
diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c
--- a/gdk/gdk_calc.c
+++ b/gdk/gdk_calc.c
@@ -4006,7 +4006,7 @@ BATcalcbetween_intern(const void *src, b
if (incr3)
k = canditer_next(cihi) - seqbase3;
const void *p1, *p2, *p3;
- size_t off;
+ var_t off;
p1 = hp1
? (off = VarHeapVal(src, i, wd1)) == 0
? nil
@@ -4504,7 +4504,7 @@ BATcalcifthenelse_intern(BATiter *bi,
BUN rem = i == n ? cnt % 32 : 32;
uint32_t mask = rem != 0 ? src[i] : 0;
for (BUN j = 0; j < rem; j++) {
- size_t off;
+ var_t off;
if (mask & (1U << j)) {
if (heap1) {
off = VarHeapVal(col1,
k, width1);
@@ -4532,7 +4532,7 @@ BATcalcifthenelse_intern(BATiter *bi,
} else {
const bit *src = bi->base;
TIMEOUT_LOOP_IDX(i, cnt, qry_ctx) {
- size_t off;
+ var_t off;
if (src[i] && !is_bit_nil(src[i])) {
if (heap1) {
off = VarHeapVal(col1, k,
width1);
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
@@ -689,7 +689,7 @@ op_typeswitchloop(const void *lft, int t
if (incr2)
j = canditer_next(ci2) - candoff2;
const char *s1, *s2;
- size_t off;
+ var_t off;
s1 = hp1 ? (off = VarHeapVal(lft, i, wd1)) == 0 ?
str_nil : hp1 + off : (const char *) lft;
s2 = hp2 ? (off = VarHeapVal(rgt, j, wd2)) == 0 ?
str_nil : hp2 + off : (const char *) rgt;
if (strNil(s1) || strNil(s2)) {
@@ -743,7 +743,7 @@ op_typeswitchloop(const void *lft, int t
if (incr2)
j = canditer_next(ci2) - candoff2;
const void *p1, *p2;
- size_t off;
+ var_t off;
p1 = hp1
? (off = VarHeapVal(lft, i, wd1)) == 0
? nil
diff --git a/gdk/gdk_join.c b/gdk/gdk_join.c
--- a/gdk/gdk_join.c
+++ b/gdk/gdk_join.c
@@ -1951,7 +1951,7 @@ mergejoin(BAT **r1p, BAT **r2p, BAT **r3
BUN lscan, rscan;
const void *lvals, *rvals; /* the values of l/r (NULL if dense) */
const char *lvars, *rvars; /* the indirect values (NULL if fixed size)
*/
- size_t off;
+ var_t off;
const void *nil = ATOMnilptr(l->ttype);
int (*cmp)(const void *, const void *) = ATOMcompare(l->ttype);
bool (*eq)(const void *, const void *) = ATOMequal(l->ttype);
@@ -3209,7 +3209,7 @@ hashjoin(BAT **r1p, BAT **r2p, BAT **r3p
BUN nr;
const char *lvals;
const char *lvars;
- size_t off;
+ var_t off;
const void *nil = ATOMnilptr(l->ttype);
int (*cmp)(const void *, const void *) = ATOMcompare(l->ttype);
bool (*eq)(const void *, const void *) = ATOMequal(l->ttype);
@@ -3645,7 +3645,7 @@ count_unique(BAT *b, BAT *s, BUN *cnt1,
const void *v;
const char *bvals;
const char *bvars;
- size_t off;
+ var_t off;
const void *nil = ATOMnilptr(b->ttype);
oid bval;
oid i, o;
@@ -4055,7 +4055,7 @@ thetajoin(BAT **r1p, BAT **r2p, BAT *l,
struct canditer lci, rci;
const char *lvals, *rvals;
const char *lvars, *rvars;
- size_t off;
+ var_t off;
const void *nil = ATOMnilptr(l->ttype);
int (*cmp)(const void *, const void *) = ATOMcompare(l->ttype);
bool (*eq)(const void *, const void *) = ATOMequal(l->ttype);
@@ -5478,7 +5478,7 @@ rangejoin(BAT *r1, BAT *r2, BAT *l, BAT
BATiter rhi = bat_iterator(rh);
const char *rlvals, *rhvals;
const char *lvars, *rlvars, *rhvars;
- size_t off;
+ var_t off;
const void *nil = ATOMnilptr(li.type);
int (*cmp)(const void *, const void *) = ATOMcompare(li.type);
bool (*eq)(const void *, const void *) = ATOMequal(li.type);
diff --git a/gdk/gdk_qsort.c b/gdk/gdk_qsort.c
--- a/gdk/gdk_qsort.c
+++ b/gdk/gdk_qsort.c
@@ -329,7 +329,7 @@ struct qsort_t {
#undef TPE
#define TPE var
-#define INITIALIZER size_t off1, off2
+#define INITIALIZER var_t off1, off2
#define SUFF f
#include "gdk_qsort_impl.h"
#undef SUFF
diff --git a/gdk/gdk_search.c b/gdk/gdk_search.c
--- a/gdk/gdk_search.c
+++ b/gdk/gdk_search.c
@@ -339,7 +339,7 @@ binsearch(const oid *restrict indir,
}
int (*cmp)(const void *, const void *) = ATOMcompare(type);
- size_t off;
+ var_t off;
const void *nil = ATOMnilptr(type);
if (last > 0) {
diff --git a/gdk/gdk_ssort.c b/gdk/gdk_ssort.c
--- a/gdk/gdk_ssort.c
+++ b/gdk/gdk_ssort.c
@@ -90,7 +90,7 @@ typedef struct {
allocator *ma;
allocator_state ma_state;
- size_t off0, off1;
+ var_t off0, off1;
} MergeState;
/* Free all the temp memory owned by the MergeState. This must be
diff --git a/gdk/gdk_unique.c b/gdk/gdk_unique.c
--- a/gdk/gdk_unique.c
+++ b/gdk/gdk_unique.c
@@ -32,7 +32,7 @@ BATunique(BAT *b, BAT *s)
const void *v;
const char *vals;
const char *vars;
- size_t off;
+ var_t off;
const void *nil = ATOMnilptr(b->ttype);
int width;
oid o, hseq;
diff --git a/monetdb5/modules/atoms/str.c b/monetdb5/modules/atoms/str.c
--- a/monetdb5/modules/atoms/str.c
+++ b/monetdb5/modules/atoms/str.c
@@ -1945,7 +1945,7 @@ scan_loop_strselect(BAT *rl, BATiter *li
{
oid l_base = li->b->hseqbase;
const char *l_vars = li->vh->base, *l_vals = li->base;
- size_t off;
+ var_t off;
size_t r_len = strlen(r);
lng t0 = 0;
@@ -2189,7 +2189,7 @@ nested_loop_strjoin(BAT *rl, BAT *rr, BA
oid lbase = li->b->hseqbase, rbase = ri->b->hseqbase, or, ol;
const char *l_vars = li->vh->base, *r_vars = ri->vh->base,
*l_vals = li->base, *r_vals = ri->base;
- size_t off;
+ var_t off;
lng t0 = 0;
TRC_DEBUG_IF(ALGO) t0 = GDKusec();
@@ -2258,7 +2258,7 @@ init_bigram_idx(NGrams *ng, BATiter *bi,
oid b_base = bi->b->hseqbase;
const char *b_vars = bi->vh->base, *b_vals = bi->base;
- size_t off;
+ var_t off;
canditer_reset(bci);
TIMEOUT_LOOP(bci->ncand, qry_ctx) {
@@ -2362,7 +2362,7 @@ bigram_strjoin(BAT *rl, BAT *rr, BATiter
oid l_base = li->b->hseqbase, r_base = ri->b->hseqbase;
const char *l_vars = li->vh->base, *r_vars = ri->vh->base,
*l_vals = li->base, *r_vals = ri->base;
- size_t off;
+ var_t off;
lng t0 = 0;
TRC_DEBUG_IF(ALGO) t0 = GDKusec();
@@ -2538,7 +2538,7 @@ sorted_strjoin(BAT **rl_ptr, BAT **rr_pt
ol = 0, or = 0, ly = 0, rx = 0, n;
const char *sorted_l_vars = sorted_li->vh->base, *sorted_r_vars =
sorted_ri->vh->base,
*sorted_l_vals = sorted_li->base, *sorted_r_vals =
sorted_ri->base;
- size_t off;
+ var_t off;
size_t new_cap;
TIMEOUT_LOOP(sorted_lci.ncand, qry_ctx) {
diff --git a/monetdb5/modules/mal/pcre.c b/monetdb5/modules/mal/pcre.c
--- a/monetdb5/modules/mal/pcre.c
+++ b/monetdb5/modules/mal/pcre.c
@@ -1567,7 +1567,7 @@ pcrejoin(BAT *r1, BAT *r2, BAT *l, BAT *
{
struct canditer lci, rci;
const char *lvals, *rvals, *lvars, *rvars, *vl, *vr;
- size_t off;
+ var_t off;
int rskipped = 0; /* whether we skipped values in
r */
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]