Skip to content

Commit 94bb265

Browse files
committed
Run clang-format on existing sources
1 parent 68a213d commit 94bb265

17 files changed

+52
-53
lines changed

phongo_compat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@
253253
} else { \
254254
ZVAL_LONG((_zv), (_value)); \
255255
}
256-
#else /* SIZEOF_PHONGO_LONG != 8 && SIZEOF_PHONGO_LONG != 4 */
256+
#else /* SIZEOF_PHONGO_LONG != 8 && SIZEOF_PHONGO_LONG != 4 */
257257
#error Unsupported architecture (integers are neither 32-bit nor 64-bit)
258258
#endif /* SIZEOF_PHONGO_LONG */
259259

php_phongo.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ zend_bool phongo_writeconcernerror_init(zval* return_value, bson_t* bson TSRMLS_
427427

428428
object_init_ex(return_value, php_phongo_writeconcernerror_ce);
429429

430-
intern = Z_WRITECONCERNERROR_OBJ_P(return_value);
430+
intern = Z_WRITECONCERNERROR_OBJ_P(return_value);
431431
intern->code = 0;
432432

433433
if (bson_iter_init_find(&iter, bson, "code") && BSON_ITER_HOLDS_INT32(&iter)) {
@@ -465,7 +465,7 @@ zend_bool phongo_writeerror_init(zval* return_value, bson_t* bson TSRMLS_DC) /*
465465

466466
object_init_ex(return_value, php_phongo_writeerror_ce);
467467

468-
intern = Z_WRITEERROR_OBJ_P(return_value);
468+
intern = Z_WRITEERROR_OBJ_P(return_value);
469469
intern->code = 0;
470470
intern->index = 0;
471471

@@ -786,7 +786,7 @@ bool phongo_execute_bulk_write(mongoc_client_t* client, const char* namespace, p
786786
}
787787

788788
if (EG(exception)) {
789-
char *message;
789+
char* message;
790790

791791
(void) spprintf(&message, 0, "Bulk write failed due to previous %s: %s", PHONGO_ZVAL_EXCEPTION_NAME(EG(exception)), error.message);
792792
zend_throw_exception(php_phongo_bulkwriteexception_ce, message, 0 TSRMLS_CC);
@@ -1464,7 +1464,7 @@ static bool php_phongo_uri_finalize_auth(mongoc_uri_t* uri TSRMLS_DC) /* {{{ */
14641464
if (mongoc_uri_get_auth_mechanism(uri)) {
14651465
if (!strcasecmp(mongoc_uri_get_auth_mechanism(uri), "GSSAPI") ||
14661466
!strcasecmp(mongoc_uri_get_auth_mechanism(uri), "MONGODB-X509")) {
1467-
const char *source = mongoc_uri_get_auth_source(uri);
1467+
const char* source = mongoc_uri_get_auth_source(uri);
14681468

14691469
if (source) {
14701470
if (strcasecmp(source, "$external")) {
@@ -1499,8 +1499,8 @@ static bool php_phongo_uri_finalize_auth(mongoc_uri_t* uri TSRMLS_DC) /* {{{ */
14991499

15001500
static bool php_phongo_uri_finalize_tls(mongoc_uri_t* uri TSRMLS_DC) /* {{{ */
15011501
{
1502-
const bson_t *options;
1503-
bson_iter_t iter;
1502+
const bson_t* options;
1503+
bson_iter_t iter;
15041504

15051505
if (!(options = mongoc_uri_get_options(uri))) {
15061506
return true;
@@ -2075,7 +2075,7 @@ static bool php_phongo_apply_wc_options_to_uri(mongoc_uri_t* uri, bson_t* option
20752075

20762076
static void php_phongo_mongoc_ssl_opts_from_uri(mongoc_ssl_opt_t* ssl_opt, mongoc_uri_t* uri, bool* any_ssl_option_set)
20772077
{
2078-
bool insecure = mongoc_uri_get_option_as_bool(uri, MONGOC_URI_TLSINSECURE, false);
2078+
bool insecure = mongoc_uri_get_option_as_bool(uri, MONGOC_URI_TLSINSECURE, false);
20792079
const char* pem_file = mongoc_uri_get_option_as_utf8(uri, MONGOC_URI_TLSCERTIFICATEKEYFILE, NULL);
20802080
const char* pem_pwd = mongoc_uri_get_option_as_utf8(uri, MONGOC_URI_TLSCERTIFICATEKEYFILEPASSWORD, NULL);
20812081
const char* ca_file = mongoc_uri_get_option_as_utf8(uri, MONGOC_URI_TLSCAFILE, NULL);
@@ -2210,7 +2210,7 @@ static inline bool php_phongo_apply_driver_option_to_uri(mongoc_uri_t* uri, zval
22102210
char* value;
22112211

22122212
value = php_phongo_fetch_ssl_opt_string(zoptions, driverOptionKey);
2213-
ret = mongoc_uri_set_option_as_utf8(uri, optionKey, value);
2213+
ret = mongoc_uri_set_option_as_utf8(uri, optionKey, value);
22142214
efree(value);
22152215

22162216
return ret;
@@ -3039,7 +3039,7 @@ PHP_MINIT_FUNCTION(mongodb)
30393039
php_phongo_timestamp_init_ce(INIT_FUNC_ARGS_PASSTHRU);
30403040
php_phongo_undefined_init_ce(INIT_FUNC_ARGS_PASSTHRU);
30413041
php_phongo_utcdatetime_init_ce(INIT_FUNC_ARGS_PASSTHRU);
3042-
3042+
30433043
php_phongo_cursor_interface_init_ce(INIT_FUNC_ARGS_PASSTHRU);
30443044

30453045
php_phongo_bulkwrite_init_ce(INIT_FUNC_ARGS_PASSTHRU);

src/BSON/Binary.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -369,11 +369,11 @@ static phongo_create_object_retval php_phongo_binary_create_object(zend_class_en
369369

370370
static phongo_create_object_retval php_phongo_binary_clone_object(zval* object TSRMLS_DC) /* {{{ */
371371
{
372-
php_phongo_binary_t* intern;
373-
php_phongo_binary_t* new_intern;
372+
php_phongo_binary_t* intern;
373+
php_phongo_binary_t* new_intern;
374374
phongo_create_object_retval new_object;
375375

376-
intern = Z_BINARY_OBJ_P(object);
376+
intern = Z_BINARY_OBJ_P(object);
377377
new_object = php_phongo_binary_create_object(Z_OBJCE_P(object) TSRMLS_CC);
378378

379379
#if PHP_VERSION_ID >= 70000

src/BSON/DBPointer.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,11 +289,11 @@ phongo_create_object_retval php_phongo_dbpointer_create_object(zend_class_entry*
289289

290290
static phongo_create_object_retval php_phongo_dbpointer_clone_object(zval* object TSRMLS_DC) /* {{{ */
291291
{
292-
php_phongo_dbpointer_t* intern;
293-
php_phongo_dbpointer_t* new_intern;
292+
php_phongo_dbpointer_t* intern;
293+
php_phongo_dbpointer_t* new_intern;
294294
phongo_create_object_retval new_object;
295295

296-
intern = Z_DBPOINTER_OBJ_P(object);
296+
intern = Z_DBPOINTER_OBJ_P(object);
297297
new_object = php_phongo_dbpointer_create_object(Z_OBJCE_P(object) TSRMLS_CC);
298298

299299
#if PHP_VERSION_ID >= 70000

src/BSON/Decimal128.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -302,11 +302,11 @@ static phongo_create_object_retval php_phongo_decimal128_create_object(zend_clas
302302

303303
static phongo_create_object_retval php_phongo_decimal128_clone_object(zval* object TSRMLS_DC) /* {{{ */
304304
{
305-
php_phongo_decimal128_t* intern;
306-
php_phongo_decimal128_t* new_intern;
305+
php_phongo_decimal128_t* intern;
306+
php_phongo_decimal128_t* new_intern;
307307
phongo_create_object_retval new_object;
308308

309-
intern = Z_DECIMAL128_OBJ_P(object);
309+
intern = Z_DECIMAL128_OBJ_P(object);
310310
new_object = php_phongo_decimal128_create_object(Z_OBJCE_P(object) TSRMLS_CC);
311311

312312
#if PHP_VERSION_ID >= 70000

src/BSON/Int64.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,11 +256,11 @@ phongo_create_object_retval php_phongo_int64_create_object(zend_class_entry* cla
256256

257257
static phongo_create_object_retval php_phongo_int64_clone_object(zval* object TSRMLS_DC) /* {{{ */
258258
{
259-
php_phongo_int64_t* intern;
260-
php_phongo_int64_t* new_intern;
259+
php_phongo_int64_t* intern;
260+
php_phongo_int64_t* new_intern;
261261
phongo_create_object_retval new_object;
262262

263-
intern = Z_INT64_OBJ_P(object);
263+
intern = Z_INT64_OBJ_P(object);
264264
new_object = php_phongo_int64_create_object(Z_OBJCE_P(object) TSRMLS_CC);
265265

266266
#if PHP_VERSION_ID >= 70000

src/BSON/Javascript.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -419,11 +419,11 @@ phongo_create_object_retval php_phongo_javascript_create_object(zend_class_entry
419419

420420
static phongo_create_object_retval php_phongo_javascript_clone_object(zval* object TSRMLS_DC) /* {{{ */
421421
{
422-
php_phongo_javascript_t* intern;
423-
php_phongo_javascript_t* new_intern;
422+
php_phongo_javascript_t* intern;
423+
php_phongo_javascript_t* new_intern;
424424
phongo_create_object_retval new_object;
425425

426-
intern = Z_JAVASCRIPT_OBJ_P(object);
426+
intern = Z_JAVASCRIPT_OBJ_P(object);
427427
new_object = php_phongo_javascript_create_object(Z_OBJCE_P(object) TSRMLS_CC);
428428

429429
#if PHP_VERSION_ID >= 70000

src/BSON/ObjectId.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#include "phongo_compat.h"
3131
#include "php_phongo.h"
3232

33-
#define PHONGO_OID_SIZE sizeof(((php_phongo_objectid_t *)0)->oid)
33+
#define PHONGO_OID_SIZE sizeof(((php_phongo_objectid_t*) 0)->oid)
3434
#define PHONGO_OID_LEN (PHONGO_OID_SIZE - 1)
3535

3636
zend_class_entry* php_phongo_objectid_ce;
@@ -341,11 +341,11 @@ static phongo_create_object_retval php_phongo_objectid_create_object(zend_class_
341341

342342
static phongo_create_object_retval php_phongo_objectid_clone_object(zval* object TSRMLS_DC) /* {{{ */
343343
{
344-
php_phongo_objectid_t* intern;
345-
php_phongo_objectid_t* new_intern;
344+
php_phongo_objectid_t* intern;
345+
php_phongo_objectid_t* new_intern;
346346
phongo_create_object_retval new_object;
347347

348-
intern = Z_OBJECTID_OBJ_P(object);
348+
intern = Z_OBJECTID_OBJ_P(object);
349349
new_object = php_phongo_objectid_create_object(Z_OBJCE_P(object) TSRMLS_CC);
350350

351351
#if PHP_VERSION_ID >= 70000

src/BSON/Regex.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -373,11 +373,11 @@ static phongo_create_object_retval php_phongo_regex_create_object(zend_class_ent
373373

374374
static phongo_create_object_retval php_phongo_regex_clone_object(zval* object TSRMLS_DC) /* {{{ */
375375
{
376-
php_phongo_regex_t* intern;
377-
php_phongo_regex_t* new_intern;
376+
php_phongo_regex_t* intern;
377+
php_phongo_regex_t* new_intern;
378378
phongo_create_object_retval new_object;
379379

380-
intern = Z_REGEX_OBJ_P(object);
380+
intern = Z_REGEX_OBJ_P(object);
381381
new_object = php_phongo_regex_create_object(Z_OBJCE_P(object) TSRMLS_CC);
382382

383383
#if PHP_VERSION_ID >= 70000

src/BSON/Symbol.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ phongo_create_object_retval php_phongo_symbol_create_object(zend_class_entry* cl
251251

252252
static phongo_create_object_retval php_phongo_symbol_clone_object(zval* object TSRMLS_DC) /* {{{ */
253253
{
254-
php_phongo_symbol_t* intern;
255-
php_phongo_symbol_t* new_intern;
254+
php_phongo_symbol_t* intern;
255+
php_phongo_symbol_t* new_intern;
256256
phongo_create_object_retval new_object;
257257

258-
intern = Z_SYMBOL_OBJ_P(object);
258+
intern = Z_SYMBOL_OBJ_P(object);
259259
new_object = php_phongo_symbol_create_object(Z_OBJCE_P(object) TSRMLS_CC);
260260

261261
#if PHP_VERSION_ID >= 70000

src/BSON/Timestamp.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,11 +424,11 @@ static phongo_create_object_retval php_phongo_timestamp_create_object(zend_class
424424

425425
static phongo_create_object_retval php_phongo_timestamp_clone_object(zval* object TSRMLS_DC) /* {{{ */
426426
{
427-
php_phongo_timestamp_t* intern;
428-
php_phongo_timestamp_t* new_intern;
427+
php_phongo_timestamp_t* intern;
428+
php_phongo_timestamp_t* new_intern;
429429
phongo_create_object_retval new_object;
430430

431-
intern = Z_TIMESTAMP_OBJ_P(object);
431+
intern = Z_TIMESTAMP_OBJ_P(object);
432432
new_object = php_phongo_timestamp_create_object(Z_OBJCE_P(object) TSRMLS_CC);
433433

434434
#if PHP_VERSION_ID >= 70000

src/BSON/UTCDateTime.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,11 +441,11 @@ static phongo_create_object_retval php_phongo_utcdatetime_create_object(zend_cla
441441

442442
static phongo_create_object_retval php_phongo_utcdatetime_clone_object(zval* object TSRMLS_DC) /* {{{ */
443443
{
444-
php_phongo_utcdatetime_t* intern;
445-
php_phongo_utcdatetime_t* new_intern;
444+
php_phongo_utcdatetime_t* intern;
445+
php_phongo_utcdatetime_t* new_intern;
446446
phongo_create_object_retval new_object;
447447

448-
intern = Z_UTCDATETIME_OBJ_P(object);
448+
intern = Z_UTCDATETIME_OBJ_P(object);
449449
new_object = php_phongo_utcdatetime_create_object(Z_OBJCE_P(object) TSRMLS_CC);
450450

451451
#if PHP_VERSION_ID >= 70000

src/MongoDB/BulkWrite.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static bool php_phongo_bulkwrite_update_apply_options(bson_t* boptions, zval* zo
243243
bool multi = false, upsert = false;
244244

245245
if (zoptions) {
246-
multi = php_array_fetchc_bool(zoptions, "multi");
246+
multi = php_array_fetchc_bool(zoptions, "multi");
247247
upsert = php_array_fetchc_bool(zoptions, "upsert");
248248
}
249249

src/MongoDB/Cursor.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ static void php_phongo_cursor_iterator_move_forward(zend_object_iterator* iter T
129129
php_phongo_cursor_free_current(cursor);
130130
}
131131
} else {
132-
bson_error_t error = { 0 };
133-
const bson_t* doc = NULL;
132+
bson_error_t error = { 0 };
133+
const bson_t* doc = NULL;
134134

135135
if (mongoc_cursor_error_document(cursor->cursor, &error, &doc)) {
136136
/* Intentionally not destroying the cursor as it will happen

src/MongoDB/ReadPreference.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,8 @@ static HashTable* php_phongo_readpreference_get_properties_hash(zval* object, bo
444444
return props;
445445
}
446446

447-
tags = mongoc_read_prefs_get_tags(intern->read_preference);
448-
mode = mongoc_read_prefs_get_mode(intern->read_preference);
447+
tags = mongoc_read_prefs_get_tags(intern->read_preference);
448+
mode = mongoc_read_prefs_get_mode(intern->read_preference);
449449
modeString = php_phongo_readpreference_get_mode_string(mode TSRMLS_CC);
450450

451451
if (modeString) {
@@ -522,7 +522,7 @@ static PHP_METHOD(ReadPreference, serialize)
522522
php_phongo_readpreference_t* intern;
523523
ZVAL_RETVAL_TYPE retval;
524524
php_serialize_data_t var_hash;
525-
smart_str buf = { 0 };
525+
smart_str buf = { 0 };
526526
const char* modeString = NULL;
527527
const bson_t* tags;
528528
int64_t maxStalenessSeconds;

src/MongoDB/Session.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,9 @@ static PHP_METHOD(Session, getTransactionOptions)
312312
}
313313

314314
max_commit_time_ms = mongoc_transaction_opts_get_max_commit_time_ms(opts);
315-
read_concern = mongoc_transaction_opts_get_read_concern(opts);
316-
read_preference = mongoc_transaction_opts_get_read_prefs(opts);
317-
write_concern = mongoc_transaction_opts_get_write_concern(opts);
315+
read_concern = mongoc_transaction_opts_get_read_concern(opts);
316+
read_preference = mongoc_transaction_opts_get_read_prefs(opts);
317+
write_concern = mongoc_transaction_opts_get_write_concern(opts);
318318

319319
array_init_size(return_value, 4);
320320

@@ -391,7 +391,6 @@ static PHP_METHOD(Session, getTransactionState)
391391
PHONGO_RETURN_STRING(state);
392392
} /* }}} */
393393

394-
395394
/* Creates a opts structure from an array optionally containing an RP, RC,
396395
* WC object, and/or maxCommitTimeMS int. Returns NULL if no options were found,
397396
* or there was an invalid option. If there was an invalid option or structure,
@@ -685,7 +684,7 @@ static HashTable* php_phongo_session_get_debug_info(zval* object, int* is_temp T
685684
array_init(&retval);
686685

687686
if (intern->client_session) {
688-
const bson_t* lsid;
687+
const bson_t* lsid;
689688
php_phongo_bson_state state;
690689

691690
PHONGO_BSON_INIT_DEBUG_STATE(state);

src/bson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ static bool php_phongo_bson_new_javascript_from_javascript_and_scope(zval* objec
611611

612612
if (scope) {
613613
php_phongo_bson_state state;
614-
bool valid_scope;
614+
bool valid_scope;
615615

616616
PHONGO_BSON_INIT_STATE(state);
617617

0 commit comments

Comments
 (0)