cli: fix warnings with -Wshadow

mmcli-manager.c: In function ‘context_free’:
  mmcli-manager.c:167:24: error: declaration of ‘ctx’ shadows a global declaration [-Werror=shadow]
    167 | context_free (Context *ctx)
        |               ~~~~~~~~~^~~
  mmcli-manager.c:51:17: note: shadowed declaration is here
     51 | static Context *ctx;
        |                 ^~~
  ...
This commit is contained in:
Aleksander Morgado
2020-01-31 10:13:35 +01:00
parent 1216e88716
commit 1fa7e1260d
16 changed files with 32 additions and 41 deletions

View File

@@ -108,7 +108,7 @@ mmcli_bearer_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -127,7 +127,7 @@ context_free (Context *ctx)
void
mmcli_bearer_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -139,7 +139,7 @@ mmcli_call_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -158,7 +158,7 @@ context_free (Context *ctx)
void
mmcli_call_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -164,7 +164,7 @@ mmcli_manager_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -184,7 +184,7 @@ context_free (Context *ctx)
void
mmcli_manager_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -154,7 +154,7 @@ mmcli_modem_3gpp_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -207,7 +207,7 @@ ensure_modem_3gpp_ussd (void)
void
mmcli_modem_3gpp_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void
@@ -624,7 +624,6 @@ mmcli_modem_3gpp_run_synchronous (GDBusConnection *connection)
/* Request to set initial EPS bearer properties? */
if (set_initial_eps_bearer_settings_str) {
GError *error = NULL;
gboolean result;
MMBearerProperties *config;

View File

@@ -107,7 +107,7 @@ mmcli_modem_cdma_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -142,7 +142,7 @@ ensure_modem_cdma (void)
void
mmcli_modem_cdma_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -106,7 +106,7 @@ mmcli_modem_firmware_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -136,7 +136,7 @@ ensure_modem_firmware (void)
void
mmcli_modem_firmware_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void
@@ -344,7 +344,6 @@ mmcli_modem_firmware_run_synchronous (GDBusConnection *connection)
/* Request to select a given image? */
if (select_str) {
gboolean result;
GError *error = NULL;
g_debug ("Synchronously selecting firmware image in modem...");
result = mm_modem_firmware_select_sync (ctx->modem_firmware,

View File

@@ -227,7 +227,7 @@ mmcli_modem_location_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -262,7 +262,7 @@ ensure_modem_location (void)
void
mmcli_modem_location_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -124,7 +124,7 @@ mmcli_modem_messaging_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -161,7 +161,7 @@ ensure_modem_messaging (void)
void
mmcli_modem_messaging_shutdown (void)
{
context_free (ctx);
context_free ();
}
static MMSmsProperties *
@@ -457,7 +457,6 @@ mmcli_modem_messaging_run_synchronous (GDBusConnection *connection)
/* Request to create a new SMS? */
if (create_str) {
MMSms *sms;
GError *error = NULL;
MMSmsProperties *properties;
properties = build_sms_properties_from_input (create_str,

View File

@@ -125,7 +125,7 @@ mmcli_modem_oma_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -155,7 +155,7 @@ ensure_modem_oma (void)
void
mmcli_modem_oma_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void
@@ -439,7 +439,6 @@ mmcli_modem_oma_run_synchronous (GDBusConnection *connection)
/* Request to setup OMA features? */
if (setup_str) {
gboolean result;
GError *error = NULL;
MMOmaFeature features;
features = mm_common_get_oma_features_from_string (setup_str, &error);
@@ -460,7 +459,6 @@ mmcli_modem_oma_run_synchronous (GDBusConnection *connection)
/* Request to start session? */
if (start_str) {
gboolean result;
GError *error = NULL;
MMOmaSessionType session_type;
session_type = mm_common_get_oma_session_type_from_string (start_str, &error);
@@ -481,7 +479,6 @@ mmcli_modem_oma_run_synchronous (GDBusConnection *connection)
/* Request to accept or reject session? */
if (accept_str || reject_str) {
gboolean result;
GError *error = NULL;
guint session_id;
if (!mm_get_uint_from_str (accept_str ? accept_str : reject_str, &session_id)) {

View File

@@ -100,7 +100,7 @@ mmcli_modem_signal_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -130,7 +130,7 @@ ensure_modem_signal (void)
void
mmcli_modem_signal_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -101,7 +101,7 @@ mmcli_modem_simple_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -131,7 +131,7 @@ ensure_modem_simple (void)
void
mmcli_modem_simple_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -91,7 +91,7 @@ mmcli_modem_time_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -126,7 +126,7 @@ ensure_modem_time (void)
void
mmcli_modem_time_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -156,7 +156,7 @@ mmcli_modem_voice_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -188,7 +188,7 @@ ensure_modem_voice (void)
void
mmcli_modem_voice_shutdown (void)
{
context_free (ctx);
context_free ();
}
static MMCallProperties *
@@ -673,7 +673,6 @@ mmcli_modem_voice_run_synchronous (GDBusConnection *connection)
/* Request to create a new call? */
if (create_str) {
MMCall *call;
GError *error = NULL;
MMCallProperties *properties;
properties = build_call_properties_from_input (create_str);

View File

@@ -205,7 +205,7 @@ mmcli_modem_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -230,7 +230,7 @@ context_free (Context *ctx)
void
mmcli_modem_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void
@@ -1294,7 +1294,6 @@ mmcli_modem_run_synchronous (GDBusConnection *connection)
/* Request to create a new bearer? */
if (create_bearer_str) {
MMBearer *bearer;
GError *error = NULL;
MMBearerProperties *properties;
properties = mm_bearer_properties_new_from_string (create_bearer_str, &error);

View File

@@ -133,7 +133,7 @@ mmcli_sim_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -152,7 +152,7 @@ context_free (Context *ctx)
void
mmcli_sim_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void

View File

@@ -123,7 +123,7 @@ mmcli_sms_options_enabled (void)
}
static void
context_free (Context *ctx)
context_free (void)
{
if (!ctx)
return;
@@ -142,7 +142,7 @@ context_free (Context *ctx)
void
mmcli_sms_shutdown (void)
{
context_free (ctx);
context_free ();
}
static void
@@ -411,7 +411,6 @@ mmcli_sms_run_synchronous (GDBusConnection *connection)
if (store_in_storage_str) {
gboolean operation_result;
MMSmsStorage storage;
GError *error = NULL;
storage = mm_common_get_sms_storage_from_string (store_in_storage_str, &error);
if (error) {