Changeset: e71cb7f347a8 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/e71cb7f347a8 Modified Files: gdk/gdk_aggr.c gdk/gdk_analytic.h gdk/gdk_group.c gdk/gdk_select.c gdk/gdk_strimps.c gdk/gdk_string.c gdk/gdk_system.h gdk/gdk_utils.h Branch: default Log Message:
Layout: align backslashes in macros the Emacs way. diffs (truncated from 397 to 300 lines): diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c --- a/gdk/gdk_aggr.c +++ b/gdk/gdk_aggr.c @@ -2934,7 +2934,7 @@ BATgroupavg3combine(BAT *avg, BAT *rem, n++; \ } \ TIMEOUT_CHECK(timeoffset, \ - GOTO_LABEL_TIMEOUT_HANDLER(bailout)); \ + GOTO_LABEL_TIMEOUT_HANDLER(bailout)); \ /* the sum fit, so now we can calculate the average */ \ *avg = n > 0 ? (dbl) sum / n : dbl_nil; \ if (0) { \ @@ -2981,20 +2981,20 @@ BATgroupavg3combine(BAT *avg, BAT *rem, #define AVERAGE_TYPE(TYPE) AVERAGE_TYPE_LNG_HGE(TYPE,lng) #endif -#define AVERAGE_FLOATTYPE(TYPE) \ - do { \ - double a = 0; \ - TYPE x; \ - TIMEOUT_LOOP(ncand, timeoffset) { \ - i = canditer_next(&ci) - b->hseqbase; \ - x = ((const TYPE *) src)[i]; \ - if (is_##TYPE##_nil(x)) \ - continue; \ - AVERAGE_ITER_FLOAT(TYPE, x, a, n); \ - } \ - TIMEOUT_CHECK(timeoffset, \ +#define AVERAGE_FLOATTYPE(TYPE) \ + do { \ + double a = 0; \ + TYPE x; \ + TIMEOUT_LOOP(ncand, timeoffset) { \ + i = canditer_next(&ci) - b->hseqbase; \ + x = ((const TYPE *) src)[i]; \ + if (is_##TYPE##_nil(x)) \ + continue; \ + AVERAGE_ITER_FLOAT(TYPE, x, a, n); \ + } \ + TIMEOUT_CHECK(timeoffset, \ GOTO_LABEL_TIMEOUT_HANDLER(bailout)); \ - *avg = n > 0 ? a : dbl_nil; \ + *avg = n > 0 ? a : dbl_nil; \ } while (0) gdk_return @@ -4671,7 +4671,7 @@ BATcalccovariance_sample(BAT *b1, BAT *b goto overflow; \ } \ TIMEOUT_CHECK(timeoffset, \ - GOTO_LABEL_TIMEOUT_HANDLER(bailout)); \ + GOTO_LABEL_TIMEOUT_HANDLER(bailout)); \ } while (0) dbl diff --git a/gdk/gdk_analytic.h b/gdk/gdk_analytic.h --- a/gdk/gdk_analytic.h +++ b/gdk/gdk_analytic.h @@ -57,71 +57,71 @@ gdk_export gdk_return GDKrebuild_segment /* segment_tree, levels_offset and nlevels must be already defined. ARG1, ARG2 and ARG3 are to be used by the aggregate */ #define populate_segment_tree(CAST, COUNT, INIT_AGGREGATE, COMPUTE_LEVEL0, COMPUTE_LEVELN, ARG1, ARG2, ARG3) \ - do { \ - CAST *ctree = (CAST *) segment_tree; \ - CAST *prev_level_begin = ctree; \ + do { \ + CAST *ctree = (CAST *) segment_tree; \ + CAST *prev_level_begin = ctree; \ oid level_size = COUNT, tree_offset = 0, current_level = 0; \ - \ + \ levels_offset[current_level++] = 0; /* first level is trivial */ \ for (oid pos = 0; pos < level_size; pos += SEGMENT_TREE_FANOUT) { \ oid end = MIN(level_size, pos + SEGMENT_TREE_FANOUT); \ - \ - for (oid x = pos; x < end; x++) { \ - CAST computed; \ + \ + for (oid x = pos; x < end; x++) { \ + CAST computed; \ COMPUTE_LEVEL0(x, ARG1, ARG2, ARG3); \ - ctree[tree_offset++] = computed; \ - } \ - } \ - \ - while (current_level < nlevels) { /* for the following levels we have to use the previous level results */ \ - oid prev_tree_offset = tree_offset; \ - levels_offset[current_level++] = tree_offset; \ + ctree[tree_offset++] = computed; \ + } \ + } \ + \ + while (current_level < nlevels) { /* for the following levels we have to use the previous level results */ \ + oid prev_tree_offset = tree_offset; \ + levels_offset[current_level++] = tree_offset; \ for (oid pos = 0; pos < level_size; pos += SEGMENT_TREE_FANOUT) { \ oid begin = pos, end = MIN(level_size, pos + SEGMENT_TREE_FANOUT), width = end - begin; \ - CAST computed; \ - \ + CAST computed; \ + \ INIT_AGGREGATE(ARG1, ARG2, ARG3); \ - for (oid x = 0; x < width; x++) \ - COMPUTE_LEVELN(prev_level_begin[x], ARG1, ARG2, ARG3); \ - ctree[tree_offset++] = computed; \ - prev_level_begin += width; \ - } \ - level_size = tree_offset - prev_tree_offset; \ - } \ + for (oid x = 0; x < width; x++) \ + COMPUTE_LEVELN(prev_level_begin[x], ARG1, ARG2, ARG3); \ + ctree[tree_offset++] = computed; \ + prev_level_begin += width; \ + } \ + level_size = tree_offset - prev_tree_offset; \ + } \ } while (0) -#define compute_on_segment_tree(CAST, START, END, INIT_AGGREGATE, COMPUTE, FINALIZE_AGGREGATE, ARG1, ARG2, ARG3) \ - do { /* taken from https://www.vldb.org/pvldb/vol8/p1058-leis.pdf */ \ - oid begin = START, tend = END; \ - CAST computed; \ - \ - INIT_AGGREGATE(ARG1, ARG2, ARG3); \ - for (oid level = 0; level < nlevels; level++) { \ +#define compute_on_segment_tree(CAST, START, END, INIT_AGGREGATE, COMPUTE, FINALIZE_AGGREGATE, ARG1, ARG2, ARG3) \ + do { /* taken from https://www.vldb.org/pvldb/vol8/p1058-leis.pdf */ \ + oid begin = START, tend = END; \ + CAST computed; \ + \ + INIT_AGGREGATE(ARG1, ARG2, ARG3); \ + for (oid level = 0; level < nlevels; level++) { \ CAST *tlevel = (CAST *) segment_tree + levels_offset[level]; \ oid parent_begin = begin / SEGMENT_TREE_FANOUT; \ - oid parent_end = tend / SEGMENT_TREE_FANOUT; \ - \ - if (parent_begin == parent_end) { \ + oid parent_end = tend / SEGMENT_TREE_FANOUT; \ + \ + if (parent_begin == parent_end) { \ for (oid pos = begin; pos < tend; pos++) \ COMPUTE(tlevel[pos], ARG1, ARG2, ARG3); \ - break; \ - } \ + break; \ + } \ oid group_begin = parent_begin * SEGMENT_TREE_FANOUT; \ - if (begin != group_begin) { \ + if (begin != group_begin) { \ oid limit = group_begin + SEGMENT_TREE_FANOUT; \ for (oid pos = begin; pos < limit; pos++) \ COMPUTE(tlevel[pos], ARG1, ARG2, ARG3); \ - parent_begin++; \ - } \ + parent_begin++; \ + } \ oid group_end = parent_end * SEGMENT_TREE_FANOUT; \ - if (tend != group_end) { \ + if (tend != group_end) { \ for (oid pos = group_end; pos < tend; pos++) \ COMPUTE(tlevel[pos], ARG1, ARG2, ARG3); \ - } \ - begin = parent_begin; \ - tend = parent_end; \ - } \ - FINALIZE_AGGREGATE(ARG1, ARG2, ARG3); \ + } \ + begin = parent_begin; \ + tend = parent_end; \ + } \ + FINALIZE_AGGREGATE(ARG1, ARG2, ARG3); \ } while (0) #endif //_GDK_ANALYTIC_H_ diff --git a/gdk/gdk_group.c b/gdk/gdk_group.c --- a/gdk/gdk_group.c +++ b/gdk/gdk_group.c @@ -611,7 +611,7 @@ ctz(oid x) if (ci.tpe == cand_dense) { \ TIMEOUT_LOOP_IDX(r, cnt, timeoffset) { \ oid o = canditer_next_dense(&ci); \ - p = o - hseqb; \ + p = o - hseqb; \ uint##BG##_t x = GV; \ if ((v = sgrps[x]) == (uint##BG##_t) ~0 && ngrp < (1 << BG)) { \ sgrps[x] = v = (uint##BG##_t) ngrp++; \ @@ -628,7 +628,7 @@ ctz(oid x) } else { \ TIMEOUT_LOOP_IDX(r, cnt, timeoffset) { \ oid o = canditer_next(&ci); \ - p = o - hseqb; \ + p = o - hseqb; \ uint##BG##_t x = GV; \ if ((v = sgrps[x]) == (uint##BG##_t) ~0 && ngrp < (1 << BG)) { \ sgrps[x] = v = (uint##BG##_t) ngrp++; \ diff --git a/gdk/gdk_select.c b/gdk/gdk_select.c --- a/gdk/gdk_select.c +++ b/gdk/gdk_select.c @@ -215,7 +215,7 @@ hashselect(BAT *b, BATiter *bi, struct c const oid e = (oid) (i+limit-pr_off+hseq); \ if (im[icnt] & mask) { \ if ((im[icnt] & ~innermask) == 0) { \ - while (p < ncand && o < e) { \ + while (p < ncand && o < e) { \ v = src[o-hseq]; \ if ((ADD) == NULL) { \ BBPreclaim(bn); \ @@ -226,7 +226,7 @@ hashselect(BAT *b, BATiter *bi, struct c o = canditer_next(ci); \ } \ } else { \ - while (p < ncand && o < e) { \ + while (p < ncand && o < e) { \ v = src[o-hseq]; \ if ((ADD) == NULL) { \ BBPreclaim(bn); \ @@ -238,7 +238,7 @@ hashselect(BAT *b, BATiter *bi, struct c } \ } \ } else { \ - while (p < ncand && o < e) { \ + while (p < ncand && o < e) { \ p++; \ o = canditer_next(ci); \ } \ @@ -251,7 +251,7 @@ hashselect(BAT *b, BATiter *bi, struct c const oid e = (oid) (i+limit-pr_off+hseq); \ if (im[icnt] & mask) { \ if ((im[icnt] & ~innermask) == 0) { \ - while (p < ncand && o < e) { \ + while (p < ncand && o < e) { \ v = src[o-hseq]; \ if ((ADD) == NULL) { \ BBPreclaim(bn); \ @@ -262,7 +262,7 @@ hashselect(BAT *b, BATiter *bi, struct c o = canditer_next_dense(ci); \ } \ } else { \ - while (p < ncand && o < e) { \ + while (p < ncand && o < e) { \ v = src[o-hseq]; \ if ((ADD) == NULL) { \ BBPreclaim(bn); \ @@ -274,7 +274,7 @@ hashselect(BAT *b, BATiter *bi, struct c } \ } \ } else { \ - BUN skip_sz = MIN(ncand - p, e - o); \ + BUN skip_sz = MIN(ncand - p, e - o); \ p += skip_sz; \ o += skip_sz; \ ci->next += skip_sz; \ @@ -399,7 +399,7 @@ quickins(oid *dst, BUN cnt, oid o, BAT * /* choose number of bits */ #define bitswitch(ISDENSE, TEST, TYPE) \ do { \ - BUN ncand = ci->ncand; \ + BUN ncand = ci->ncand; \ assert(imprints); \ *algo = parent ? "parent imprints select " #TEST " (canditer_next" #ISDENSE ")" : "imprints select " #TEST " (canditer_next" #ISDENSE ")"; \ switch (imprints->bits) { \ @@ -428,7 +428,7 @@ quickins(oid *dst, BUN cnt, oid o, BAT * /* core scan select loop with & without candidates */ #define scanloop(NAME,canditer_next,TEST) \ do { \ - BUN ncand = ci->ncand; \ + BUN ncand = ci->ncand; \ *algo = "select: " #NAME " " #TEST " (" #canditer_next ")"; \ if (BATcapacity(bn) < maximum) { \ TIMEOUT_LOOP_IDX(p, ncand, timeoffset) { \ diff --git a/gdk/gdk_strimps.c b/gdk/gdk_strimps.c --- a/gdk/gdk_strimps.c +++ b/gdk/gdk_strimps.c @@ -492,14 +492,14 @@ BATcheckstrimps(BAT *b) return ret; } -#define STRMPfilterloop(next) \ - do { \ - for (i = 0; i < ncand; i++) { \ - x = next(&ci); \ - if ((bitstring_array[x] & qbmask) == qbmask) { \ - rvals[j++] = x; \ - } \ - } \ +#define STRMPfilterloop(next) \ + do { \ + for (i = 0; i < ncand; i++) { \ + x = next(&ci); \ + if ((bitstring_array[x] & qbmask) == qbmask) { \ + rvals[j++] = x; \ + } \ + } \ } while (0) /* Filter a BAT b using a string q. Return the result as a candidate diff --git a/gdk/gdk_string.c b/gdk/gdk_string.c --- a/gdk/gdk_string.c +++ b/gdk/gdk_string.c @@ -1178,7 +1178,7 @@ done: _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org