Skip to content

Commit 482ea4e

Browse files
committed
Format source files with ColumnLimit: 120
1 parent 122c329 commit 482ea4e

File tree

452 files changed

+19648
-39735
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

452 files changed

+19648
-39735
lines changed

src/common/bson-dsl.h

Lines changed: 261 additions & 363 deletions
Large diffs are not rendered by default.

src/common/common-b64-private.h

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121

2222
#include <bson/bson.h>
2323

24-
#define mcommon_b64_ntop_calculate_target_size \
25-
COMMON_NAME (b64_ntop_calculate_target_size)
26-
#define mcommon_b64_pton_calculate_target_size \
27-
COMMON_NAME (b64_pton_calculate_target_size)
24+
#define mcommon_b64_ntop_calculate_target_size COMMON_NAME (b64_ntop_calculate_target_size)
25+
#define mcommon_b64_pton_calculate_target_size COMMON_NAME (b64_pton_calculate_target_size)
2826
#define mcommon_b64_ntop COMMON_NAME (b64_ntop)
2927
#define mcommon_b64_pton COMMON_NAME (b64_pton)
3028

@@ -47,10 +45,7 @@ mcommon_b64_pton_calculate_target_size (size_t base64_encoded_size);
4745
* hence the obscure name "ntop".
4846
*/
4947
int
50-
mcommon_b64_ntop (uint8_t const *src,
51-
size_t srclength,
52-
char *target,
53-
size_t targsize);
48+
mcommon_b64_ntop (uint8_t const *src, size_t srclength, char *target, size_t targsize);
5449

5550
/** If target is not NULL, the number of bytes written to target on success or
5651
* -1 on error. If target is NULL, returns the exact number of bytes that would

src/common/common-b64.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@
4747
if (!(Cond)) \
4848
abort ()
4949

50-
static const char Base64[] =
51-
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
50+
static const char Base64[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
5251
static const char Pad64 = '=';
5352

5453
/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt)
@@ -114,10 +113,7 @@ static const char Pad64 = '=';
114113
*/
115114

116115
int
117-
mcommon_b64_ntop (uint8_t const *src,
118-
size_t srclength,
119-
char *target,
120-
size_t targsize)
116+
mcommon_b64_ntop (uint8_t const *src, size_t srclength, char *target, size_t targsize)
121117
{
122118
size_t datalength = 0;
123119
uint8_t input[3];
@@ -275,8 +271,7 @@ static const uint8_t mongoc_b64rmap_invalid = 0xff;
275271
#define mongoc_common_once_t INIT_ONCE
276272
#define MONGOC_COMMON_ONCE_INIT INIT_ONCE_STATIC_INIT
277273
#define mongoc_common_once(o, c) InitOnceExecuteOnce (o, c, NULL, NULL)
278-
#define MONGOC_COMMON_ONCE_FUN(n) \
279-
BOOL CALLBACK n (PINIT_ONCE _ignored_a, PVOID _ignored_b, PVOID *_ignored_c)
274+
#define MONGOC_COMMON_ONCE_FUN(n) BOOL CALLBACK n (PINIT_ONCE _ignored_a, PVOID _ignored_b, PVOID *_ignored_c)
280275
#define MONGOC_COMMON_ONCE_RETURN return true
281276
#endif
282277

src/common/common-md5.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,9 @@ mcommon_md5_append (bson_md5_t *pms, const uint8_t *data, uint32_t nbytes)
376376
void
377377
mcommon_md5_finish (bson_md5_t *pms, uint8_t digest[16])
378378
{
379-
static const uint8_t pad[64] = {
380-
0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
381-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
382-
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
379+
static const uint8_t pad[64] = {0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
380+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
381+
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
383382
uint8_t data[8];
384383
int i;
385384

src/common/common-prelude.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
#if !defined(MONGOC_INSIDE) && !defined(MONGOC_COMPILATION) && \
18-
!defined(BSON_COMPILATION) && !defined(BSON_INSIDE)
17+
#if !defined(MONGOC_INSIDE) && !defined(MONGOC_COMPILATION) && !defined(BSON_COMPILATION) && !defined(BSON_INSIDE)
1918
#error "Only <mongoc/mongoc.h> or <bson/bson.h> can be included directly."
2019
#endif
2120

src/common/common-thread-private.h

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ BSON_BEGIN_DECLS
4444
} while (0)
4545
#define bson_once_t pthread_once_t
4646
#define bson_thread_t pthread_t
47-
#define BSON_THREAD_FUN(_function_name, _arg_name) \
48-
void *(_function_name) (void *(_arg_name))
47+
#define BSON_THREAD_FUN(_function_name, _arg_name) void *(_function_name) (void *(_arg_name))
4948
#define BSON_THREAD_FUN_TYPE(_function_name) void *(*(_function_name)) (void *)
5049
#define BSON_THREAD_RETURN return NULL
5150

@@ -114,8 +113,7 @@ typedef struct {
114113

115114
#else
116115
#include <process.h>
117-
#define BSON_ONCE_FUN(n) \
118-
BOOL CALLBACK n (PINIT_ONCE _ignored_a, PVOID _ignored_b, PVOID *_ignored_c)
116+
#define BSON_ONCE_FUN(n) BOOL CALLBACK n (PINIT_ONCE _ignored_a, PVOID _ignored_b, PVOID *_ignored_c)
119117
#define BSON_ONCE_INIT INIT_ONCE_STATIC_INIT
120118
#define BSON_ONCE_RETURN return true
121119
#define bson_mutex_destroy DeleteCriticalSection
@@ -129,10 +127,8 @@ typedef struct {
129127
} while (0)
130128
#define bson_once_t INIT_ONCE
131129
#define bson_thread_t HANDLE
132-
#define BSON_THREAD_FUN(_function_name, _arg_name) \
133-
unsigned (__stdcall _function_name) (void *(_arg_name))
134-
#define BSON_THREAD_FUN_TYPE(_function_name) \
135-
unsigned (__stdcall * _function_name) (void *)
130+
#define BSON_THREAD_FUN(_function_name, _arg_name) unsigned (__stdcall _function_name) (void *(_arg_name))
131+
#define BSON_THREAD_FUN_TYPE(_function_name) unsigned (__stdcall * _function_name) (void *)
136132
#define BSON_THREAD_RETURN return 0
137133
#endif
138134

@@ -145,9 +141,7 @@ mcommon_thread_join (bson_thread_t thread);
145141
// error. Callers may use `bson_strerror_r` to get an error message from the
146142
// returned error code.
147143
int
148-
mcommon_thread_create (bson_thread_t *thread,
149-
BSON_THREAD_FUN_TYPE (func),
150-
void *arg);
144+
mcommon_thread_create (bson_thread_t *thread, BSON_THREAD_FUN_TYPE (func), void *arg);
151145

152146
#if defined(MONGOC_ENABLE_DEBUG_ASSERTIONS) && defined(BSON_OS_UNIX)
153147
#define mcommon_mutex_is_locked COMMON_NAME (mutex_is_locked)

src/common/common-thread.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,7 @@
2020

2121
#if defined(BSON_OS_UNIX)
2222
int
23-
mcommon_thread_create (bson_thread_t *thread,
24-
BSON_THREAD_FUN_TYPE (func),
25-
void *arg)
23+
mcommon_thread_create (bson_thread_t *thread, BSON_THREAD_FUN_TYPE (func), void *arg)
2624
{
2725
BSON_ASSERT_PARAM (thread);
2826
BSON_ASSERT_PARAM (func);
@@ -39,16 +37,13 @@ mcommon_thread_join (bson_thread_t thread)
3937
bool
4038
mcommon_mutex_is_locked (bson_mutex_t *mutex)
4139
{
42-
return mutex->valid_tid &&
43-
pthread_equal (pthread_self (), mutex->lock_owner);
40+
return mutex->valid_tid && pthread_equal (pthread_self (), mutex->lock_owner);
4441
}
4542
#endif
4643

4744
#else
4845
int
49-
mcommon_thread_create (bson_thread_t *thread,
50-
BSON_THREAD_FUN_TYPE (func),
51-
void *arg)
46+
mcommon_thread_create (bson_thread_t *thread, BSON_THREAD_FUN_TYPE (func), void *arg)
5247
{
5348
BSON_ASSERT_PARAM (thread);
5449
BSON_ASSERT_PARAM (func);

src/libbson/examples/bcon-col-view.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,7 @@ main (void)
8282
bson_t *bson;
8383
char *json;
8484

85-
bson = COL_VIEW_CREATE (
86-
SORT ("a", BCON_INT32 (1)), QUERY ("hello", "world"), LIMIT (10));
85+
bson = COL_VIEW_CREATE (SORT ("a", BCON_INT32 (1)), QUERY ("hello", "world"), LIMIT (10));
8786

8887
json = bson_as_canonical_extended_json (bson, NULL);
8988
printf ("%s\n", json);

src/libbson/examples/bcon-speed.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,8 @@ main (int argc, char *argv[])
5858

5959
for (i = 0; i < n; i++) {
6060
if (bcon) {
61-
BCON_APPEND (&bson,
62-
"foo",
63-
"{",
64-
"bar",
65-
"{",
66-
"baz",
67-
"[",
68-
BCON_INT32 (1),
69-
BCON_INT32 (2),
70-
BCON_INT32 (3),
71-
"]",
72-
"}",
73-
"}");
61+
BCON_APPEND (
62+
&bson, "foo", "{", "bar", "{", "baz", "[", BCON_INT32 (1), BCON_INT32 (2), BCON_INT32 (3), "]", "}", "}");
7463
} else {
7564
bson_append_document_begin (&bson, "foo", -1, &foo);
7665
bson_append_document_begin (&foo, "bar", -1, &bar);

src/libbson/examples/bson-check-depth.c

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,7 @@ typedef struct {
3030
} check_depth_t;
3131

3232
bool
33-
_check_depth_document (const bson_iter_t *iter,
34-
const char *key,
35-
const bson_t *v_document,
36-
void *data);
33+
_check_depth_document (const bson_iter_t *iter, const char *key, const bson_t *v_document, void *data);
3734

3835
static const bson_visitor_t check_depth_funcs = {
3936
NULL,
@@ -47,10 +44,7 @@ static const bson_visitor_t check_depth_funcs = {
4744
};
4845

4946
bool
50-
_check_depth_document (const bson_iter_t *iter,
51-
const char *key,
52-
const bson_t *v_document,
53-
void *data)
47+
_check_depth_document (const bson_iter_t *iter, const char *key, const bson_t *v_document, void *data)
5448
{
5549
check_depth_t *state = (check_depth_t *) data;
5650
bson_iter_t child;
@@ -88,8 +82,7 @@ check_depth (const bson_t *bson, uint32_t max_depth)
8882
state.max_depth = max_depth;
8983
_check_depth_document (&iter, NULL, bson, &state);
9084
if (!state.valid) {
91-
printf ("document exceeds maximum depth of %" PRIu32 "\n",
92-
state.max_depth);
85+
printf ("document exceeds maximum depth of %" PRIu32 "\n", state.max_depth);
9386
} else {
9487
char *as_json = bson_as_canonical_extended_json (bson, NULL);
9588
printf ("document %s ", as_json);

0 commit comments

Comments
 (0)