Changeset: fcf98bd61fdc for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=fcf98bd61fdc Modified Files: clients/R/Tests/install.sh gdk/gdk_aggr.c gdk/gdk_batop.c gdk/gdk_calc.c gdk/gdk_calc_compare.h gdk/gdk_cand.h gdk/gdk_cross.c gdk/gdk_firstn.c gdk/gdk_group.c gdk/gdk_imprints.c gdk/gdk_join.c gdk/gdk_private.h gdk/gdk_qsort_impl.h gdk/gdk_select.c gdk/gdk_ssort.c sql/server/sql_scan.c Branch: default Log Message:
Merge with Oct2014 branch. diffs (truncated from 1438 to 300 lines): diff --git a/clients/R/Tests/install.sh b/clients/R/Tests/install.sh --- a/clients/R/Tests/install.sh +++ b/clients/R/Tests/install.sh @@ -2,10 +2,10 @@ # install local version RLIBDIR=$TSTTRGDIR/rlibdir mkdir -p $RLIBDIR -R CMD INSTALL $TSTSRCDIR/../MonetDB.R -l $RLIBDIR >> /dev/null 2>&1 +out1=$(R CMD INSTALL $TSTSRCDIR/../MonetDB.R -l $RLIBDIR 2>&1) # try loading the required packages -R --vanilla --quiet -e "library(MonetDB.R,lib.loc=\"$RLIBDIR\"); library(dplyr); library(sqlsurvey)" >> /dev/null 2>&1 +out2=$(R --vanilla --quiet -e "library(MonetDB.R,lib.loc=\"$RLIBDIR\"); library(dplyr); library(sqlsurvey)" 2>&1) RRET=$? @@ -13,5 +13,8 @@ if [ $RRET -eq 0 ]; then echo "All right, packages installed" else - echo "Something went wrong" -fi \ No newline at end of file + echo "Something went wrong" + echo "$out1" + echo + echo "$out2" +fi diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c --- a/gdk/gdk_aggr.c +++ b/gdk/gdk_aggr.c @@ -77,7 +77,7 @@ BATgroupaggrinit(BAT *b, BAT *g, BAT *e, { oid min, max; BUN i, ngrp; - const oid *gids; + const oid *restrict gids; BUN start, end, cnt; const oid *cand = NULL, *candend = NULL; @@ -489,7 +489,7 @@ dosum(const void *restrict values, int n BAT * BATgroupsum(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int skip_nils, int abort_on_error) { - const oid *gids; + const oid *restrict gids; oid min, max; BUN ngrp; BUN nils; @@ -2548,7 +2548,7 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e, atomcmp = BATatoms[b->ttype].atomCmp; if (g) { /* we have to do this by group */ - const oid *grps; + const oid *restrict grps; oid prev; BUN p, q, r; diff --git a/gdk/gdk_batop.c b/gdk/gdk_batop.c --- a/gdk/gdk_batop.c +++ b/gdk/gdk_batop.c @@ -261,12 +261,17 @@ insert_string_bat(BAT *b, BAT *n, int ap * string heap at known locations (namely the offset * in n added to toff), so insert offsets from n after * adding toff into b */ - const unsigned char *tbp = (const unsigned char *) Tloc(n, BUNfirst(n)); - const unsigned short *tsp = (const unsigned short *) Tloc(n, BUNfirst(n)); + /* note the use of the "restrict" qualifier here: all + * four pointers below point to the same value, but + * only one of them will actually be used, hence we + * still obey the rule for restrict-qualified + * pointers */ + const unsigned char *restrict tbp = (const unsigned char *) Tloc(n, BUNfirst(n)); + const unsigned short *restrict tsp = (const unsigned short *) Tloc(n, BUNfirst(n)); #if SIZEOF_VAR_T == 8 - const unsigned int *tip = (const unsigned int *) Tloc(n, BUNfirst(n)); + const unsigned int *restrict tip = (const unsigned int *) Tloc(n, BUNfirst(n)); #endif - const var_t *tvp = (const var_t *) Tloc(n, BUNfirst(n)); + const var_t *restrict tvp = (const var_t *) Tloc(n, BUNfirst(n)); BATloop(n, p, q) { if (!append && b->htype) @@ -1290,7 +1295,7 @@ BATsubsort(BAT **sorted, BAT **order, BA BAT *b, BAT *o, BAT *g, int reverse, int stable) { BAT *bn = NULL, *on = NULL, *gn = NULL; - oid *grps, prev; + oid *restrict grps, prev; BUN p, q, r; if (b == NULL || !BAThdense(b)) { @@ -1716,7 +1721,7 @@ BAT * BATconstant(int tailtype, const void *v, BUN n, int role) { BAT *bn; - void *p; + void *restrict p; BUN i; if (v == NULL) @@ -1883,8 +1888,8 @@ BATcount_no_nil(BAT *b) { BUN cnt = 0; BUN i, n; - const void *p, *nil; - const char *base; + const void *restrict p, *restrict nil; + const char *restrict base; int t; int (*cmp)(const void *, const void *); @@ -2001,8 +2006,8 @@ BAT * BATmergecand(BAT *a, BAT *b) { BAT *bn; - const oid *ap, *bp, *ape, *bpe; - oid *p, i; + const oid *restrict ap, *restrict bp, *ape, *bpe; + oid *restrict p, i; oid af, al, bf, bl; BATiter ai, bi; bit ad, bd; @@ -2135,8 +2140,8 @@ BAT * BATintersectcand(BAT *a, BAT *b) { BAT *bn; - const oid *ap, *bp, *ape, *bpe; - oid *p; + const oid *restrict ap, *restrict bp, *ape, *bpe; + oid *restrict p; oid af, al, bf, bl; BATiter ai, bi; diff --git a/gdk/gdk_calc.c b/gdk/gdk_calc.c --- a/gdk/gdk_calc.c +++ b/gdk/gdk_calc.c @@ -118,8 +118,8 @@ checkbats(BAT *b1, BAT *b2, const char * #define UNARY_2TYPE_FUNC(TYPE1, TYPE2, FUNC) \ do { \ - const TYPE1 *src = (const TYPE1 *) Tloc(b, b->batFirst); \ - TYPE2 * restrict dst = (TYPE2 *) Tloc(bn, bn->batFirst); \ + const TYPE1 *restrict src = (const TYPE1 *) Tloc(b, b->batFirst); \ + TYPE2 *restrict dst = (TYPE2 *) Tloc(bn, bn->batFirst); \ CANDLOOP(dst, i, TYPE2##_nil, 0, start); \ if (b->T->nonil && cand == NULL) { \ for (i = start; i < end; i++) \ @@ -208,7 +208,7 @@ BATcalcnot(BAT *b, BAT *s) BAT *bn; BUN nils = 0; BUN i, cnt, start, end; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; BATcheck(b, "BATcalcnot"); if (checkbats(b, NULL, "BATcalcnot") == GDK_FAIL) @@ -328,7 +328,7 @@ BATcalcnegate(BAT *b, BAT *s) BAT *bn; BUN nils = 0; BUN i, cnt, start, end; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; BATcheck(b, "BATcalcnegate"); if (checkbats(b, NULL, "BATcalcnegate") == GDK_FAIL) @@ -458,7 +458,7 @@ BATcalcabsolute(BAT *b, BAT *s) BAT *bn; BUN nils= 0; BUN i, cnt, start, end; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; BATcheck(b, "BATcalcabsolute"); if (checkbats(b, NULL, "BATcalcabsolute") == GDK_FAIL) @@ -592,7 +592,7 @@ BATcalciszero(BAT *b, BAT *s) BAT *bn; BUN nils = 0; BUN i, cnt, start, end; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; BATcheck(b, "BATcalciszero"); if (checkbats(b, NULL, "BATcalciszero") == GDK_FAIL) @@ -724,7 +724,7 @@ BATcalcsign(BAT *b, BAT *s) BAT *bn; BUN nils = 0; BUN i, cnt, start, end; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; BATcheck(b, "BATcalcsign"); if (checkbats(b, NULL, "BATcalcsign") == GDK_FAIL) @@ -852,7 +852,7 @@ VARcalcsign(ValPtr ret, const ValRecord #define ISNIL_TYPE(TYPE) \ do { \ - const TYPE *src = (const TYPE *) Tloc(b, b->batFirst); \ + const TYPE *restrict src = (const TYPE *) Tloc(b, b->batFirst); \ for (i = start; i < end; i++) { \ CHECKCAND(dst, i, b->H->seq, bit_nil); \ dst[i] = (bit) (src[i] == TYPE##_nil); \ @@ -864,8 +864,8 @@ BATcalcisnil(BAT *b, BAT *s) { BAT *bn; BUN i, cnt, start, end; - const oid *cand = NULL, *candend = NULL; - bit * restrict dst; + const oid *restrict cand = NULL, *candend = NULL; + bit *restrict dst; BUN nils = 0; BATcheck(b, "BATcalcisnil"); @@ -983,8 +983,8 @@ VARcalcisnotnil(ValPtr ret, const ValRec static BUN \ add_##TYPE1##_##TYPE2##_##TYPE3(const TYPE1 *lft, int incr1, \ const TYPE2 *rgt, int incr2, \ - TYPE3 * restrict dst, BUN cnt, BUN start, \ - BUN end, const oid *cand, \ + TYPE3 *restrict dst, BUN cnt, BUN start, \ + BUN end, const oid *restrict cand, \ const oid *candend, oid candoff, \ int abort_on_error) \ { \ @@ -1013,8 +1013,8 @@ add_##TYPE1##_##TYPE2##_##TYPE3(const TY static BUN \ add_##TYPE1##_##TYPE2##_##TYPE3(const TYPE1 *lft, int incr1, \ const TYPE2 *rgt, int incr2, \ - TYPE3 * restrict dst, BUN cnt, BUN start, \ - BUN end, const oid *cand, \ + TYPE3 *restrict dst, BUN cnt, BUN start, \ + BUN end, const oid *restrict cand, \ const oid *candend, oid candoff) \ { \ BUN i, j, k; \ @@ -1275,8 +1275,8 @@ ADD_3TYPE(dbl, dbl, dbl) static BUN add_typeswitchloop(const void *lft, int tp1, int incr1, const void *rgt, int tp2, int incr2, - void * restrict dst, int tp, BUN cnt, - BUN start, BUN end, const oid *cand, + void *restrict dst, int tp, BUN cnt, + BUN start, BUN end, const oid *restrict cand, const oid *candend, oid candoff, int abort_on_error, const char *func) { @@ -2481,7 +2481,7 @@ add_typeswitchloop(const void *lft, int static BUN addstr_loop(BAT *b1, const char *l, BAT *b2, const char *r, BAT *bn, - BUN cnt, BUN start, BUN end, const oid *cand, const oid *candend) + BUN cnt, BUN start, BUN end, const oid *restrict cand, const oid *candend) { BUN i, j, k, frst = BUNfirst(bn); BUN nils = start + (cnt - end); @@ -2553,7 +2553,7 @@ BATcalcadd(BAT *b1, BAT *b2, BAT *s, int BAT *bn; BUN nils; BUN start, end, cnt; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; BATcheck(b1, "BATcalcadd"); BATcheck(b2, "BATcalcadd"); @@ -2609,7 +2609,7 @@ BATcalcaddcst(BAT *b, const ValRecord *v BAT *bn; BUN nils; BUN start, end, cnt; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; BATcheck(b, "BATcalcaddcst"); @@ -2662,7 +2662,7 @@ BATcalccstadd(const ValRecord *v, BAT *b BAT *bn; BUN nils; BUN start, end, cnt; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; BATcheck(b, "BATcalccstadd"); @@ -2733,7 +2733,7 @@ BATcalcincrdecr(BAT *b, BAT *s, int abor BAT *bn; BUN nils= 0; BUN start, end, cnt; - const oid *cand = NULL, *candend = NULL; + const oid *restrict cand = NULL, *candend = NULL; bte one = 1; BATcheck(b, func); @@ -2812,8 +2812,8 @@ VARcalcincr(ValPtr ret, const ValRecord static BUN \ sub_##TYPE1##_##TYPE2##_##TYPE3(const TYPE1 *lft, int incr1, \ const TYPE2 *rgt, int incr2, \ - TYPE3 * restrict dst, BUN cnt, BUN start, \ - BUN end, const oid *cand, \ + TYPE3 *restrict dst, BUN cnt, BUN start, \ + BUN end, const oid *restrict cand, \ const oid *candend, oid candoff, \ _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list