core: strict return type in g_object_ref()

This is now a requirement when using glib 2.56.
This commit is contained in:
Aleksander Morgado
2021-04-30 12:26:25 +02:00
parent edee1e3f84
commit 25a1b28fbf
11 changed files with 52 additions and 52 deletions

View File

@@ -401,7 +401,7 @@ dial_3gpp (MMBroadbandBearer *self,
g_task_set_task_data (task, ctx, (GDestroyNotify) dial_3gpp_context_free);
/* Setup context */
ctx->self = g_object_ref (self);
ctx->self = MM_BROADBAND_BEARER_CINTERION (g_object_ref (self));
ctx->modem = g_object_ref (modem);
ctx->primary = g_object_ref (primary);
ctx->cid = cid;
@@ -602,8 +602,8 @@ disconnect_3gpp (MMBroadbandBearer *self,
g_task_set_task_data (task, ctx, (GDestroyNotify) disconnect_3gpp_context_free);
/* Setup context */
ctx->self = g_object_ref (self);
ctx->modem = g_object_ref (modem);
ctx->self = MM_BROADBAND_BEARER_CINTERION (g_object_ref (self));
ctx->modem = MM_BASE_MODEM (g_object_ref (modem));
ctx->primary = g_object_ref (primary);
ctx->data = g_object_ref (data);
ctx->cid = cid;

View File

@@ -509,7 +509,7 @@ connect_3gpp (MMBroadbandBearer *_self,
/* Setup connection context */
ctx = g_slice_new0 (Connect3gppContext);
ctx->modem = g_object_ref (modem);
ctx->modem = MM_BASE_MODEM (g_object_ref (modem));
ctx->data = g_object_ref (data);
ctx->step = CONNECT_3GPP_CONTEXT_STEP_FIRST;

View File

@@ -558,7 +558,7 @@ get_ip_config_3gpp (MMBroadbandBearer *self,
GTask *task;
ctx = g_new0 (GetIpConfig3gppContext, 1);
ctx->modem = g_object_ref (modem);
ctx->modem = MM_BASE_MODEM (g_object_ref (modem));
ctx->primary = g_object_ref (primary);
ctx->family = ip_family;

View File

@@ -191,7 +191,7 @@ get_ip_config_3gpp (MMBroadbandBearer *self,
gchar *command;
ctx = g_slice_new0 (GetIpConfig3gppContext);
ctx->modem = g_object_ref (modem);
ctx->modem = MM_BASE_MODEM (g_object_ref (modem));
ctx->primary = g_object_ref (primary);
ctx->cid = cid;

View File

@@ -750,7 +750,7 @@ handle_set_logging (MmGdbusOrgFreedesktopModemManager1 *manager,
SetLoggingContext *ctx;
ctx = g_new0 (SetLoggingContext, 1);
ctx->self = g_object_ref (manager);
ctx->self = MM_BASE_MANAGER (g_object_ref (manager));
ctx->invocation = g_object_ref (invocation);
ctx->level = g_strdup (level);
@@ -813,7 +813,7 @@ handle_scan_devices (MmGdbusOrgFreedesktopModemManager1 *manager,
ScanDevicesContext *ctx;
ctx = g_new (ScanDevicesContext, 1);
ctx->self = g_object_ref (manager);
ctx->self = MM_BASE_MANAGER (g_object_ref (manager));
ctx->invocation = g_object_ref (invocation);
mm_auth_provider_authorize (ctx->self->priv->authp,
@@ -890,7 +890,7 @@ handle_report_kernel_event (MmGdbusOrgFreedesktopModemManager1 *manager,
ReportKernelEventContext *ctx;
ctx = g_slice_new0 (ReportKernelEventContext);
ctx->self = g_object_ref (manager);
ctx->self = MM_BASE_MANAGER (g_object_ref (manager));
ctx->invocation = g_object_ref (invocation);
ctx->dictionary = g_variant_ref (dictionary);
@@ -1215,7 +1215,7 @@ handle_inhibit_device (MmGdbusOrgFreedesktopModemManager1 *manager,
InhibitDeviceContext *ctx;
ctx = g_slice_new0 (InhibitDeviceContext);
ctx->self = g_object_ref (manager);
ctx->self = MM_BASE_MANAGER (g_object_ref (manager));
ctx->invocation = g_object_ref (invocation);
ctx->uid = g_strdup (uid);
ctx->inhibit = inhibit;

View File

@@ -1260,7 +1260,7 @@ _connect (MMBaseBearer *self,
g_assert (modem);
ctx = g_slice_new0 (ConnectContext);
ctx->modem = g_object_ref (modem);
ctx->modem = MM_BROADBAND_MODEM_MBIM (g_object_ref (modem));
ctx->mbim = g_object_ref (mbim);
ctx->data = g_object_ref (data);
ctx->step = CONNECT_STEP_FIRST;

View File

@@ -1856,7 +1856,7 @@ common_power_up_down_off (MMIfaceModem *self,
/* Setup context */
ctx = g_slice_new0 (SetOperatingModeContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_DMS (g_object_ref (client));
ctx->input = qmi_message_dms_set_operating_mode_input_new ();
qmi_message_dms_set_operating_mode_input_set_mode (ctx->input, mode, NULL);
ctx->step = SET_OPERATING_MODE_STEP_FIRST;
@@ -3570,7 +3570,7 @@ unsolicited_registration_events_task_new (MMBroadbandModemQmi *self,
GTask *task;
ctx = g_new0 (UnsolicitedRegistrationEventsContext, 1);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_NAS (g_object_ref (client));
ctx->enable = enable;
task = g_task_new (self, NULL, callback, user_data);
@@ -4539,7 +4539,7 @@ modem_cdma_activate (MMIfaceModemCdma *_self,
/* Setup context */
ctx = g_slice_new0 (CdmaActivationContext);
ctx->self = g_object_ref (self);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_DMS (g_object_ref (client));
ctx->step = CDMA_ACTIVATION_STEP_FIRST;
/* Build base input bundle for the Automatic activation */
@@ -4585,7 +4585,7 @@ modem_cdma_activate_manual (MMIfaceModemCdma *_self,
/* Setup context */
ctx = g_slice_new0 (CdmaActivationContext);
ctx->self = g_object_ref (self);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_DMS (g_object_ref (client));
g_task_set_task_data (task, ctx, (GDestroyNotify)cdma_activation_context_free);
@@ -5175,8 +5175,8 @@ common_enable_disable_unsolicited_events (MMBroadbandModemQmi *self,
ctx = g_new0 (EnableUnsolicitedEventsContext, 1);
ctx->enable = enable;
ctx->client_nas = client_nas ? g_object_ref (client_nas) : NULL;
ctx->client_wds = client_wds ? g_object_ref (client_wds) : NULL;
ctx->client_nas = client_nas ? QMI_CLIENT_NAS (g_object_ref (client_nas)) : NULL;
ctx->client_wds = client_wds ? QMI_CLIENT_WDS (g_object_ref (client_wds)) : NULL;
g_task_set_task_data (task, ctx, (GDestroyNotify)enable_unsolicited_events_context_free);
@@ -6027,7 +6027,7 @@ modem_3gpp_profile_manager_store_profile (MMIfaceModem3gppProfileManager *self,
task = g_task_new (self, NULL, callback, user_data);
ctx = g_slice_new0 (StoreProfileContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_WDS (g_object_ref (client));
g_task_set_task_data (task, ctx, (GDestroyNotify)store_profile_context_free);
/* Note: may be UNKNOWN */
@@ -6801,7 +6801,7 @@ load_initial_sms_parts (MMIfaceModemMessaging *_self,
return;
ctx = g_slice_new0 (LoadInitialSmsPartsContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_WMS (g_object_ref (client));
ctx->storage = storage;
ctx->step = LOAD_INITIAL_SMS_PARTS_STEP_FIRST;
@@ -6815,7 +6815,7 @@ load_initial_sms_parts (MMIfaceModemMessaging *_self,
/* Common setup/cleanup unsolicited event handlers (Messaging interface) */
typedef struct {
MMIfaceModemMessaging *self;
MMBroadbandModemQmi *self;
QmiClientWms *client;
QmiWmsStorageType storage;
guint32 memory_index;
@@ -6953,7 +6953,7 @@ messaging_event_report_indication_cb (QmiClientNas *client,
msg_format,
TRUE,
raw_data);
return;
return;
}
if (qmi_indication_wms_event_report_output_get_mt_message (
@@ -6966,7 +6966,7 @@ messaging_event_report_indication_cb (QmiClientNas *client,
ctx = g_slice_new (IndicationRawReadContext);
ctx->self = g_object_ref (self);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_WMS (g_object_ref (client));
ctx->storage = storage;
ctx->memory_index = memory_index;
@@ -9559,7 +9559,7 @@ firmware_list_preload (MMBroadbandModemQmi *self,
return;
ctx = g_slice_new0 (FirmwareListPreloadContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_DMS (g_object_ref (client));
task = g_task_new (self, NULL, callback, user_data);
g_task_set_task_data (task, ctx, (GDestroyNotify)firmware_list_preload_context_free);
@@ -10392,7 +10392,7 @@ signal_load_values (MMIfaceModemSignal *self,
return;
ctx = g_slice_new0 (SignalLoadValuesContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_NAS (g_object_ref (client));
ctx->step = SIGNAL_LOAD_VALUES_STEP_SIGNAL_FIRST;
task = g_task_new (self, cancellable, callback, user_data);

View File

@@ -9815,19 +9815,19 @@ run_cdma_registration_checks_ready (MMBroadbandModem *self,
}
static void
modem_cdma_register_in_network (MMIfaceModemCdma *self,
modem_cdma_register_in_network (MMIfaceModemCdma *_self,
guint max_registration_time,
GAsyncReadyCallback callback,
gpointer user_data)
{
MMBroadbandModem *broadband = MM_BROADBAND_MODEM (self);
MMBroadbandModem *self = MM_BROADBAND_MODEM (_self);
RegisterInCdmaNetworkContext *ctx;
GTask *task;
/* (Try to) cancel previous registration request */
if (broadband->priv->modem_cdma_pending_registration_cancellable) {
g_cancellable_cancel (broadband->priv->modem_cdma_pending_registration_cancellable);
g_clear_object (&broadband->priv->modem_cdma_pending_registration_cancellable);
if (self->priv->modem_cdma_pending_registration_cancellable) {
g_cancellable_cancel (self->priv->modem_cdma_pending_registration_cancellable);
g_clear_object (&self->priv->modem_cdma_pending_registration_cancellable);
}
ctx = g_new0 (RegisterInCdmaNetworkContext, 1);
@@ -9837,7 +9837,7 @@ modem_cdma_register_in_network (MMIfaceModemCdma *self,
/* Keep an accessible reference to the cancellable, so that we can cancel
* previous request when needed */
broadband->priv->modem_cdma_pending_registration_cancellable =
self->priv->modem_cdma_pending_registration_cancellable =
g_object_ref (ctx->cancellable);
/* Get fresh registration state */
@@ -9847,7 +9847,7 @@ modem_cdma_register_in_network (MMIfaceModemCdma *self,
g_task_set_task_data (task, ctx, (GDestroyNotify)register_in_cdma_network_context_free);
mm_iface_modem_cdma_run_registration_checks (
self,
_self,
(GAsyncReadyCallback)run_cdma_registration_checks_ready,
task);
}
@@ -11902,7 +11902,7 @@ enable (MMBaseModem *self,
EnablingContext *ctx;
ctx = g_new0 (EnablingContext, 1);
ctx->self = g_object_ref (self);
ctx->self = MM_BROADBAND_MODEM (g_object_ref (self));
ctx->step = ENABLING_STEP_FIRST;
g_task_set_task_data (task, ctx, (GDestroyNotify)enabling_context_free);
@@ -12468,7 +12468,7 @@ initialize (MMBaseModem *self,
InitializeContext *ctx;
ctx = g_new0 (InitializeContext, 1);
ctx->self = g_object_ref (self);
ctx->self = MM_BROADBAND_MODEM (g_object_ref (self));
ctx->step = INITIALIZE_STEP_FIRST;
g_task_set_task_data (task, ctx, (GDestroyNotify)initialize_context_free);

View File

@@ -536,7 +536,7 @@ GObject *
mm_device_get_plugin (MMDevice *self)
{
return (self->priv->plugin ?
g_object_ref (self->priv->plugin) :
G_OBJECT (g_object_ref (self->priv->plugin)) :
NULL);
}
@@ -573,7 +573,7 @@ mm_device_get_port_probe (MMDevice *self,
MMPortProbe *probe;
probe = device_find_probe_with_device (self, kernel_port, FALSE);
return (probe ? g_object_ref (probe) : NULL);
return (probe ? G_OBJECT (g_object_ref (probe)) : NULL);
}
GList *

View File

@@ -469,7 +469,7 @@ mm_shared_qmi_3gpp_register_in_network (MMIfaceModem3gpp *self,
task = g_task_new (self, cancellable, callback, user_data);
ctx = g_slice_new0 (RegisterInNetworkContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_NAS (g_object_ref (client));
ctx->cancellable = cancellable ? g_object_ref (cancellable) : NULL;
g_task_set_task_data (task, ctx, (GDestroyNotify)register_in_network_context_free);
@@ -757,7 +757,7 @@ mm_shared_qmi_set_current_capabilities (MMIfaceModem *self,
g_assert (priv->feature_nas_ssp != FEATURE_UNKNOWN);
ctx = g_slice_new0 (SetCurrentCapabilitiesContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_NAS (g_object_ref (client));
ctx->capabilities = capabilities;
ctx->step = SET_CURRENT_CAPABILITIES_STEP_FIRST;
@@ -1057,8 +1057,8 @@ mm_shared_qmi_load_current_capabilities (MMIfaceModem *self,
g_assert (priv->feature_nas_ssp == FEATURE_UNKNOWN);
ctx = g_slice_new0 (LoadCurrentCapabilitiesContext);
ctx->nas_client = g_object_ref (nas_client);
ctx->dms_client = g_object_ref (dms_client);
ctx->nas_client = QMI_CLIENT_NAS (g_object_ref (nas_client));
ctx->dms_client = QMI_CLIENT_DMS (g_object_ref (dms_client));
ctx->step = LOAD_CURRENT_CAPABILITIES_STEP_FIRST;
task = g_task_new (self, NULL, callback, user_data);
@@ -1341,7 +1341,7 @@ mm_shared_qmi_set_current_modes (MMIfaceModem *self,
return;
ctx = g_slice_new0 (SetCurrentModesContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_NAS (g_object_ref (client));
if (allowed == MM_MODEM_MODE_ANY && ctx->preferred == MM_MODEM_MODE_NONE) {
ctx->allowed = MM_MODEM_MODE_NONE;
@@ -1598,7 +1598,7 @@ mm_shared_qmi_load_current_modes (MMIfaceModem *self,
return;
ctx = g_new0 (LoadCurrentModesContext, 1);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_NAS (g_object_ref (client));
task = g_task_new (self, NULL, callback, user_data);
g_task_set_task_data (task, ctx, (GDestroyNotify)load_current_modes_context_free);
@@ -2710,7 +2710,7 @@ mm_shared_qmi_setup_carrier_config (MMIfaceModem *self,
g_object_unref (task);
return;
}
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_PDC (g_object_ref (client));
setup_carrier_config_step (task);
}
@@ -3192,7 +3192,7 @@ mm_shared_qmi_load_carrier_config (MMIfaceModem *self,
g_object_unref (task);
return;
}
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_PDC (g_object_ref (client));
load_carrier_config_step (task);
}
@@ -3371,7 +3371,7 @@ mm_shared_qmi_load_sim_slots (MMIfaceModem *self,
task = g_task_new (self, NULL, callback, user_data);
ctx = g_slice_new0 (LoadSimSlotsContext);
ctx->client_uim = g_object_ref (client);
ctx->client_uim = QMI_CLIENT_UIM (g_object_ref (client));
g_task_set_task_data (task, ctx, (GDestroyNotify) load_sim_slots_context_free);
qmi_client_uim_get_slot_status (ctx->client_uim,
@@ -4919,7 +4919,7 @@ setup_required_nmea_traces (MMSharedQmi *self,
SetupRequiredNmeaTracesContext *ctx;
ctx = g_slice_new0 (SetupRequiredNmeaTracesContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_LOC (g_object_ref (client));
g_task_set_task_data (task, ctx, (GDestroyNotify)setup_required_nmea_traces_context_free);
qmi_client_loc_get_nmea_types (ctx->client,
@@ -4980,7 +4980,7 @@ pds_ser_location_ready (QmiClientPds *client,
g_assert (!priv->pds_client);
g_assert (priv->pds_location_event_report_indication_id == 0);
priv->pds_client = g_object_ref (client);
priv->pds_client = QMI_CLIENT (g_object_ref (client));
priv->pds_location_event_report_indication_id =
g_signal_connect (priv->pds_client,
"event-report",
@@ -5110,7 +5110,7 @@ loc_register_events_ready (QmiClientLoc *client,
g_assert (!priv->loc_client);
g_assert (!priv->loc_location_nmea_indication_id);
priv->loc_client = g_object_ref (client);
priv->loc_client = QMI_CLIENT (g_object_ref (client));
priv->loc_location_nmea_indication_id =
g_signal_connect (client,
"nmea",
@@ -6223,7 +6223,7 @@ mm_shared_qmi_location_load_supported_assistance_data (MMIfaceModemLocation *se
}
ctx = g_slice_new0 (LoadSupportedAssistanceDataContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_LOC (g_object_ref (client));
g_task_set_task_data (task, ctx, (GDestroyNotify)load_supported_assistance_data_context_free);
qmi_client_loc_get_predicted_orbits_data_source (ctx->client,
@@ -6587,7 +6587,7 @@ mm_shared_qmi_location_inject_assistance_data (MMIfaceModemLocation *self,
task = g_task_new (self, NULL, callback, user_data);
ctx = g_slice_new0 (InjectAssistanceDataContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_LOC (g_object_ref (client));
ctx->data = g_memdup (data, data_size);
ctx->data_size = data_size;
ctx->part_size = ((priv->loc_assistance_data_max_part_size > 0) ? priv->loc_assistance_data_max_part_size : MAX_BYTES_PER_REQUEST);

View File

@@ -277,7 +277,7 @@ sms_store (MMBaseSms *self,
/* Setup the context */
ctx = g_slice_new0 (SmsStoreContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_WMS (g_object_ref (client));
ctx->storage = storage;
g_object_get (self,
MM_BASE_SMS_MODEM, &ctx->modem,
@@ -611,7 +611,7 @@ sms_send (MMBaseSms *self,
/* Setup the context */
ctx = g_slice_new0 (SmsSendContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_WMS (g_object_ref (client));
g_object_get (self,
MM_BASE_SMS_MODEM, &ctx->modem,
NULL);
@@ -769,7 +769,7 @@ sms_delete (MMBaseSms *self,
return;
ctx = g_slice_new0 (SmsDeletePartsContext);
ctx->client = g_object_ref (client);
ctx->client = QMI_CLIENT_WMS (g_object_ref (client));
g_object_get (self,
MM_BASE_SMS_MODEM, &ctx->modem,
NULL);