Changeset: ff11b28afb6b for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=ff11b28afb6b
Modified Files:
sql/backends/monet5/sql_fround.c
Branch: default
Log Message:
Ran through indent.
diffs (truncated from 569 to 300 lines):
diff --git a/sql/backends/monet5/sql_fround.c b/sql/backends/monet5/sql_fround.c
--- a/sql/backends/monet5/sql_fround.c
+++ b/sql/backends/monet5/sql_fround.c
@@ -16,72 +16,67 @@
#include "mal_instruction.h"
static lng scales[20] = {
- LL_CONSTANT(1),
- LL_CONSTANT(10),
- LL_CONSTANT(100),
- LL_CONSTANT(1000),
- LL_CONSTANT(10000),
- LL_CONSTANT(100000),
- LL_CONSTANT(1000000),
- LL_CONSTANT(10000000),
- LL_CONSTANT(100000000),
- LL_CONSTANT(1000000000),
- LL_CONSTANT(10000000000),
- LL_CONSTANT(100000000000),
- LL_CONSTANT(1000000000000),
- LL_CONSTANT(10000000000000),
- LL_CONSTANT(100000000000000),
- LL_CONSTANT(1000000000000000),
- LL_CONSTANT(10000000000000000),
- LL_CONSTANT(100000000000000000),
- LL_CONSTANT(1000000000000000000)
+ LL_CONSTANT(1),
+ LL_CONSTANT(10),
+ LL_CONSTANT(100),
+ LL_CONSTANT(1000),
+ LL_CONSTANT(10000),
+ LL_CONSTANT(100000),
+ LL_CONSTANT(1000000),
+ LL_CONSTANT(10000000),
+ LL_CONSTANT(100000000),
+ LL_CONSTANT(1000000000),
+ LL_CONSTANT(10000000000),
+ LL_CONSTANT(100000000000),
+ LL_CONSTANT(1000000000000),
+ LL_CONSTANT(10000000000000),
+ LL_CONSTANT(100000000000000),
+ LL_CONSTANT(1000000000000000),
+ LL_CONSTANT(10000000000000000),
+ LL_CONSTANT(100000000000000000),
+ LL_CONSTANT(1000000000000000000)
};
static inline flt
-flt_dec_round_body_nonil( flt v, flt r )
+flt_dec_round_body_nonil(flt v, flt r)
{
assert(v != flt_nil);
return v / r;
}
-
-static inline flt \
- flt_dec_round_body ( flt v, flt r )
+static inline flt
+flt_dec_round_body(flt v, flt r)
{
/* shortcut nil */
if (v == flt_nil) {
return flt_nil;
} else {
- return \
- flt_dec_round_body_nonil ( v, r );
+ return flt_dec_round_body_nonil(v, r);
}
}
-str \
- flt_dec_round_wrap ( flt *res, flt *v, flt *r )
+str
+flt_dec_round_wrap(flt *res, flt *v, flt *r)
{
/* basic sanity checks */
- assert(res && v && r \
-);
+ assert(res && v && r);
- *res = \
- flt_dec_round_body ( *v, *r );
+ *res = flt_dec_round_body(*v, *r);
return MAL_SUCCEED;
}
-str \
- flt_bat_dec_round_wrap ( bat *_res, bat *_v, flt *r )
+str
+flt_bat_dec_round_wrap(bat *_res, bat *_v, flt *r)
{
BAT *res, *v;
flt *src, *dst;
BUN i, cnt;
- bit nonil; /* TRUE: we know there are no NIL (NULL) values */
- bit nil; /* TRUE: we know there is at least one NIL (NULL) value */
+ bit nonil; /* TRUE: we know there are no NIL (NULL) values */
+ bit nil; /* TRUE: we know there is at least one NIL (NULL) value */
/* basic sanity checks */
- assert(_res && _v && r \
-);
+ assert(_res && _v && r);
/* get argument BAT descriptor */
if ((v = BATdescriptor(*_v)) == NULL)
@@ -106,15 +101,14 @@ str \
}
/* access columns as arrays */
- src = (flt*) Tloc(v, BUNfirst(v));
- dst = (flt*) Tloc(res, BUNfirst(res));
+ src = (flt *) Tloc(v, BUNfirst(v));
+ dst = (flt *) Tloc(res, BUNfirst(res));
nil = FALSE;
nonil = TRUE;
if (v->T->nonil == TRUE) {
for (i = 0; i < cnt; i++)
- dst[i] = \
- flt_dec_round_body_nonil ( src[i], *r );
+ dst[i] = flt_dec_round_body_nonil(src[i], *r);
} else {
for (i = 0; i < cnt; i++) {
if (src[i] == flt_nil) {
@@ -122,8 +116,7 @@ str \
nonil = FALSE;
dst[i] = flt_nil;
} else {
- dst[i] = \
- flt_dec_round_body_nonil ( src[i], *r );
+ dst[i] = flt_dec_round_body_nonil(src[i], *r);
}
}
}
@@ -134,9 +127,9 @@ str \
ALIGNsetH(res, v);
/* hard to predict correct tail properties in general */
res->T->nonil = nonil;
- res->T->nil = nil;
- res->tdense = FALSE;
- res->tsorted = v->tsorted;
+ res->T->nil = nil;
+ res->tdense = FALSE;
+ res->tsorted = v->tsorted;
BATkey(BATmirror(res), FALSE);
/* release argument BAT descriptors */
@@ -148,11 +141,8 @@ str \
return MAL_SUCCEED;
}
-
-
-
static inline flt
-flt_round_body_nonil( flt v, bte r )
+flt_round_body_nonil(flt v, bte r)
{
flt res = flt_nil;
@@ -160,56 +150,51 @@ flt_round_body_nonil( flt v, bte r )
if (r < 0) {
int d = -r;
- flt rnd = (flt) (scales[d]>>1);
+ flt rnd = (flt) (scales[d] >> 1);
- res = (flt) (floor(((v + rnd)/((flt)(scales[d]))))*scales[d]);
+ res = (flt) (floor(((v + rnd) / ((flt) (scales[d])))) *
scales[d]);
} else if (r > 0) {
int d = r;
- res = (flt) (floor(v*(flt)scales[d]+.5)/scales[d]);
+ res = (flt) (floor(v * (flt) scales[d] + .5) / scales[d]);
} else {
res = (flt) round(v);
}
return res;
}
-
-static inline flt \
- flt_round_body ( flt v, bte r )
+static inline flt
+flt_round_body(flt v, bte r)
{
/* shortcut nil */
if (v == flt_nil) {
return flt_nil;
} else {
- return \
- flt_round_body_nonil ( v, r );
+ return flt_round_body_nonil(v, r);
}
}
-str \
- flt_round_wrap ( flt *res, flt *v, bte *r )
+str
+flt_round_wrap(flt *res, flt *v, bte *r)
{
/* basic sanity checks */
- assert(res && v && r \
-);
+ assert(res && v && r);
- *res = \
- flt_round_body ( *v, *r );
+ *res = flt_round_body(*v, *r);
return MAL_SUCCEED;
}
-str \
- flt_bat_round_wrap ( bat *_res, bat *_v, bte *r )
+str
+flt_bat_round_wrap(bat *_res, bat *_v, bte *r)
{
BAT *res, *v;
flt *src, *dst;
BUN i, cnt;
- bit nonil; /* TRUE: we know there are no NIL (NULL) values */
- bit nil; /* TRUE: we know there is at least one NIL (NULL) value */
+ bit nonil; /* TRUE: we know there are no NIL (NULL) values */
+ bit nil; /* TRUE: we know there is at least one NIL (NULL) value */
/* basic sanity checks */
- assert(_res && _v && r \
-);
+ assert(_res && _v && r);
/* get argument BAT descriptor */
if ((v = BATdescriptor(*_v)) == NULL)
@@ -234,15 +219,14 @@ str \
}
/* access columns as arrays */
- src = (flt*) Tloc(v, BUNfirst(v));
- dst = (flt*) Tloc(res, BUNfirst(res));
+ src = (flt *) Tloc(v, BUNfirst(v));
+ dst = (flt *) Tloc(res, BUNfirst(res));
nil = FALSE;
nonil = TRUE;
if (v->T->nonil == TRUE) {
for (i = 0; i < cnt; i++)
- dst[i] = \
- flt_round_body_nonil ( src[i], *r );
+ dst[i] = flt_round_body_nonil(src[i], *r);
} else {
for (i = 0; i < cnt; i++) {
if (src[i] == flt_nil) {
@@ -250,8 +234,7 @@ str \
nonil = FALSE;
dst[i] = flt_nil;
} else {
- dst[i] = \
- flt_round_body_nonil ( src[i], *r );
+ dst[i] = flt_round_body_nonil(src[i], *r);
}
}
}
@@ -262,9 +245,9 @@ str \
ALIGNsetH(res, v);
/* hard to predict correct tail properties in general */
res->T->nonil = nonil;
- res->T->nil = nil;
- res->tdense = FALSE;
- res->tsorted = v->tsorted;
+ res->T->nil = nil;
+ res->tdense = FALSE;
+ res->tsorted = v->tsorted;
BATkey(BATmirror(res), FALSE);
/* release argument BAT descriptors */
@@ -276,76 +259,64 @@ str \
return MAL_SUCCEED;
}
-
-
-
str
-flt_trunc_wrap( flt *res, flt *v, int *r )
+flt_trunc_wrap(flt *res, flt *v, int *r)
{
/* shortcut nil */
if (*v == flt_nil) {
*res = flt_nil;
} else if (*r < 0) {
int d = -*r;
- *res = (flt) (trunc((*v)/((flt)scales[d])) * scales[d]);
+ *res = (flt) (trunc((*v) / ((flt) scales[d])) * scales[d]);
} else if (*r > 0) {
int d = *r;
- *res = (flt) (trunc(*v * (flt)scales[d]) / ((flt)scales[d]));
+ *res = (flt) (trunc(*v * (flt) scales[d]) / ((flt) scales[d]));
} else {
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list