Skip to content

Commit 0b3bb26

Browse files
authored
Reduce Warnings - address -Wunused-parameter warnings (#1934)
1 parent afc1a52 commit 0b3bb26

File tree

8 files changed

+17
-13
lines changed

8 files changed

+17
-13
lines changed

src/common/src/mlib/cmp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ mlib_always_inline static enum mlib_cmp_result (mlib_cmp) (struct mlib_upsized_i
6464
struct mlib_upsized_integer y,
6565
int always_zero) mlib_noexcept
6666
{
67+
(void) always_zero;
6768
#if mlib_is_optimized_build() && !mlib_is_msvc() && \
6869
!(defined(MLIB_DISABLE_INLINING_ASSERTIONS) && MLIB_DISABLE_INLINING_ASSERTIONS)
6970
if (always_zero != 0) {

src/libbson/examples/extended-json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
#include <stdio.h>
2121

2222
int
23-
main (int argc, char *argv[])
23+
main (void)
2424
{
2525
{
2626
// bson_as_canonical_extended_json ... begin

src/libmongoc/examples/example-structured-log.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ static pthread_mutex_t handler_mutex;
1111
static void
1212
example_handler (const mongoc_structured_log_entry_t *entry, void *user_data)
1313
{
14+
(void) user_data;
15+
1416
mongoc_structured_log_component_t component = mongoc_structured_log_entry_get_component (entry);
1517
mongoc_structured_log_level_t level = mongoc_structured_log_entry_get_level (entry);
1618
const char *message_string = mongoc_structured_log_entry_get_message_string (entry);

src/libmongoc/tests/test-mongoc-change-stream.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2151,6 +2151,8 @@ test_events_succeeded_cb (const mongoc_apm_command_succeeded_t *e)
21512151
static void
21522152
test_change_stream_batchSize0 (void *test_ctx)
21532153
{
2154+
BSON_UNUSED (test_ctx);
2155+
21542156
bson_error_t error;
21552157

21562158
// Create a change stream. Capture a resume token. Insert documents to create future events.

src/libmongoc/tests/test-mongoc-client-side-encryption.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6356,6 +6356,8 @@ _test_retry_with_masterkey (const char *provider, bson_t *masterkey)
63566356
static void
63576357
test_kms_retry (void *unused)
63586358
{
6359+
BSON_UNUSED (unused);
6360+
63596361
bson_t *aws_masterkey = tmp_bson (BSON_STR ({"region" : "r", "key" : "k", "endpoint" : "127.0.0.1:9003"}));
63606362
bson_t *azure_masterkey = tmp_bson (BSON_STR ({"keyVaultEndpoint" : "127.0.0.1:9003", "keyName" : "foo"}));
63616363
bson_t *gcp_masterkey = tmp_bson (BSON_STR (

src/libmongoc/tests/test-mongoc-counters.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,7 @@ test_counters_auth_pooled_op_msg (void *context)
14741474
void
14751475
test_counters_install (TestSuite *suite)
14761476
{
1477+
BSON_UNUSED (suite);
14771478
#ifdef MONGOC_ENABLE_SHM_COUNTERS
14781479
TestSuite_AddFull (suite,
14791480
"/counters/op_msg",

src/libmongoc/tests/unified/runner.c

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1443,7 +1443,7 @@ check_failure_is_redacted (const bson_iter_t *failure_iter, bson_error_t *error)
14431443
}
14441444

14451445
static bool
1446-
check_failure_is_detailed (const bson_iter_t *failure_iter, bson_error_t *error)
1446+
check_failure_is_detailed (const bson_iter_t *failure_iter)
14471447
{
14481448
if (BSON_ITER_HOLDS_UTF8 (failure_iter)) {
14491449
// Strings are fine, that's enough proof that the failure was not redacted
@@ -1467,7 +1467,7 @@ check_failure_is_detailed (const bson_iter_t *failure_iter, bson_error_t *error)
14671467
}
14681468

14691469
static bool
1470-
test_check_log_message (test_t *test, bson_t *expected, log_message_t *actual, bson_error_t *error)
1470+
test_check_log_message (bson_t *expected, log_message_t *actual, bson_error_t *error)
14711471
{
14721472
bool ret = false;
14731473

@@ -1524,7 +1524,7 @@ test_check_log_message (test_t *test, bson_t *expected, log_message_t *actual, b
15241524
goto done;
15251525
}
15261526
} else {
1527-
if (!check_failure_is_detailed (&failure_iter, error)) {
1527+
if (!check_failure_is_detailed (&failure_iter)) {
15281528
test_diagnostics_error_info ("actual log message: %s", tmp_json (actual->message));
15291529
test_set_error (error, "expected a complete un-redacted 'failure'");
15301530
goto done;
@@ -1550,18 +1550,15 @@ test_check_log_message (test_t *test, bson_t *expected, log_message_t *actual, b
15501550
}
15511551

15521552
static bool
1553-
test_log_message_should_be_ignored (test_t *test,
1554-
log_message_t *message,
1555-
bson_t *optional_ignore_list,
1556-
bson_error_t *error)
1553+
test_log_message_should_be_ignored (log_message_t *message, bson_t *optional_ignore_list, bson_error_t *error)
15571554
{
15581555
if (optional_ignore_list) {
15591556
bson_iter_t iter;
15601557
BSON_FOREACH (optional_ignore_list, iter)
15611558
{
15621559
bson_t expected;
15631560
bson_iter_bson (&iter, &expected);
1564-
bool is_match = test_check_log_message (test, &expected, message, error);
1561+
bool is_match = test_check_log_message (&expected, message, error);
15651562
bson_destroy (&expected);
15661563
if (is_match) {
15671564
return true;
@@ -1615,8 +1612,7 @@ test_check_expected_log_messages_for_client (test_t *test,
16151612
bson_iter_init (&expected_message_iter, expected_messages) && bson_iter_next (&expected_message_iter);
16161613

16171614
while (actual_message_iter || expected_message_iter_ok) {
1618-
if (actual_message_iter &&
1619-
test_log_message_should_be_ignored (test, actual_message_iter, ignore_messages, error)) {
1615+
if (actual_message_iter && test_log_message_should_be_ignored (actual_message_iter, ignore_messages, error)) {
16201616
MONGOC_DEBUG ("log message ignored, %s", tmp_json (actual_message_iter->message));
16211617
actual_message_iter = actual_message_iter->next;
16221618
continue;
@@ -1640,7 +1636,7 @@ test_check_expected_log_messages_for_client (test_t *test,
16401636
}
16411637
bson_t expected_message;
16421638
bson_iter_bson (&expected_message_iter, &expected_message);
1643-
bool is_match = test_check_log_message (test, &expected_message, actual_message_iter, error);
1639+
bool is_match = test_check_log_message (&expected_message, actual_message_iter, error);
16441640
MONGOC_DEBUG ("log message check %s %s, expected: %s, actual: %s",
16451641
is_match ? "MATCHED" : "FAILED",
16461642
error && !is_match ? error->message : "",

src/tools/mongoc-stat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ main (int argc, char *argv[])
220220
#include <stdio.h>
221221

222222
int
223-
main (int argc, char *argv[])
223+
main (void)
224224
{
225225
fprintf (stderr, "mongoc-stat is not supported on your platform.\n");
226226
return EXIT_FAILURE;

0 commit comments

Comments
 (0)