Skip to content

Commit 7a756af

Browse files
authored
Address -Wunused-parameter warnings (#1671)
1 parent 5f22902 commit 7a756af

File tree

6 files changed

+7
-8
lines changed

6 files changed

+7
-8
lines changed

src/libmongoc/examples/example-bulkwrite.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
(void) 0
1212

1313
int
14-
main (int argc, char *argv[])
14+
main (void)
1515
{
1616
bool ok = false;
1717

src/libmongoc/src/mongoc/mongoc-bulkwrite.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ bool
222222
mongoc_bulkwrite_append_insertone (mongoc_bulkwrite_t *self,
223223
const char *ns,
224224
const bson_t *document,
225-
const mongoc_bulkwrite_insertoneopts_t *opts, // may be NULL
225+
BSON_MAYBE_UNUSED const mongoc_bulkwrite_insertoneopts_t *opts, // may be NULL
226226
bson_error_t *error)
227227
{
228228
BSON_ASSERT_PARAM (self);

src/libmongoc/src/mongoc/mongoc-cyrus.c

+2
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ sasl_verify_type_to_str (sasl_verify_type_t type)
146146
int
147147
_mongoc_cyrus_verifyfile_cb (void *context, const char *file, sasl_verify_type_t type)
148148
{
149+
BSON_UNUSED (context);
150+
149151
TRACE ("Attempting to load file: `%s`. Type is %s\n", file, sasl_verify_type_to_str (type));
150152

151153
#ifdef _WIN32

src/libmongoc/tests/unified/operation.c

+1-4
Original file line numberDiff line numberDiff line change
@@ -413,8 +413,6 @@ operation_client_bulkwrite (test_t *test, operation_t *op, result_t *result, bso
413413
goto done;
414414
}
415415

416-
int64_t nmodels = 0;
417-
418416
// Parse arguments.
419417
{
420418
bool parse_ok = false;
@@ -461,7 +459,6 @@ operation_client_bulkwrite (test_t *test, operation_t *op, result_t *result, bso
461459
BSON_ASSERT (bson_iter_init (&args_models_iter, args_models));
462460
bw = mongoc_client_bulkwrite_new (client);
463461
while (bson_iter_next (&args_models_iter)) {
464-
nmodels++;
465462
bson_t model_wrapper;
466463
bson_iter_bson (&args_models_iter, &model_wrapper);
467464
if (!append_client_bulkwritemodel (bw, &model_wrapper, error)) {
@@ -491,7 +488,7 @@ operation_client_bulkwrite (test_t *test, operation_t *op, result_t *result, bso
491488
mongoc_bulkwrite_set_session (bw, op->session);
492489
mongoc_bulkwritereturn_t bwr = mongoc_bulkwrite_execute (bw, opts);
493490

494-
result_from_bulkwritereturn (result, bwr, nmodels);
491+
result_from_bulkwritereturn (result, bwr);
495492
mongoc_bulkwriteexception_destroy (bwr.exc);
496493
mongoc_bulkwriteresult_destroy (bwr.res);
497494
ret = true;

src/libmongoc/tests/unified/result.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ result_check (result_t *result, entity_map_t *em, bson_val_t *expect_result, bso
662662
}
663663

664664
void
665-
result_from_bulkwritereturn (result_t *result, mongoc_bulkwritereturn_t bwr, size_t nmodels)
665+
result_from_bulkwritereturn (result_t *result, mongoc_bulkwritereturn_t bwr)
666666
{
667667
// Build up the result value as a BSON document.
668668
bson_t bwr_bson = BSON_INITIALIZER;

src/libmongoc/tests/unified/result.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void
3535
result_from_bulk_write (result_t *result, const bson_t *reply, const bson_error_t *error);
3636

3737
void
38-
result_from_bulkwritereturn (result_t *result, mongoc_bulkwritereturn_t bwr, size_t nmodels);
38+
result_from_bulkwritereturn (result_t *result, mongoc_bulkwritereturn_t bwr);
3939

4040
void
4141
result_from_insert_one (result_t *result, const bson_t *reply, const bson_error_t *error);

0 commit comments

Comments
 (0)