Changeset: b761d28910af for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=b761d28910af
Modified Files:
clients/Tests/exports.stable.out
gdk/gdk_aggr.c
gdk/gdk_calc.h
monetdb5/modules/atoms/batxml.c
monetdb5/modules/atoms/json.c
Branch: default
Log Message:
Simplify interface: don't return value that nobody uses.
diffs (275 lines):
diff --git a/clients/Tests/exports.stable.out b/clients/Tests/exports.stable.out
--- a/clients/Tests/exports.stable.out
+++ b/clients/Tests/exports.stable.out
@@ -115,7 +115,7 @@ gdk_return BATfirstn(BAT **topn, BAT **g
int BATgetaccess(BAT *b);
PROPrec *BATgetprop(BAT *b, int idx);
gdk_return BATgroup(BAT **groups, BAT **extents, BAT **histo, BAT *b, BAT *g,
BAT *e, BAT *h);
-const char *BATgroupaggrinit(BAT *b, BAT *g, BAT *e, BAT *s, oid *minp, oid
*maxp, BUN *ngrpp, BUN *startp, BUN *endp, BUN *cntp, const oid **candp, const
oid **candendp);
+const char *BATgroupaggrinit(BAT *b, BAT *g, BAT *e, BAT *s, oid *minp, oid
*maxp, BUN *ngrpp, BUN *startp, BUN *endp, const oid **candp, const oid
**candendp);
gdk_return BATgroupavg(BAT **bnp, BAT **cntsp, BAT *b, BAT *g, BAT *e, BAT *s,
int tp, int skip_nils, int abort_on_error);
BAT *BATgroupcount(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int skip_nils, int
abort_on_error);
BAT *BATgroupmax(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int skip_nils, int
abort_on_error);
diff --git a/gdk/gdk_aggr.c b/gdk/gdk_aggr.c
--- a/gdk/gdk_aggr.c
+++ b/gdk/gdk_aggr.c
@@ -62,7 +62,7 @@ const char *
BATgroupaggrinit(BAT *b, BAT *g, BAT *e, BAT *s,
/* outputs: */
oid *minp, oid *maxp, BUN *ngrpp, BUN *startp, BUN *endp,
- BUN *cntp, const oid **candp, const oid **candendp)
+ const oid **candp, const oid **candendp)
{
oid min, max;
BUN i, ngrp;
@@ -130,7 +130,6 @@ BATgroupaggrinit(BAT *b, BAT *g, BAT *e,
CANDINIT(b, s, start, end, cnt, cand, candend);
*startp = start;
*endp = end;
- *cntp = cnt;
*candp = cand;
*candendp = candend;
@@ -471,12 +470,12 @@ BATgroupsum(BAT *b, BAT *g, BAT *e, BAT
BUN ngrp;
BUN nils;
BAT *bn;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand, &candend)) != NULL) {
+ &cand, &candend)) != NULL) {
GDKerror("BATgroupsum: %s\n", err);
return NULL;
}
@@ -535,13 +534,12 @@ BATsum(void *res, int tp, BAT *b, BAT *s
oid min, max;
BUN ngrp;
BUN nils;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
if ((err = BATgroupaggrinit(b, NULL, NULL, s, &min, &max, &ngrp,
- &start, &end, &cnt,
- &cand, &candend)) != NULL) {
+ &start, &end, &cand, &candend)) != NULL) {
GDKerror("BATsum: %s\n", err);
return GDK_FAIL;
}
@@ -1075,12 +1073,12 @@ BATgroupprod(BAT *b, BAT *g, BAT *e, BAT
BUN ngrp;
BUN nils;
BAT *bn;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand, &candend)) != NULL) {
+ &cand, &candend)) != NULL) {
GDKerror("BATgroupprod: %s\n", err);
return NULL;
}
@@ -1139,13 +1137,12 @@ BATprod(void *res, int tp, BAT *b, BAT *
oid min, max;
BUN ngrp;
BUN nils;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
if ((err = BATgroupaggrinit(b, NULL, NULL, s, &min, &max, &ngrp,
- &start, &end, &cnt,
- &cand, &candend)) != NULL) {
+ &start, &end, &cand, &candend)) != NULL) {
GDKerror("BATprod: %s\n", err);
return GDK_FAIL;
}
@@ -1351,7 +1348,7 @@ BATgroupavg(BAT **bnp, BAT **cntsp, BAT
lng *restrict cnts = NULL;
dbl *restrict dbls;
BAT *bn = NULL;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
@@ -1360,7 +1357,7 @@ BATgroupavg(BAT **bnp, BAT **cntsp, BAT
* functions) argument */
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand, &candend)) != NULL) {
+ &cand, &candend)) != NULL) {
GDKerror("BATgroupavg: %s\n", err);
return GDK_FAIL;
}
@@ -1720,7 +1717,7 @@ BATgroupcount(BAT *b, BAT *g, BAT *e, BA
const void *nil;
int (*atomcmp)(const void *, const void *);
BATiter bi;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
@@ -1729,7 +1726,7 @@ BATgroupcount(BAT *b, BAT *g, BAT *e, BA
(void) abort_on_error; /* functions) argument */
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand, &candend)) != NULL) {
+ &cand, &candend)) != NULL) {
GDKerror("BATgroupcount: %s\n", err);
return NULL;
}
@@ -1833,7 +1830,7 @@ BATgroupsize(BAT *b, BAT *g, BAT *e, BAT
const bit *restrict bits;
lng *restrict cnts;
BAT *bn = NULL;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
@@ -1845,7 +1842,7 @@ BATgroupsize(BAT *b, BAT *g, BAT *e, BAT
(void) skip_nils;
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand, &candend)) != NULL) {
+ &cand, &candend)) != NULL) {
GDKerror("BATgroupsize: %s\n", err);
return NULL;
}
@@ -2213,7 +2210,7 @@ do_groupmax(oid *restrict oids, BAT *b,
static BAT *
BATgroupminmax(BAT *b, BAT *g, BAT *e, BAT *s, int tp, int skip_nils,
- int abort_on_error,
+ int abort_on_error,
BUN (*minmax)(oid *restrict, BAT *, const oid *restrict, BUN,
oid, oid, BUN, BUN, const oid *restrict,
const oid *, BUN, int, int),
@@ -2225,7 +2222,7 @@ BATgroupminmax(BAT *b, BAT *g, BAT *e, B
oid *restrict oids;
BAT *bn = NULL;
BUN nils;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
@@ -2240,7 +2237,7 @@ BATgroupminmax(BAT *b, BAT *g, BAT *e, B
}
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand, &candend)) != NULL) {
+ &cand, &candend)) != NULL) {
GDKerror("%s: %s\n", name, err);
return NULL;
}
@@ -2262,7 +2259,8 @@ BATgroupminmax(BAT *b, BAT *g, BAT *e, B
gids = (const oid *) Tloc(g, start);
nils = (*minmax)(oids, b, gids, ngrp, min, max, start, end,
- cand, candend, cnt, skip_nils, g && BATtdense(g));
+ cand, candend, BATcount(b), skip_nils,
+ g && BATtdense(g));
BATsetcount(bn, ngrp);
@@ -2379,7 +2377,7 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
BUN ngrp;
BUN nils = 0;
BAT *bn = NULL;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
BAT *t1, *t2;
BATiter bi;
@@ -2390,7 +2388,7 @@ BATgroupquantile(BAT *b, BAT *g, BAT *e,
(void) abort_on_error;
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand, &candend)) != NULL) {
+ &cand, &candend)) != NULL) {
GDKerror("BATgroupquantile: %s\n", err);
return NULL;
}
@@ -2705,7 +2703,7 @@ dogroupstdev(BAT **avgb, BAT *b, BAT *g,
BUN *restrict cnts = NULL;
dbl *restrict dbls, *restrict mean, *restrict delta, *restrict m2;
BAT *bn = NULL;
- BUN start, end, cnt;
+ BUN start, end;
const oid *cand = NULL, *candend = NULL;
const char *err;
@@ -2714,7 +2712,7 @@ dogroupstdev(BAT **avgb, BAT *b, BAT *g,
* functions) argument */
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand, &candend)) != NULL) {
+ &cand, &candend)) != NULL) {
GDKerror("%s: %s\n", func, err);
return NULL;
}
diff --git a/gdk/gdk_calc.h b/gdk/gdk_calc.h
--- a/gdk/gdk_calc.h
+++ b/gdk/gdk_calc.h
@@ -126,7 +126,7 @@ gdk_export BAT *BATgroupquantile(BAT *b,
gdk_export const char *BATgroupaggrinit(
BAT *b, BAT *g, BAT *e, BAT *s,
/* outputs: */
- oid *minp, oid *maxp, BUN *ngrpp, BUN *startp, BUN *endp, BUN *cntp,
+ oid *minp, oid *maxp, BUN *ngrpp, BUN *startp, BUN *endp,
const oid **candp, const oid **candendp);
gdk_export gdk_return BATsum(void *res, int tp, BAT *b, BAT *s, int skip_nils,
int abort_on_error, int nil_if_empty);
diff --git a/monetdb5/modules/atoms/batxml.c b/monetdb5/modules/atoms/batxml.c
--- a/monetdb5/modules/atoms/batxml.c
+++ b/monetdb5/modules/atoms/batxml.c
@@ -1175,7 +1175,7 @@ BATxmlaggr(BAT **bnp, BAT *b, BAT *g, BA
BAT *bn = NULL, *t1, *t2 = NULL;
BATiter bi;
oid min, max;
- BUN ngrp, start, end, cnt;
+ BUN ngrp, start, end;
BUN nils = 0;
int isnil;
const oid *cand = NULL, *candend = NULL;
@@ -1190,7 +1190,7 @@ BATxmlaggr(BAT **bnp, BAT *b, BAT *g, BA
const char *err;
if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start, &end,
- &cnt, &cand,
&candend)) != NULL) {
+ &cand,
&candend)) != NULL) {
return err;
}
assert(b->ttype == TYPE_xml);
diff --git a/monetdb5/modules/atoms/json.c b/monetdb5/modules/atoms/json.c
--- a/monetdb5/modules/atoms/json.c
+++ b/monetdb5/modules/atoms/json.c
@@ -1862,7 +1862,7 @@ JSONjsonaggr(BAT **bnp, BAT *b, BAT *g,
BAT *bn = NULL, *t1, *t2 = NULL;
BATiter bi;
oid min, max;
- BUN ngrp, start, end, cnt;
+ BUN ngrp, start, end;
BUN nils = 0;
int isnil;
const oid *cand = NULL, *candend = NULL;
@@ -1878,7 +1878,7 @@ JSONjsonaggr(BAT **bnp, BAT *b, BAT *g,
char temp[128] = "";
const double *val = NULL;
- if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start,
&end, &cnt, &cand, &candend)) !=NULL) {
+ if ((err = BATgroupaggrinit(b, g, e, s, &min, &max, &ngrp, &start,
&end, &cand, &candend)) !=NULL) {
return err;
}
assert(b->ttype == TYPE_str || b->ttype == TYPE_dbl);
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list