Skip to content

Commit f65025a

Browse files
committed
clang-format
1 parent 3a45310 commit f65025a

7 files changed

+38
-38
lines changed

Diff for: src/MongoDB/BulkWriteCommand.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -132,13 +132,13 @@ static PHP_METHOD(MongoDB_Driver_BulkWriteCommand, __construct)
132132
PHONGO_PARSE_PARAMETERS_END();
133133

134134
// TODO: Consider removing initialization for zero values
135-
intern->bw = mongoc_bulkwrite_new();
136-
intern->bypass = PHONGO_BULKWRITECOMMAND_BYPASS_UNSET;
137-
intern->comment = NULL;
138-
intern->let = NULL;
139-
intern->num_ops = 0;
140-
intern->ordered = true;
141-
intern->verbose = false;
135+
intern->bw = mongoc_bulkwrite_new();
136+
intern->bypass = PHONGO_BULKWRITECOMMAND_BYPASS_UNSET;
137+
intern->comment = NULL;
138+
intern->let = NULL;
139+
intern->num_ops = 0;
140+
intern->ordered = true;
141+
intern->verbose = false;
142142
intern->write_concern = NULL;
143143

144144
if (!zoptions) {

Diff for: src/MongoDB/BulkWriteCommandResult.c

+10-10
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@
3232
#include "MongoDB/WriteError.h"
3333
#include "BulkWriteCommandResult_arginfo.h"
3434

35-
#define PHONGO_BULKWRITECOMMANDRESULT_CHECK_ACKNOWLEDGED(method) \
36-
if (!intern->is_acknowledged) { \
35+
#define PHONGO_BULKWRITECOMMANDRESULT_CHECK_ACKNOWLEDGED(method) \
36+
if (!intern->is_acknowledged) { \
3737
phongo_throw_exception(PHONGO_ERROR_LOGIC, "MongoDB\\Driver\\BulkWriteCommandResult::" method "() should not be called for an unacknowledged write result"); \
38-
return; \
38+
return; \
3939
}
4040

4141
zend_class_entry* php_phongo_bulkwritecommandresult_ce;
@@ -338,7 +338,7 @@ static zend_object* php_phongo_bulkwritecommandresult_create_object(zend_class_e
338338
static HashTable* php_phongo_bulkwritecommandresult_get_debug_info(zend_object* object, int* is_temp)
339339
{
340340
php_phongo_bulkwritecommandresult_t* intern;
341-
zval retval = ZVAL_STATIC_INIT;
341+
zval retval = ZVAL_STATIC_INIT;
342342

343343
intern = Z_OBJ_BULKWRITECOMMANDRESULT(object);
344344
*is_temp = 1;
@@ -426,7 +426,7 @@ void php_phongo_bulkwritecommandresult_init_ce(INIT_FUNC_ARGS)
426426
php_phongo_handler_bulkwritecommandresult.offset = XtOffsetOf(php_phongo_bulkwritecommandresult_t, std);
427427
}
428428

429-
static inline bson_t* _bson_copy_or_null (const bson_t* bson)
429+
static inline bson_t* _bson_copy_or_null(const bson_t* bson)
430430
{
431431
return bson_empty0(bson) ? NULL : bson_copy(bson);
432432
}
@@ -437,16 +437,16 @@ php_phongo_bulkwritecommandresult_t* phongo_bulkwritecommandresult_init(zval* re
437437

438438
object_init_ex(return_value, php_phongo_bulkwritecommandresult_ce);
439439

440-
bwcr = Z_BULKWRITECOMMANDRESULT_OBJ_P(return_value);
440+
bwcr = Z_BULKWRITECOMMANDRESULT_OBJ_P(return_value);
441441
bwcr->is_acknowledged = !!bw_ret->res;
442442

443443
// Copy mongoc_bulkwriteresult_t fields
444444
if (bw_ret->res) {
445445
bwcr->inserted_count = mongoc_bulkwriteresult_insertedcount(bw_ret->res);
446446
bwcr->upserted_count = mongoc_bulkwriteresult_upsertedcount(bw_ret->res);
447-
bwcr->matched_count = mongoc_bulkwriteresult_matchedcount(bw_ret->res);
447+
bwcr->matched_count = mongoc_bulkwriteresult_matchedcount(bw_ret->res);
448448
bwcr->modified_count = mongoc_bulkwriteresult_modifiedcount(bw_ret->res);
449-
bwcr->deleted_count = mongoc_bulkwriteresult_deletedcount(bw_ret->res);
449+
bwcr->deleted_count = mongoc_bulkwriteresult_deletedcount(bw_ret->res);
450450

451451
bwcr->insert_results = _bson_copy_or_null(mongoc_bulkwriteresult_insertresults(bw_ret->res));
452452
bwcr->update_results = _bson_copy_or_null(mongoc_bulkwriteresult_updateresults(bw_ret->res));
@@ -457,8 +457,8 @@ php_phongo_bulkwritecommandresult_t* phongo_bulkwritecommandresult_init(zval* re
457457

458458
// Copy mongoc_bulkwriteexception_t fields
459459
if (bw_ret->exc) {
460-
bwcr->error_reply = _bson_copy_or_null(mongoc_bulkwriteexception_errorreply(bw_ret->exc));
461-
bwcr->write_errors = _bson_copy_or_null(mongoc_bulkwriteexception_writeerrors(bw_ret->exc));
460+
bwcr->error_reply = _bson_copy_or_null(mongoc_bulkwriteexception_errorreply(bw_ret->exc));
461+
bwcr->write_errors = _bson_copy_or_null(mongoc_bulkwriteexception_writeerrors(bw_ret->exc));
462462
bwcr->write_concern_errors = _bson_copy_or_null(mongoc_bulkwriteexception_writeconcernerrors(bw_ret->exc));
463463
}
464464

Diff for: src/MongoDB/Manager.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -598,12 +598,12 @@ static PHP_METHOD(MongoDB_Driver_Manager, executeBulkWrite)
598598
/* Executes a BulkWriteCommand (i.e. bulkWrite command for MongoDB 8.0+) */
599599
static PHP_METHOD(MongoDB_Driver_Manager, executeBulkWriteCommand)
600600
{
601-
php_phongo_manager_t* intern;
602-
zval* zbwc;
601+
php_phongo_manager_t* intern;
602+
zval* zbwc;
603603
php_phongo_bulkwritecommand_t* bwc;
604-
zval* zoptions = NULL;
605-
uint32_t server_id = 0;
606-
zval* zsession = NULL;
604+
zval* zoptions = NULL;
605+
uint32_t server_id = 0;
606+
zval* zsession = NULL;
607607

608608
PHONGO_PARSE_PARAMETERS_START(1, 2)
609609
Z_PARAM_OBJECT_OF_CLASS(zbwc, php_phongo_bulkwritecommand_ce)
@@ -612,7 +612,7 @@ static PHP_METHOD(MongoDB_Driver_Manager, executeBulkWriteCommand)
612612
PHONGO_PARSE_PARAMETERS_END();
613613

614614
intern = Z_MANAGER_OBJ_P(getThis());
615-
bwc = Z_BULKWRITECOMMAND_OBJ_P(zbwc);
615+
bwc = Z_BULKWRITECOMMAND_OBJ_P(zbwc);
616616

617617
if (!phongo_parse_session(zoptions, intern->client, NULL, &zsession)) {
618618
/* Exception should already have been thrown */

Diff for: src/MongoDB/Server.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ static PHP_METHOD(MongoDB_Driver_Server, executeBulkWrite)
218218
/* Executes a BulkWriteCommand (i.e. bulkWrite command for MongoDB 8.0+) */
219219
static PHP_METHOD(MongoDB_Driver_Server, executeBulkWriteCommand)
220220
{
221-
php_phongo_server_t* intern;
222-
zval* zbwc;
221+
php_phongo_server_t* intern;
222+
zval* zbwc;
223223
php_phongo_bulkwritecommand_t* bwc;
224-
zval* zoptions = NULL;
224+
zval* zoptions = NULL;
225225

226226
PHONGO_PARSE_PARAMETERS_START(1, 2)
227227
Z_PARAM_OBJECT_OF_CLASS(zbwc, php_phongo_bulkwritecommand_ce)
@@ -230,7 +230,7 @@ static PHP_METHOD(MongoDB_Driver_Server, executeBulkWriteCommand)
230230
PHONGO_PARSE_PARAMETERS_END();
231231

232232
intern = Z_SERVER_OBJ_P(getThis());
233-
bwc = Z_BULKWRITECOMMAND_OBJ_P(zbwc);
233+
bwc = Z_BULKWRITECOMMAND_OBJ_P(zbwc);
234234

235235
/* If the Server was created in a different process, reset the client so
236236
* that its session pool is cleared. */

Diff for: src/MongoDB/WriteConcernError.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ bool phongo_writeconcernerror_init(zval* return_value, const bson_t* bson)
155155

156156
// Additionally check for field name used by mongoc_bulkwriteexception_t
157157
if ((bson_iter_init_find(&iter, bson, "errmsg") && BSON_ITER_HOLDS_UTF8(&iter)) ||
158-
(bson_iter_init_find(&iter, bson, "message") && BSON_ITER_HOLDS_UTF8(&iter))) {
158+
(bson_iter_init_find(&iter, bson, "message") && BSON_ITER_HOLDS_UTF8(&iter))) {
159159
uint32_t len;
160160
const char* message = bson_iter_utf8(&iter, &len);
161161

@@ -164,7 +164,7 @@ bool phongo_writeconcernerror_init(zval* return_value, const bson_t* bson)
164164

165165
// Additionally check for field name used by mongoc_bulkwriteexception_t
166166
if ((bson_iter_init_find(&iter, bson, "errInfo") && BSON_ITER_HOLDS_DOCUMENT(&iter)) ||
167-
(bson_iter_init_find(&iter, bson, "details") && BSON_ITER_HOLDS_DOCUMENT(&iter))) {
167+
(bson_iter_init_find(&iter, bson, "details") && BSON_ITER_HOLDS_DOCUMENT(&iter))) {
168168
uint32_t len;
169169
const uint8_t* data = NULL;
170170

Diff for: src/MongoDB/WriteError.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ bool phongo_writeerror_init_ex(zval* return_value, const bson_t* bson, int32_t i
172172

173173
// Additionally check for field name used by mongoc_bulkwriteexception_t
174174
if ((bson_iter_init_find(&iter, bson, "errmsg") && BSON_ITER_HOLDS_UTF8(&iter)) ||
175-
(bson_iter_init_find(&iter, bson, "message") && BSON_ITER_HOLDS_UTF8(&iter))) {
175+
(bson_iter_init_find(&iter, bson, "message") && BSON_ITER_HOLDS_UTF8(&iter))) {
176176
uint32_t errmsg_len;
177177
const char* err_msg = bson_iter_utf8(&iter, &errmsg_len);
178178

@@ -181,7 +181,7 @@ bool phongo_writeerror_init_ex(zval* return_value, const bson_t* bson, int32_t i
181181

182182
// Additionally check for field name used by mongoc_bulkwriteexception_t
183183
if ((bson_iter_init_find(&iter, bson, "errInfo") && BSON_ITER_HOLDS_DOCUMENT(&iter)) ||
184-
(bson_iter_init_find(&iter, bson, "details") && BSON_ITER_HOLDS_DOCUMENT(&iter))) {
184+
(bson_iter_init_find(&iter, bson, "details") && BSON_ITER_HOLDS_DOCUMENT(&iter))) {
185185
uint32_t len;
186186
const uint8_t* data = NULL;
187187

Diff for: src/phongo_execute.c

+7-7
Original file line numberDiff line numberDiff line change
@@ -337,13 +337,13 @@ bool phongo_execute_bulk_write(zval* manager, const char* namespace, php_phongo_
337337

338338
bool phongo_execute_bulkwritecommand(zval* manager, php_phongo_bulkwritecommand_t* bwc, zval* zoptions, uint32_t server_id, zval* return_value)
339339
{
340-
mongoc_client_t* client = NULL;
341-
mongoc_bulkwrite_t* bw = bwc->bw;
340+
mongoc_client_t* client = NULL;
341+
mongoc_bulkwrite_t* bw = bwc->bw;
342342
mongoc_bulkwriteopts_t* bw_opts = NULL;
343-
mongoc_bulkwritereturn_t bw_ret = { 0 };
343+
mongoc_bulkwritereturn_t bw_ret = { 0 };
344344
php_phongo_bulkwritecommandresult_t* bwcr;
345345
zval* zsession = NULL;
346-
bool success = true;
346+
bool success = true;
347347

348348
client = Z_MANAGER_OBJ_P(manager)->client;
349349

@@ -389,9 +389,9 @@ bool phongo_execute_bulkwritecommand(zval* manager, php_phongo_bulkwritecommand_
389389
* write concern errors, along with a possible partial write result.
390390
*/
391391
if (bw_ret.exc) {
392-
success = false;
393-
bson_error_t error = { 0 };
394-
const bson_t *error_reply = mongoc_bulkwriteexception_errorreply(bw_ret.exc);
392+
success = false;
393+
bson_error_t error = { 0 };
394+
const bson_t* error_reply = mongoc_bulkwriteexception_errorreply(bw_ret.exc);
395395

396396
// Consult any top-level error to throw the first exception
397397
if (mongoc_bulkwriteexception_error(bw_ret.exc, &error)) {

0 commit comments

Comments
 (0)