libmm-glib: unconditionally define autoptr support for all types

As we now depend on glib 2.48
This commit is contained in:
Aleksander Morgado
2020-01-15 18:56:21 +01:00
parent 40e9434cc3
commit ddb7d915a7
39 changed files with 0 additions and 140 deletions
-3
View File
@@ -54,10 +54,7 @@ struct _MMBearerIpConfigClass {
};
GType mm_bearer_ip_config_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerIpConfig, g_object_unref)
#endif
MMBearerIpMethod mm_bearer_ip_config_get_method (MMBearerIpConfig *self);
const gchar *mm_bearer_ip_config_get_address (MMBearerIpConfig *self);
-3
View File
@@ -54,10 +54,7 @@ struct _MMBearerPropertiesClass {
};
GType mm_bearer_properties_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerProperties, g_object_unref)
#endif
MMBearerProperties *mm_bearer_properties_new (void);
-3
View File
@@ -56,10 +56,7 @@ struct _MMBearerStatsClass {
};
GType mm_bearer_stats_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearerStats, g_object_unref)
#endif
guint mm_bearer_stats_get_duration (MMBearerStats *self);
guint64 mm_bearer_stats_get_rx_bytes (MMBearerStats *self);
-3
View File
@@ -66,10 +66,7 @@ struct _MMBearerClass {
};
GType mm_bearer_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMBearer, g_object_unref)
#endif
const gchar *mm_bearer_get_path (MMBearer *self);
gchar *mm_bearer_dup_path (MMBearer *self);
-3
View File
@@ -54,10 +54,7 @@ struct _MMCallAudioFormatClass {
};
GType mm_call_audio_format_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallAudioFormat, g_object_unref)
#endif
const gchar *mm_call_audio_format_get_encoding (MMCallAudioFormat *self);
const gchar *mm_call_audio_format_get_resolution (MMCallAudioFormat *self);
-3
View File
@@ -54,10 +54,7 @@ struct _MMCallPropertiesClass {
};
GType mm_call_properties_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCallProperties, g_object_unref)
#endif
MMCallProperties *mm_call_properties_new (void);
void mm_call_properties_set_number (MMCallProperties *self,
-3
View File
@@ -59,10 +59,7 @@ struct _MMCallClass {
};
GType mm_call_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCall, g_object_unref)
#endif
const gchar *mm_call_get_path (MMCall *self);
gchar *mm_call_dup_path (MMCall *self);
@@ -54,10 +54,7 @@ struct _MMCdmaManualActivationPropertiesClass {
};
GType mm_cdma_manual_activation_properties_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMCdmaManualActivationProperties, g_object_unref)
#endif
MMCdmaManualActivationProperties *mm_cdma_manual_activation_properties_new (void);
-23
View File
@@ -182,27 +182,4 @@ gboolean mm_utils_ishexstr (const gchar *hex);
gboolean mm_utils_check_for_single_value (guint32 value);
#if GLIB_CHECK_VERSION(2, 44, 0)
#define mm_autoptr g_autoptr
#else
/* Re-implement for those glib that don't have it */
#define _MM_AUTOPTR_FUNC_NAME(TypeName) mm_autoptr_cleanup_##TypeName
#define _MM_AUTOPTR_TYPENAME(TypeName) TypeName##_autoptr
#define _MM_CLEANUP(func) __attribute__((cleanup(func)))
#define _MM_DEFINE_AUTOPTR_CLEANUP_FUNCS(TypeName, cleanup) \
typedef TypeName *_MM_AUTOPTR_TYPENAME(TypeName); \
G_GNUC_BEGIN_IGNORE_DEPRECATIONS \
static G_GNUC_UNUSED inline void _MM_AUTOPTR_FUNC_NAME(TypeName) (TypeName **_ptr) \
{ if (_ptr && *_ptr) (cleanup) (*_ptr); } \
G_GNUC_END_IGNORE_DEPRECATIONS
#define mm_autoptr(TypeName) _MM_CLEANUP(_MM_AUTOPTR_FUNC_NAME(TypeName)) _MM_AUTOPTR_TYPENAME(TypeName)
_MM_DEFINE_AUTOPTR_CLEANUP_FUNCS(GRegex, g_regex_unref)
_MM_DEFINE_AUTOPTR_CLEANUP_FUNCS(GMatchInfo, g_match_info_unref)
#endif
#endif /* MM_COMMON_HELPERS_H */
-3
View File
@@ -54,10 +54,7 @@ struct _MMFirmwarePropertiesClass {
};
GType mm_firmware_properties_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMFirmwareProperties, g_object_unref)
#endif
const gchar *mm_firmware_properties_get_unique_id (MMFirmwareProperties *self);
MMFirmwareImageType mm_firmware_properties_get_image_type (MMFirmwareProperties *self);
-3
View File
@@ -54,10 +54,7 @@ struct _MMFirmwareUpdateSettingsClass {
};
GType mm_firmware_update_settings_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMFirmwareUpdateSettings, g_object_unref)
#endif
MMModemFirmwareUpdateMethod mm_firmware_update_settings_get_method (MMFirmwareUpdateSettings *self);
-3
View File
@@ -54,10 +54,7 @@ struct _MMKernelEventPropertiesClass {
};
GType mm_kernel_event_properties_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMKernelEventProperties, g_object_unref)
#endif
MMKernelEventProperties *mm_kernel_event_properties_new (void);
-3
View File
@@ -54,10 +54,7 @@ struct _MMLocation3gppClass {
};
GType mm_location_3gpp_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocation3gpp, g_object_unref)
#endif
guint mm_location_3gpp_get_mobile_country_code (MMLocation3gpp *self);
guint mm_location_3gpp_get_mobile_network_code (MMLocation3gpp *self);
-3
View File
@@ -56,10 +56,7 @@ struct _MMLocationCdmaBsClass {
};
GType mm_location_cdma_bs_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocationCdmaBs, g_object_unref)
#endif
gdouble mm_location_cdma_bs_get_longitude (MMLocationCdmaBs *self);
gdouble mm_location_cdma_bs_get_latitude (MMLocationCdmaBs *self);
-3
View File
@@ -54,10 +54,7 @@ struct _MMLocationGpsNmeaClass {
};
GType mm_location_gps_nmea_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocationGpsNmea, g_object_unref)
#endif
const gchar *mm_location_gps_nmea_get_trace (MMLocationGpsNmea *self,
const gchar *trace_type);
-3
View File
@@ -56,10 +56,7 @@ struct _MMLocationGpsRawClass {
};
GType mm_location_gps_raw_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMLocationGpsRaw, g_object_unref)
#endif
const gchar *mm_location_gps_raw_get_utc_time (MMLocationGpsRaw *self);
gdouble mm_location_gps_raw_get_longitude (MMLocationGpsRaw *self);
-3
View File
@@ -66,10 +66,7 @@ struct _MMManagerClass {
};
GType mm_manager_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMManager, g_object_unref)
#endif
void mm_manager_new (
GDBusConnection *connection,
-3
View File
@@ -62,10 +62,7 @@ struct _MMModem3gppUssdClass {
};
GType mm_modem_3gpp_ussd_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModem3gppUssd, g_object_unref)
#endif
const gchar *mm_modem_3gpp_ussd_get_path (MMModem3gppUssd *self);
gchar *mm_modem_3gpp_ussd_dup_path (MMModem3gppUssd *self);
-6
View File
@@ -64,10 +64,7 @@ struct _MMModem3gppClass {
};
GType mm_modem_3gpp_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModem3gpp, g_object_unref)
#endif
const gchar *mm_modem_3gpp_get_path (MMModem3gpp *self);
gchar *mm_modem_3gpp_dup_path (MMModem3gpp *self);
@@ -125,10 +122,7 @@ const gchar *mm_modem_3gpp_network_get_operator_short (con
const gchar *mm_modem_3gpp_network_get_operator_code (const MMModem3gppNetwork *network);
MMModemAccessTechnology mm_modem_3gpp_network_get_access_technology (const MMModem3gppNetwork *network);
void mm_modem_3gpp_network_free (MMModem3gppNetwork *network);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModem3gppNetwork, mm_modem_3gpp_network_free)
#endif
void mm_modem_3gpp_scan (MMModem3gpp *self,
GCancellable *cancellable,
-3
View File
@@ -63,10 +63,7 @@ struct _MMModemCdmaClass {
};
GType mm_modem_cdma_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemCdma, g_object_unref)
#endif
const gchar *mm_modem_cdma_get_path (MMModemCdma *self);
gchar *mm_modem_cdma_dup_path (MMModemCdma *self);
-3
View File
@@ -65,10 +65,7 @@ struct _MMModemFirmwareClass {
};
GType mm_modem_firmware_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemFirmware, g_object_unref)
#endif
const gchar *mm_modem_firmware_get_path (MMModemFirmware *self);
gchar *mm_modem_firmware_dup_path (MMModemFirmware *self);
-3
View File
@@ -66,10 +66,7 @@ struct _MMModemLocationClass {
};
GType mm_modem_location_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemLocation, g_object_unref)
#endif
const gchar *mm_modem_location_get_path (MMModemLocation *self);
gchar *mm_modem_location_dup_path (MMModemLocation *self);
-3
View File
@@ -65,10 +65,7 @@ struct _MMModemMessagingClass {
};
GType mm_modem_messaging_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemMessaging, g_object_unref)
#endif
const gchar *mm_modem_messaging_get_path (MMModemMessaging *self);
gchar *mm_modem_messaging_dup_path (MMModemMessaging *self);
-3
View File
@@ -63,10 +63,7 @@ struct _MMModemOmaClass {
};
GType mm_modem_oma_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemOma, g_object_unref)
#endif
const gchar *mm_modem_oma_get_path (MMModemOma *self);
gchar *mm_modem_oma_dup_path (MMModemOma *self);
-3
View File
@@ -63,10 +63,7 @@ struct _MMModemSignalClass {
};
GType mm_modem_signal_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemSignal, g_object_unref)
#endif
const gchar *mm_modem_signal_get_path (MMModemSignal *self);
gchar *mm_modem_signal_dup_path (MMModemSignal *self);
-3
View File
@@ -65,10 +65,7 @@ struct _MMModemSimpleClass {
};
GType mm_modem_simple_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemSimple, g_object_unref)
#endif
const gchar *mm_modem_simple_get_path (MMModemSimple *self);
gchar *mm_modem_simple_dup_path (MMModemSimple *self);
-3
View File
@@ -64,10 +64,7 @@ struct _MMModemTimeClass {
};
GType mm_modem_time_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemTime, g_object_unref)
#endif
const gchar *mm_modem_time_get_path (MMModemTime *self);
gchar *mm_modem_time_dup_path (MMModemTime *self);
-3
View File
@@ -65,10 +65,7 @@ struct _MMModemVoiceClass {
};
GType mm_modem_voice_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModemVoice, g_object_unref)
#endif
const gchar *mm_modem_voice_get_path (MMModemVoice *self);
gchar *mm_modem_voice_dup_path (MMModemVoice *self);
-3
View File
@@ -67,10 +67,7 @@ struct _MMModemClass {
};
GType mm_modem_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMModem, g_object_unref)
#endif
const gchar *mm_modem_get_path (MMModem *self);
gchar *mm_modem_dup_path (MMModem *self);
-3
View File
@@ -72,10 +72,7 @@ struct _MMNetworkTimezoneClass {
};
GType mm_network_timezone_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMNetworkTimezone, g_object_unref)
#endif
gint32 mm_network_timezone_get_offset (MMNetworkTimezone *self);
gint32 mm_network_timezone_get_dst_offset (MMNetworkTimezone *self);
-3
View File
@@ -74,10 +74,7 @@ struct _MMObjectClass {
};
GType mm_object_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMObject, g_object_unref)
#endif
const gchar *mm_object_get_path (MMObject *self);
gchar *mm_object_dup_path (MMObject *self);
-3
View File
@@ -54,10 +54,7 @@ struct _MMPcoClass {
};
GType mm_pco_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMPco, g_object_unref)
#endif
guint32 mm_pco_get_session_id (MMPco *self);
gboolean mm_pco_is_complete (MMPco *self);
-3
View File
@@ -63,10 +63,7 @@ struct _MMSignalClass {
};
GType mm_signal_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSignal, g_object_unref)
#endif
gdouble mm_signal_get_rssi (MMSignal *self);
gdouble mm_signal_get_rscp (MMSignal *self);
-3
View File
@@ -62,10 +62,7 @@ struct _MMSimClass {
};
GType mm_sim_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSim, g_object_unref)
#endif
const gchar *mm_sim_get_path (MMSim *self);
gchar *mm_sim_dup_path (MMSim *self);
@@ -56,10 +56,7 @@ struct _MMSimpleConnectPropertiesClass {
};
GType mm_simple_connect_properties_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSimpleConnectProperties, g_object_unref)
#endif
MMSimpleConnectProperties *mm_simple_connect_properties_new (void);
-3
View File
@@ -54,10 +54,7 @@ struct _MMSimpleStatusClass {
};
GType mm_simple_status_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSimpleStatus, g_object_unref)
#endif
MMModemState mm_simple_status_get_state (MMSimpleStatus *self);
guint32 mm_simple_status_get_signal_quality (MMSimpleStatus *self,
-3
View File
@@ -54,10 +54,7 @@ struct _MMSmsPropertiesClass {
};
GType mm_sms_properties_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSmsProperties, g_object_unref)
#endif
MMSmsProperties *mm_sms_properties_new (void);
-3
View File
@@ -62,10 +62,7 @@ struct _MMSmsClass {
};
GType mm_sms_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMSms, g_object_unref)
#endif
const gchar *mm_sms_get_path (MMSms *self);
gchar *mm_sms_dup_path (MMSms *self);
-3
View File
@@ -63,10 +63,7 @@ struct _MMUnlockRetriesClass {
};
GType mm_unlock_retries_get_type (void);
#if GLIB_CHECK_VERSION(2, 44, 0)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (MMUnlockRetries, g_object_unref)
#endif
guint mm_unlock_retries_get (MMUnlockRetries *self,
MMModemLock lock);