Changeset: d0719c01de60 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/d0719c01de60
Modified Files:
.editorconfig
clients/examples/C/backrefencode.c
clients/examples/C/bincopydata.c
clients/examples/C/bincopytemporaldata.c
clients/examples/C/bincopyuuid.c
clients/examples/C/sample0.c
clients/examples/C/sample1.c
clients/examples/C/sample4.c
clients/examples/C/smack00.c
clients/examples/C/smack01.c
clients/examples/C/streamcat.c
clients/examples/C/testcondvar.c
clients/examples/C/testsfile.c
common/stream/bs.c
common/stream/bz2_stream.c
common/stream/gz_stream.c
common/stream/lz4_stream.c
common/stream/mapi_stream.c
common/stream/pump.c
common/stream/socket_stream.c
common/stream/stdio_stream.c
common/stream/stream_internal.h
common/stream/text_stream.c
common/stream/winio.c
common/stream/xz_stream.c
Branch: default
Log Message:
Use 8-space tabs in all of clients and common subdirectories.
diffs (truncated from 997 to 300 lines):
diff --git a/.editorconfig b/.editorconfig
--- a/.editorconfig
+++ b/.editorconfig
@@ -24,7 +24,7 @@ indent_style = space
indent_size = 2
trim_trailing_whitespace = true
-[{clients/{mapi{lib,client},odbc},common/{options,utils},gdk,geom}/**.{c,h}{,.in}]
+[{clients,common,gdk,geom}/**.{c,h}{,.in}]
tab_width = 8
max_line_length = 72
diff --git a/clients/examples/C/backrefencode.c
b/clients/examples/C/backrefencode.c
--- a/clients/examples/C/backrefencode.c
+++ b/clients/examples/C/backrefencode.c
@@ -21,8 +21,8 @@
// #include <string.h>
#ifdef _WIN32
- #include <io.h>
- #include <fcntl.h>
+#include <io.h>
+#include <fcntl.h>
#endif
// There we go again
@@ -241,24 +241,24 @@ main(int argc, char **argv)
bool do_encode;
switch (argc) {
- case 1:
- do_encode = true;
+ case 1:
+ do_encode = true;
+ break;
+ case 2:
+ if (strcmp(argv[1], "-d") == 0) {
+ do_encode = false;
break;
- case 2:
- if (strcmp(argv[1], "-d") == 0) {
- do_encode = false;
- break;
- }
- /* fallthrough */
- default:
- fprintf(stderr, "Usage: %s [-d] <input >output\n",
argv[0]);
- return 1;
+ }
+ /* fallthrough */
+ default:
+ fprintf(stderr, "Usage: %s [-d] <input >output\n", argv[0]);
+ return 1;
}
- #ifdef _WIN32
+#ifdef _WIN32
_setmode(_fileno(stdout),O_BINARY);
_setmode(_fileno(stdin),O_BINARY);
- #endif
+#endif
if (setvbuf(stdout, NULL, _IOFBF, 128 * 1024) < 0) {
fprintf(stderr, "setvbuf stdout: %s\n", strerror(errno));
diff --git a/clients/examples/C/bincopydata.c b/clients/examples/C/bincopydata.c
--- a/clients/examples/C/bincopydata.c
+++ b/clients/examples/C/bincopydata.c
@@ -349,11 +349,11 @@ gen_inet6(FILE *f, bool byteswap, long n
#include "bincopydecimal_impl.h"
#ifdef HAVE_HGE
- #define FUNCNAME gen_decimal_hugeints
- #define STYP int128_t
- #define UTYP uint128_t
- #define CONVERT copy_binary_convert128
- #include "bincopydecimal_impl.h"
+#define FUNCNAME gen_decimal_hugeints
+#define STYP int128_t
+#define UTYP uint128_t
+#define CONVERT copy_binary_convert128
+#include "bincopydecimal_impl.h"
#endif
typedef void (*generator_t)(FILE *f, bool byteswap, long nrecs, char
*argument);
@@ -485,7 +485,7 @@ main(int argc, char *argv[])
#else
true
#endif
- ;
+ ;
bool i_am_big_endian = !i_am_little_endian;
char **args = &argv[1];
diff --git a/clients/examples/C/bincopytemporaldata.c
b/clients/examples/C/bincopytemporaldata.c
--- a/clients/examples/C/bincopytemporaldata.c
+++ b/clients/examples/C/bincopytemporaldata.c
@@ -61,7 +61,7 @@ random_timestamp(struct rng *rng)
days == 28 &&
year > 0 && year % 4 == 0 &&
(year % 100 != 0 || year % 400 == 0)
- );
+ );
if (leap_year)
days = 29;
ts.date.day = 1 + rng_next(rng) % days;
@@ -84,22 +84,22 @@ gen_timestamps(FILE *f, bool byteswap, l
}
}
-#define GEN_TIMESTAMP_FIELD(name, typ, fld, nilvalue) \
- void name \
- (FILE *f, bool byteswap, long nrecs, char *arg) \
- { \
- (void)arg; \
- struct rng rng = my_favorite_rng(); \
- \
- for (long i = 0; i < nrecs; i++) { \
+#define GEN_TIMESTAMP_FIELD(name, typ, fld, nilvalue) \
+ void name \
+ (FILE *f, bool byteswap, long nrecs, char *arg) \
+ { \
+ (void)arg; \
+ struct rng rng = my_favorite_rng(); \
+ \
+ for (long i = 0; i < nrecs; i++) { \
copy_binary_timestamp ts = random_timestamp(&rng); \
- typ *p = &ts.fld; \
- typ tmp = ts.date.day == 255 ? nilvalue : *p; \
- if (byteswap) { \
- copy_binary_convert_timestamp(&ts); \
- } \
- fwrite(&tmp, sizeof(tmp), 1, f); \
- } \
+ typ *p = &ts.fld; \
+ typ tmp = ts.date.day == 255 ? nilvalue : *p; \
+ if (byteswap) { \
+ copy_binary_convert_timestamp(&ts); \
+ } \
+ fwrite(&tmp, sizeof(tmp), 1, f); \
+ } \
}
GEN_TIMESTAMP_FIELD(gen_timestamp_times, copy_binary_time, time,
binary_nil_timestamp.time)
diff --git a/clients/examples/C/bincopyuuid.c b/clients/examples/C/bincopyuuid.c
--- a/clients/examples/C/bincopyuuid.c
+++ b/clients/examples/C/bincopyuuid.c
@@ -27,7 +27,7 @@ random_uuid(struct rng *rng, my_uuid *u)
//
// _0_1_2_3 _4_5 _6_7 _8_9
// 123e4567-e89b-12d3-a456-426614174000
- // xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
+ // xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx
//
// M: uuid version, located in byte 6
// N: uuid variant, located in byte 8
@@ -80,4 +80,3 @@ gen_text_uuids(FILE *f, bool byteswap, l
}
(void)byteswap;
}
-
diff --git a/clients/examples/C/sample0.c b/clients/examples/C/sample0.c
--- a/clients/examples/C/sample0.c
+++ b/clients/examples/C/sample0.c
@@ -13,15 +13,16 @@
#include <string.h>
#include <mapi.h>
-#define die(dbh,hdl) do { \
- if (hdl) \
- mapi_explain_result(hdl,stderr); \
- else if (dbh) \
- mapi_explain(dbh,stderr); \
- else \
- fprintf(stderr,"command failed\n"); \
- exit(-1); \
- } while (0)
+#define die(dbh,hdl) \
+ do { \
+ if (hdl) \
+ mapi_explain_result(hdl,stderr); \
+ else if (dbh) \
+ mapi_explain(dbh,stderr); \
+ else \
+ fprintf(stderr,"command failed\n"); \
+ exit(-1); \
+ } while (0)
int
main(int argc, char **argv)
diff --git a/clients/examples/C/sample1.c b/clients/examples/C/sample1.c
--- a/clients/examples/C/sample1.c
+++ b/clients/examples/C/sample1.c
@@ -13,15 +13,16 @@
#include <string.h>
#include <mapi.h>
-#define die(dbh,hdl) do { \
- if (hdl) \
- mapi_explain_result(hdl,stderr); \
- else if (dbh) \
- mapi_explain(dbh,stderr); \
- else \
- fprintf(stderr,"command failed\n"); \
- exit(-1); \
- } while (0)
+#define die(dbh,hdl) \
+ do { \
+ if (hdl) \
+ mapi_explain_result(hdl,stderr); \
+ else if (dbh) \
+ mapi_explain(dbh,stderr); \
+ else \
+ fprintf(stderr,"command failed\n"); \
+ exit(-1); \
+ } while (0)
int
main(int argc, char **argv)
diff --git a/clients/examples/C/sample4.c b/clients/examples/C/sample4.c
--- a/clients/examples/C/sample4.c
+++ b/clients/examples/C/sample4.c
@@ -14,15 +14,16 @@
#include <inttypes.h>
#include <mapi.h>
-#define die(dbh,hdl) do { \
- if (hdl) \
- mapi_explain_result(hdl,stderr); \
- else if (dbh) \
- mapi_explain(dbh,stderr); \
- else \
- fprintf(stderr,"command failed\n"); \
- exit(-1); \
- } while (0)
+#define die(dbh,hdl) \
+ do { \
+ if (hdl) \
+ mapi_explain_result(hdl,stderr); \
+ else if (dbh) \
+ mapi_explain(dbh,stderr); \
+ else \
+ fprintf(stderr,"command failed\n"); \
+ exit(-1); \
+ } while (0)
int
main(int argc, char **argv)
diff --git a/clients/examples/C/smack00.c b/clients/examples/C/smack00.c
--- a/clients/examples/C/smack00.c
+++ b/clients/examples/C/smack00.c
@@ -18,15 +18,16 @@
#include <string.h>
#include <mapi.h>
-#define die(dbh,hdl) do { \
- if (hdl) \
- mapi_explain_result(hdl,stderr); \
- else if (dbh) \
- mapi_explain(dbh,stderr); \
- else \
- fprintf(stderr,"command failed\n"); \
- exit(-1); \
- } while (0)
+#define die(dbh,hdl) \
+ do { \
+ if (hdl) \
+ mapi_explain_result(hdl,stderr); \
+ else if (dbh) \
+ mapi_explain(dbh,stderr); \
+ else \
+ fprintf(stderr,"command failed\n"); \
+ exit(-1); \
+ } while (0)
int
main(int argc, char **argv)
diff --git a/clients/examples/C/smack01.c b/clients/examples/C/smack01.c
--- a/clients/examples/C/smack01.c
+++ b/clients/examples/C/smack01.c
@@ -18,15 +18,16 @@
#include <string.h>
#include <mapi.h>
-#define die(dbh,hdl) do { \
- if (hdl) \
- mapi_explain_result(hdl,stderr); \
- else if (dbh) \
- mapi_explain(dbh,stderr); \
- else \
- fprintf(stderr,"command failed\n"); \
- exit(-1); \
- } while (0)
+#define die(dbh,hdl) \
+ do { \
+ if (hdl) \
+ mapi_explain_result(hdl,stderr); \
+ else if (dbh) \
+ mapi_explain(dbh,stderr); \
+ else \
+ fprintf(stderr,"command failed\n"); \
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]