Remove extraneous parens around return arguments.

This resolves #540.
This commit is contained in:
Jason Evans
2017-01-19 18:15:45 -08:00
parent c4c2592c83
commit f408643a4c
104 changed files with 1161 additions and 1168 deletions

View File

@@ -26,5 +26,5 @@ btalloc_##n(size_t size, unsigned bits) { \
} \
/* Intentionally sabotage tail call optimization. */ \
assert_ptr_not_null(p, "Unexpected mallocx() failure"); \
return (p); \
return p; \
}

View File

@@ -86,12 +86,12 @@ extent_alloc_hook(extent_hooks_t *extent_hooks, void *new_addr, size_t size,
"Wrong hook function");
called_alloc = true;
if (!try_alloc) {
return (NULL);
return NULL;
}
ret = default_hooks->alloc(default_hooks, new_addr, size, alignment,
zero, commit, 0);
did_alloc = (ret != NULL);
return (ret);
return ret;
}
static bool
@@ -108,11 +108,11 @@ extent_dalloc_hook(extent_hooks_t *extent_hooks, void *addr, size_t size,
"Wrong hook function");
called_dalloc = true;
if (!try_dalloc) {
return (true);
return true;
}
err = default_hooks->dalloc(default_hooks, addr, size, committed, 0);
did_dalloc = !err;
return (err);
return err;
}
static bool
@@ -129,12 +129,12 @@ extent_commit_hook(extent_hooks_t *extent_hooks, void *addr, size_t size,
"Wrong hook function");
called_commit = true;
if (!try_commit) {
return (true);
return true;
}
err = default_hooks->commit(default_hooks, addr, size, offset, length,
0);
did_commit = !err;
return (err);
return err;
}
static bool
@@ -151,12 +151,12 @@ extent_decommit_hook(extent_hooks_t *extent_hooks, void *addr, size_t size,
"Wrong hook function");
called_decommit = true;
if (!try_decommit) {
return (true);
return true;
}
err = default_hooks->decommit(default_hooks, addr, size, offset, length,
0);
did_decommit = !err;
return (err);
return err;
}
static bool
@@ -173,13 +173,13 @@ extent_purge_lazy_hook(extent_hooks_t *extent_hooks, void *addr, size_t size,
"Wrong hook function");
called_purge_lazy = true;
if (!try_purge_lazy) {
return (true);
return true;
}
err = default_hooks->purge_lazy == NULL ||
default_hooks->purge_lazy(default_hooks, addr, size, offset, length,
0);
did_purge_lazy = !err;
return (err);
return err;
}
static bool
@@ -196,13 +196,13 @@ extent_purge_forced_hook(extent_hooks_t *extent_hooks, void *addr, size_t size,
"Wrong hook function");
called_purge_forced = true;
if (!try_purge_forced) {
return (true);
return true;
}
err = default_hooks->purge_forced == NULL ||
default_hooks->purge_forced(default_hooks, addr, size, offset,
length, 0);
did_purge_forced = !err;
return (err);
return err;
}
static bool
@@ -220,13 +220,13 @@ extent_split_hook(extent_hooks_t *extent_hooks, void *addr, size_t size,
"Wrong hook function");
called_split = true;
if (!try_split) {
return (true);
return true;
}
err = (default_hooks->split == NULL ||
default_hooks->split(default_hooks, addr, size, size_a, size_b,
committed, 0));
did_split = !err;
return (err);
return err;
}
static bool
@@ -244,13 +244,13 @@ extent_merge_hook(extent_hooks_t *extent_hooks, void *addr_a, size_t size_a,
"Wrong hook function");
called_merge = true;
if (!try_merge) {
return (true);
return true;
}
err = (default_hooks->merge == NULL ||
default_hooks->merge(default_hooks, addr_a, size_a, addr_b, size_b,
committed, 0));
did_merge = !err;
return (err);
return err;
}
static void

View File

@@ -36,9 +36,9 @@ ln_gamma(double x) {
z = 1.0 / (x * x);
return (f + (x-0.5) * log(x) - x + 0.918938533204673 +
return f + (x-0.5) * log(x) - x + 0.918938533204673 +
(((-0.000595238095238 * z + 0.000793650793651) * z -
0.002777777777778) * z + 0.083333333333333) / x);
0.002777777777778) * z + 0.083333333333333) / x;
}
/*
@@ -60,7 +60,7 @@ i_gamma(double x, double p, double ln_gamma_p) {
assert(x >= 0.0);
if (x == 0.0) {
return (0.0);
return 0.0;
}
acu = 1.0e-10;
@@ -80,7 +80,7 @@ i_gamma(double x, double p, double ln_gamma_p) {
gin += term;
if (term <= acu) {
gin *= factor / p;
return (gin);
return gin;
}
}
} else {
@@ -107,7 +107,7 @@ i_gamma(double x, double p, double ln_gamma_p) {
dif = fabs(gin - rn);
if (dif <= acu && dif <= acu * rn) {
gin = 1.0 - factor * gin;
return (gin);
return gin;
}
gin = rn;
}
@@ -144,7 +144,7 @@ pt_norm(double p) {
if (fabs(q) <= 0.425) {
/* p close to 1/2. */
r = 0.180625 - q * q;
return (q * (((((((2.5090809287301226727e3 * r +
return q * (((((((2.5090809287301226727e3 * r +
3.3430575583588128105e4) * r + 6.7265770927008700853e4) * r
+ 4.5921953931549871457e4) * r + 1.3731693765509461125e4) *
r + 1.9715909503065514427e3) * r + 1.3314166789178437745e2)
@@ -153,7 +153,7 @@ pt_norm(double p) {
2.8729085735721942674e4) * r + 3.9307895800092710610e4) * r
+ 2.1213794301586595867e4) * r + 5.3941960214247511077e3) *
r + 6.8718700749205790830e2) * r + 4.2313330701600911252e1)
* r + 1.0));
* r + 1.0);
} else {
if (q < 0.0) {
r = p;
@@ -204,7 +204,7 @@ pt_norm(double p) {
if (q < 0.0) {
ret = -ret;
}
return (ret);
return ret;
}
}
@@ -240,7 +240,7 @@ pt_chi2(double p, double df, double ln_gamma_df_2) {
/* Starting approximation for small Chi^2. */
ch = pow(p * xx * exp(ln_gamma_df_2 + xx * aa), 1.0 / xx);
if (ch - e < 0.0) {
return (ch);
return ch;
}
} else {
if (df > 0.32) {
@@ -279,7 +279,7 @@ pt_chi2(double p, double df, double ln_gamma_df_2) {
q = ch;
p1 = 0.5 * ch;
if (p1 < 0.0) {
return (-1.0);
return -1.0;
}
p2 = p - i_gamma(p1, xx, ln_gamma_df_2);
t = p2 * exp(xx * aa + ln_gamma_df_2 + p1 - c * log(ch));
@@ -301,7 +301,7 @@ pt_chi2(double p, double df, double ln_gamma_df_2) {
}
}
return (ch);
return ch;
}
/*
@@ -311,6 +311,6 @@ pt_chi2(double p, double df, double ln_gamma_df_2) {
*/
JEMALLOC_INLINE double
pt_gamma(double p, double shape, double scale, double ln_gamma_shape) {
return (pt_chi2(p, shape * 2.0, ln_gamma_shape) * 0.5 * scale);
return pt_chi2(p, shape * 2.0, ln_gamma_shape) * 0.5 * scale;
}
#endif

View File

@@ -38,11 +38,11 @@ a_attr bool \
a_prefix##init(a_mq_type *mq) { \
\
if (mtx_init(&mq->lock)) { \
return (true); \
return true; \
} \
ql_new(&mq->msgs); \
mq->count = 0; \
return (false); \
return false; \
} \
a_attr void \
a_prefix##fini(a_mq_type *mq) { \
@@ -55,7 +55,7 @@ a_prefix##count(a_mq_type *mq) { \
mtx_lock(&mq->lock); \
count = mq->count; \
mtx_unlock(&mq->lock); \
return (count); \
return count; \
} \
a_attr a_mq_msg_type * \
a_prefix##tryget(a_mq_type *mq) { \
@@ -68,7 +68,7 @@ a_prefix##tryget(a_mq_type *mq) { \
mq->count--; \
} \
mtx_unlock(&mq->lock); \
return (msg); \
return msg; \
} \
a_attr a_mq_msg_type * \
a_prefix##get(a_mq_type *mq) { \
@@ -77,7 +77,7 @@ a_prefix##get(a_mq_type *mq) { \
\
msg = a_prefix##tryget(mq); \
if (msg != NULL) { \
return (msg); \
return msg; \
} \
\
ns = 1; \
@@ -85,7 +85,7 @@ a_prefix##get(a_mq_type *mq) { \
mq_nanosleep(ns); \
msg = a_prefix##tryget(mq); \
if (msg != NULL) { \
return (msg); \
return msg; \
} \
if (ns < 1000*1000*1000) { \
/* Double sleep time, up to max 1 second. */ \