summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kellner <christian@kellner.me>2019-02-21 12:09:06 +0100
committerChristian Kellner <christian@kellner.me>2019-02-21 12:09:06 +0100
commit9b7ce3dea303f4a581c4e3ef1a0508b739711c41 (patch)
tree42b583a99dfabaf21e6e61841201f113f8a601a9
parent8da188b30351a252de2405b09698dd61d53eb606 (diff)
downloadupower-9b7ce3dea303f4a581c4e3ef1a0508b739711c41.tar.gz
Replace use of G_TYPE_INSTANCE_GET_PRIVATE
G_TYPE_INSTANCE_GET_PRIVATE has been deprecated since glib version 2.58 and should be replaced with the xxx_get_instance_private (obj) which is generated by G_ADD_PRIVATE.
-rw-r--r--libupower-glib/up-client.c4
-rw-r--r--libupower-glib/up-device.c4
-rw-r--r--libupower-glib/up-history-item.c4
-rw-r--r--libupower-glib/up-stats-item.c4
-rw-r--r--libupower-glib/up-wakeup-item.c4
-rw-r--r--libupower-glib/up-wakeups.c4
-rw-r--r--src/dummy/up-backend.c4
-rw-r--r--src/freebsd/up-backend.c4
-rw-r--r--src/linux/hidpp-device.c3
-rw-r--r--src/linux/up-backend.c4
-rw-r--r--src/linux/up-device-bluez.c1
-rw-r--r--src/linux/up-device-csr.c3
-rw-r--r--src/linux/up-device-hid.c3
-rw-r--r--src/linux/up-device-idevice.c3
-rw-r--r--src/linux/up-device-supply.c3
-rw-r--r--src/linux/up-device-unifying.c3
-rw-r--r--src/linux/up-device-wup.c3
-rw-r--r--src/linux/up-input.c3
-rw-r--r--src/openbsd/up-backend.c4
-rw-r--r--src/up-config.c4
-rw-r--r--src/up-daemon.c4
-rw-r--r--src/up-device-list.c4
-rw-r--r--src/up-device.c3
-rw-r--r--src/up-history.c4
-rw-r--r--src/up-kbd-backlight.c6
-rw-r--r--src/up-wakeups.c6
26 files changed, 27 insertions, 69 deletions
diff --git a/libupower-glib/up-client.c b/libupower-glib/up-client.c
index 2309bd3..26a6af7 100644
--- a/libupower-glib/up-client.c
+++ b/libupower-glib/up-client.c
@@ -43,8 +43,6 @@ static void up_client_initable_iface_init (GInitableIface *iface);
static void up_client_init (UpClient *client);
static void up_client_finalize (GObject *object);
-#define UP_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_CLIENT, UpClientPrivate))
-
/**
* UpClientPrivate:
*
@@ -462,7 +460,7 @@ static gboolean
up_client_initable_init (GInitable *initable, GCancellable *cancellable, GError **error)
{
UpClient *client = UP_CLIENT (initable);
- client->priv = UP_CLIENT_GET_PRIVATE (client);
+ client->priv = up_client_get_instance_private (client);
/* connect to main interface */
client->priv->proxy = up_exported_daemon_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c
index 6a4a4ad..e21274d 100644
--- a/libupower-glib/up-device.c
+++ b/libupower-glib/up-device.c
@@ -44,8 +44,6 @@ static void up_device_class_init (UpDeviceClass *klass);
static void up_device_init (UpDevice *device);
static void up_device_finalize (GObject *object);
-#define UP_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE, UpDevicePrivate))
-
/**
* UpDevicePrivate:
*
@@ -1217,7 +1215,7 @@ value_free (GValue *value)
static void
up_device_init (UpDevice *device)
{
- device->priv = UP_DEVICE_GET_PRIVATE (device);
+ device->priv = up_device_get_instance_private (device);
device->priv->offline_props = g_hash_table_new_full (g_direct_hash,
g_direct_equal,
NULL,
diff --git a/libupower-glib/up-history-item.c b/libupower-glib/up-history-item.c
index 0fbefa6..685cc08 100644
--- a/libupower-glib/up-history-item.c
+++ b/libupower-glib/up-history-item.c
@@ -39,8 +39,6 @@ static void up_history_item_class_init (UpHistoryItemClass *klass);
static void up_history_item_init (UpHistoryItem *history_item);
static void up_history_item_finalize (GObject *object);
-#define UP_HISTORY_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_HISTORY_ITEM, UpHistoryItemPrivate))
-
struct UpHistoryItemPrivate
{
gdouble value;
@@ -329,7 +327,7 @@ up_history_item_class_init (UpHistoryItemClass *klass)
static void
up_history_item_init (UpHistoryItem *history_item)
{
- history_item->priv = UP_HISTORY_ITEM_GET_PRIVATE (history_item);
+ history_item->priv = up_history_item_get_instance_private (history_item);
}
/**
diff --git a/libupower-glib/up-stats-item.c b/libupower-glib/up-stats-item.c
index c0204bf..538a44a 100644
--- a/libupower-glib/up-stats-item.c
+++ b/libupower-glib/up-stats-item.c
@@ -38,8 +38,6 @@ static void up_stats_item_class_init (UpStatsItemClass *klass);
static void up_stats_item_init (UpStatsItem *stats_item);
static void up_stats_item_finalize (GObject *object);
-#define UP_STATS_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_STATS_ITEM, UpStatsItemPrivate))
-
struct UpStatsItemPrivate
{
gdouble value;
@@ -202,7 +200,7 @@ up_stats_item_class_init (UpStatsItemClass *klass)
static void
up_stats_item_init (UpStatsItem *stats_item)
{
- stats_item->priv = UP_STATS_ITEM_GET_PRIVATE (stats_item);
+ stats_item->priv = up_stats_item_get_instance_private (stats_item);
}
/**
diff --git a/libupower-glib/up-wakeup-item.c b/libupower-glib/up-wakeup-item.c
index 948e4a1..82c7c6f 100644
--- a/libupower-glib/up-wakeup-item.c
+++ b/libupower-glib/up-wakeup-item.c
@@ -38,8 +38,6 @@ static void up_wakeup_item_class_init (UpWakeupItemClass *klass);
static void up_wakeup_item_init (UpWakeupItem *wakeup_item);
static void up_wakeup_item_finalize (GObject *object);
-#define UP_WAKEUP_ITEM_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_WAKEUP_ITEM, UpWakeupItemPrivate))
-
struct UpWakeupItemPrivate
{
gboolean is_userspace;
@@ -418,7 +416,7 @@ up_wakeup_item_class_init (UpWakeupItemClass *klass)
static void
up_wakeup_item_init (UpWakeupItem *wakeup_item)
{
- wakeup_item->priv = UP_WAKEUP_ITEM_GET_PRIVATE (wakeup_item);
+ wakeup_item->priv = up_wakeup_item_get_instance_private (wakeup_item);
}
/**
diff --git a/libupower-glib/up-wakeups.c b/libupower-glib/up-wakeups.c
index 630df82..20390ee 100644
--- a/libupower-glib/up-wakeups.c
+++ b/libupower-glib/up-wakeups.c
@@ -32,8 +32,6 @@ static void up_wakeups_class_init (UpWakeupsClass *klass);
static void up_wakeups_init (UpWakeups *wakeups);
static void up_wakeups_finalize (GObject *object);
-#define UP_WAKEUPS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_WAKEUPS, UpWakeupsPrivate))
-
struct UpWakeupsPrivate
{
UpExportedWakeups *proxy;
@@ -243,7 +241,7 @@ up_wakeups_init (UpWakeups *wakeups)
{
GError *error = NULL;
- wakeups->priv = UP_WAKEUPS_GET_PRIVATE (wakeups);
+ wakeups->priv = up_wakeups_get_instance_private (wakeups);
/* connect to main interface */
wakeups->priv->proxy = up_exported_wakeups_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff --git a/src/dummy/up-backend.c b/src/dummy/up-backend.c
index ea36fce..4e8d18b 100644
--- a/src/dummy/up-backend.c
+++ b/src/dummy/up-backend.c
@@ -35,8 +35,6 @@ static void up_backend_class_init (UpBackendClass *klass);
static void up_backend_init (UpBackend *backend);
static void up_backend_finalize (GObject *object);
-#define UP_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_BACKEND, UpBackendPrivate))
-
struct UpBackendPrivate
{
UpDaemon *daemon;
@@ -202,7 +200,7 @@ up_backend_class_init (UpBackendClass *klass)
static void
up_backend_init (UpBackend *backend)
{
- backend->priv = UP_BACKEND_GET_PRIVATE (backend);
+ backend->priv = up_backend_get_instance_private (backend);
backend->priv->daemon = NULL;
backend->priv->device_list = NULL;
#ifdef EGG_TEST
diff --git a/src/freebsd/up-backend.c b/src/freebsd/up-backend.c
index 90f578a..2496f0a 100644
--- a/src/freebsd/up-backend.c
+++ b/src/freebsd/up-backend.c
@@ -54,8 +54,6 @@ static gboolean up_backend_acpi_devd_notify (UpBackend *backend, const gchar *sy
static gboolean up_backend_create_new_device (UpBackend *backend, UpAcpiNative *native);
static void up_backend_lid_coldplug (UpBackend *backend);
-#define UP_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_BACKEND, UpBackendPrivate))
-
struct UpBackendPrivate
{
UpDaemon *daemon;
@@ -412,7 +410,7 @@ up_backend_class_init (UpBackendClass *klass)
static void
up_backend_init (UpBackend *backend)
{
- backend->priv = UP_BACKEND_GET_PRIVATE (backend);
+ backend->priv = up_backend_get_instance_private (backend);
backend->priv->handle_map = g_hash_table_new_full (g_str_hash, g_str_equal, (GDestroyNotify) g_free, (GDestroyNotify) g_object_unref);
backend->priv->config = up_config_new ();
backend->priv->seat_manager_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff --git a/src/linux/hidpp-device.c b/src/linux/hidpp-device.c
index c386858..1bd3337 100644
--- a/src/linux/hidpp-device.c
+++ b/src/linux/hidpp-device.c
@@ -164,7 +164,6 @@ typedef struct {
} HidppDeviceMap;
G_DEFINE_TYPE_WITH_PRIVATE (HidppDevice, hidpp_device, G_TYPE_OBJECT)
-#define HIDPP_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), HIDPP_TYPE_DEVICE, HidppDevicePrivate))
/**
* hidpp_is_error:
@@ -1033,7 +1032,7 @@ hidpp_device_init (HidppDevice *device)
{
HidppDeviceMap *map;
- device->priv = HIDPP_DEVICE_GET_PRIVATE (device);
+ device->priv = hidpp_device_get_instance_private (device);
device->priv->fd = -1;
device->priv->feature_index = g_ptr_array_new_with_free_func (hidpp_device_free_feature);
device->priv->batt_status = HIDPP_DEVICE_BATT_STATUS_UNKNOWN;
diff --git a/src/linux/up-backend.c b/src/linux/up-backend.c
index cf5407e..9d08a85 100644
--- a/src/linux/up-backend.c
+++ b/src/linux/up-backend.c
@@ -57,8 +57,6 @@ static void up_backend_finalize (GObject *object);
#define LOGIND_DBUS_PATH "/org/freedesktop/login1"
#define LOGIND_DBUS_INTERFACE "org.freedesktop.login1.Manager"
-#define UP_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_BACKEND, UpBackendPrivate))
-
struct UpBackendPrivate
{
UpDaemon *daemon;
@@ -813,7 +811,7 @@ up_backend_init (UpBackend *backend)
GDBusConnection *bus;
guint sleep_id;
- backend->priv = UP_BACKEND_GET_PRIVATE (backend);
+ backend->priv = up_backend_get_instance_private (backend);
backend->priv->config = up_config_new ();
backend->priv->managed_devices = up_device_list_new ();
backend->priv->logind_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SYSTEM,
diff --git a/src/linux/up-device-bluez.c b/src/linux/up-device-bluez.c
index 42a8e1b..cd89529 100644
--- a/src/linux/up-device-bluez.c
+++ b/src/linux/up-device-bluez.c
@@ -28,7 +28,6 @@
#include "up-device-bluez.h"
G_DEFINE_TYPE (UpDeviceBluez, up_device_bluez, UP_TYPE_DEVICE)
-#define UP_DEVICE_BLUEZ_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_BLUEZ, UpDeviceBluezPrivate))
static UpDeviceKind
appearance_to_kind (guint16 appearance)
diff --git a/src/linux/up-device-csr.c b/src/linux/up-device-csr.c
index 15eb728..63442d8 100644
--- a/src/linux/up-device-csr.c
+++ b/src/linux/up-device-csr.c
@@ -61,7 +61,6 @@ struct UpDeviceCsrPrivate
};
G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceCsr, up_device_csr, UP_TYPE_DEVICE)
-#define UP_DEVICE_CSR_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_CSR, UpDeviceCsrPrivate))
static gboolean up_device_csr_refresh (UpDevice *device);
@@ -291,7 +290,7 @@ static void
up_device_csr_init (UpDeviceCsr *csr)
{
gint retval;
- csr->priv = UP_DEVICE_CSR_GET_PRIVATE (csr);
+ csr->priv = up_device_csr_get_instance_private (csr);
csr->priv->raw_value = -1;
retval = libusb_init (&csr->priv->ctx);
diff --git a/src/linux/up-device-hid.c b/src/linux/up-device-hid.c
index 8f45f97..fa5709d 100644
--- a/src/linux/up-device-hid.c
+++ b/src/linux/up-device-hid.c
@@ -91,7 +91,6 @@ struct UpDeviceHidPrivate
};
G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceHid, up_device_hid, UP_TYPE_DEVICE)
-#define UP_DEVICE_HID_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_HID, UpDeviceHidPrivate))
static gboolean up_device_hid_refresh (UpDevice *device);
@@ -470,7 +469,7 @@ up_device_hid_get_on_battery (UpDevice *device, gboolean *on_battery)
static void
up_device_hid_init (UpDeviceHid *hid)
{
- hid->priv = UP_DEVICE_HID_GET_PRIVATE (hid);
+ hid->priv = up_device_hid_get_instance_private (hid);
hid->priv->fd = -1;
hid->priv->poll_timer_id = g_timeout_add_seconds (UP_DEVICE_HID_REFRESH_TIMEOUT,
(GSourceFunc) up_device_hid_poll, hid);
diff --git a/src/linux/up-device-idevice.c b/src/linux/up-device-idevice.c
index 0a00253..a808269 100644
--- a/src/linux/up-device-idevice.c
+++ b/src/linux/up-device-idevice.c
@@ -49,7 +49,6 @@ struct UpDeviceIdevicePrivate
};
G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceIdevice, up_device_idevice, UP_TYPE_DEVICE)
-#define UP_DEVICE_IDEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_IDEVICE, UpDeviceIdevicePrivate))
static gboolean up_device_idevice_refresh (UpDevice *device);
@@ -347,7 +346,7 @@ out:
static void
up_device_idevice_init (UpDeviceIdevice *idevice)
{
- idevice->priv = UP_DEVICE_IDEVICE_GET_PRIVATE (idevice);
+ idevice->priv = up_device_idevice_get_instance_private (idevice);
}
/**
diff --git a/src/linux/up-device-supply.c b/src/linux/up-device-supply.c
index 1c76a25..0d836e3 100644
--- a/src/linux/up-device-supply.c
+++ b/src/linux/up-device-supply.c
@@ -71,7 +71,6 @@ struct UpDeviceSupplyPrivate
};
G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceSupply, up_device_supply, UP_TYPE_DEVICE)
-#define UP_DEVICE_SUPPLY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_SUPPLY, UpDeviceSupplyPrivate))
static gboolean up_device_supply_refresh (UpDevice *device);
static void up_device_supply_setup_unknown_poll (UpDevice *device,
@@ -1221,7 +1220,7 @@ up_device_supply_init (UpDeviceSupply *supply)
{
UpConfig *config;
- supply->priv = UP_DEVICE_SUPPLY_GET_PRIVATE (supply);
+ supply->priv = up_device_supply_get_instance_private (supply);
/* allocate the stats for the battery charging & discharging */
supply->priv->energy_old = g_new (gdouble, UP_DEVICE_SUPPLY_ENERGY_OLD_LENGTH);
diff --git a/src/linux/up-device-unifying.c b/src/linux/up-device-unifying.c
index 5d03e6b..b725318 100644
--- a/src/linux/up-device-unifying.c
+++ b/src/linux/up-device-unifying.c
@@ -36,7 +36,6 @@ struct UpDeviceUnifyingPrivate
};
G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceUnifying, up_device_unifying, UP_TYPE_DEVICE)
-#define UP_DEVICE_UNIFYING_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_UNIFYING, UpDeviceUnifyingPrivate))
/**
* up_device_unifying_refresh:
@@ -300,7 +299,7 @@ out:
static void
up_device_unifying_init (UpDeviceUnifying *unifying)
{
- unifying->priv = UP_DEVICE_UNIFYING_GET_PRIVATE (unifying);
+ unifying->priv = up_device_unifying_get_instance_private (unifying);
}
/**
diff --git a/src/linux/up-device-wup.c b/src/linux/up-device-wup.c
index 57a9c4a..a7b00c1 100644
--- a/src/linux/up-device-wup.c
+++ b/src/linux/up-device-wup.c
@@ -73,7 +73,6 @@ struct UpDeviceWupPrivate
};
G_DEFINE_TYPE_WITH_PRIVATE (UpDeviceWup, up_device_wup, UP_TYPE_DEVICE)
-#define UP_DEVICE_WUP_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_WUP, UpDeviceWupPrivate))
static gboolean up_device_wup_refresh (UpDevice *device);
@@ -420,7 +419,7 @@ out:
static void
up_device_wup_init (UpDeviceWup *wup)
{
- wup->priv = UP_DEVICE_WUP_GET_PRIVATE (wup);
+ wup->priv = up_device_wup_get_instance_private (wup);
wup->priv->fd = -1;
wup->priv->poll_timer_id = g_timeout_add_seconds (UP_DEVICE_WUP_REFRESH_TIMEOUT,
(GSourceFunc) up_device_wup_poll_cb, wup);
diff --git a/src/linux/up-input.c b/src/linux/up-input.c
index 1bed6e4..be79b56 100644
--- a/src/linux/up-input.c
+++ b/src/linux/up-input.c
@@ -55,7 +55,6 @@ struct UpInputPrivate
};
G_DEFINE_TYPE_WITH_PRIVATE (UpInput, up_input, G_TYPE_OBJECT)
-#define UP_INPUT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_INPUT, UpInputPrivate))
/* we must use this kernel-compatible implementation */
#define BITS_PER_LONG (sizeof(long) * 8)
@@ -267,7 +266,7 @@ out:
static void
up_input_init (UpInput *input)
{
- input->priv = UP_INPUT_GET_PRIVATE (input);
+ input->priv = up_input_get_instance_private (input);
input->priv->eventfp = -1;
}
diff --git a/src/openbsd/up-backend.c b/src/openbsd/up-backend.c
index 7fb4271..34f38e6 100644
--- a/src/openbsd/up-backend.c
+++ b/src/openbsd/up-backend.c
@@ -39,8 +39,6 @@ static gboolean up_apm_device_get_on_battery (UpDevice *device, gboolean *on_ba
static gboolean up_apm_device_get_online (UpDevice *device, gboolean *online);
static gboolean up_apm_device_refresh (UpDevice *device);
-#define UP_BACKEND_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_BACKEND, UpBackendPrivate))
-
struct UpBackendPrivate
{
UpDaemon *daemon;
@@ -597,7 +595,7 @@ up_backend_init (UpBackend *backend)
UpDeviceClass *device_class;
gint64 current_time;
- backend->priv = UP_BACKEND_GET_PRIVATE (backend);
+ backend->priv = up_backend_get_instance_private (backend);
backend->priv->is_laptop = up_native_is_laptop();
g_debug("is_laptop:%d",backend->priv->is_laptop);
if (backend->priv->is_laptop)
diff --git a/src/up-config.c b/src/up-config.c
index 5e663ac..f842ede 100644
--- a/src/up-config.c
+++ b/src/up-config.c
@@ -28,8 +28,6 @@
static void up_config_finalize (GObject *object);
-#define UP_CONFIG_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_CONFIG, UpConfigPrivate))
-
/**
* UpConfigPrivate:
*
@@ -100,7 +98,7 @@ up_config_init (UpConfig *config)
GError *error = NULL;
gchar *filename;
- config->priv = UP_CONFIG_GET_PRIVATE (config);
+ config->priv = up_config_get_instance_private (config);
config->priv->keyfile = g_key_file_new ();
filename = g_strdup (g_getenv ("UPOWER_CONF_FILE_NAME"));
diff --git a/src/up-daemon.c b/src/up-daemon.c
index 5c6401f..5263c34 100644
--- a/src/up-daemon.c
+++ b/src/up-daemon.c
@@ -78,8 +78,6 @@ static gboolean up_daemon_get_on_ac_local (UpDaemon *daemon);
G_DEFINE_TYPE_WITH_PRIVATE (UpDaemon, up_daemon, UP_TYPE_EXPORTED_DAEMON_SKELETON)
-#define UP_DAEMON_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DAEMON, UpDaemonPrivate))
-
#define UP_DAEMON_ACTION_DELAY 20 /* seconds */
#define UP_INTERFACE_PREFIX "org.freedesktop.UPower."
@@ -1082,7 +1080,7 @@ policy_config_validate (UpDaemon *daemon)
static void
up_daemon_init (UpDaemon *daemon)
{
- daemon->priv = UP_DAEMON_GET_PRIVATE (daemon);
+ daemon->priv = up_daemon_get_instance_private (daemon);
daemon->priv->config = up_config_new ();
daemon->priv->power_devices = up_device_list_new ();
daemon->priv->display_device = up_device_new ();
diff --git a/src/up-device-list.c b/src/up-device-list.c
index ece6d9c..5f3f0cd 100644
--- a/src/up-device-list.c
+++ b/src/up-device-list.c
@@ -30,8 +30,6 @@
static void up_device_list_finalize (GObject *object);
-#define UP_DEVICE_LIST_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE_LIST, UpDeviceListPrivate))
-
struct UpDeviceListPrivate
{
GPtrArray *array;
@@ -192,7 +190,7 @@ up_device_list_class_init (UpDeviceListClass *klass)
static void
up_device_list_init (UpDeviceList *list)
{
- list->priv = UP_DEVICE_LIST_GET_PRIVATE (list);
+ list->priv = up_device_list_get_instance_private (list);
list->priv->array = g_ptr_array_new_with_free_func (g_object_unref);
list->priv->map_native_path_to_device = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref);
}
diff --git a/src/up-device.c b/src/up-device.c
index 2cfc555..37ec129 100644
--- a/src/up-device.c
+++ b/src/up-device.c
@@ -45,7 +45,6 @@ struct UpDevicePrivate
};
G_DEFINE_TYPE_WITH_PRIVATE (UpDevice, up_device, UP_TYPE_EXPORTED_DEVICE_SKELETON)
-#define UP_DEVICE_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_DEVICE, UpDevicePrivate))
#define UP_DEVICES_DBUS_PATH "/org/freedesktop/UPower/devices"
@@ -711,7 +710,7 @@ up_device_init (UpDevice *device)
{
UpExportedDevice *skeleton;
- device->priv = UP_DEVICE_GET_PRIVATE (device);
+ device->priv = up_device_get_instance_private (device);
device->priv->history = up_history_new ();
skeleton = UP_EXPORTED_DEVICE (device);
diff --git a/src/up-history.c b/src/up-history.c
index a6768e4..5583a51 100644
--- a/src/up-history.c
+++ b/src/up-history.c
@@ -33,8 +33,6 @@
static void up_history_finalize (GObject *object);
-#define UP_HISTORY_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_HISTORY, UpHistoryPrivate))
-
#define UP_HISTORY_FILE_HEADER "PackageKit Profile"
#define UP_HISTORY_SAVE_INTERVAL (10*60) /* seconds */
#define UP_HISTORY_DEFAULT_MAX_DATA_AGE (7*24*60*60) /* seconds */
@@ -883,7 +881,7 @@ up_history_class_init (UpHistoryClass *klass)
static void
up_history_init (UpHistory *history)
{
- history->priv = UP_HISTORY_GET_PRIVATE (history);
+ history->priv = up_history_get_instance_private (history);
history->priv->data_rate = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
history->priv->data_charge = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
history->priv->data_time_full = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
diff --git a/src/up-kbd-backlight.c b/src/up-kbd-backlight.c
index 822572e..405fcff 100644
--- a/src/up-kbd-backlight.c
+++ b/src/up-kbd-backlight.c
@@ -38,8 +38,6 @@
static void up_kbd_backlight_finalize (GObject *object);
-#define UP_KBD_BACKLIGHT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_KBD_BACKLIGHT, UpKbdBacklightPrivate))
-
struct UpKbdBacklightPrivate
{
gint fd;
@@ -320,7 +318,7 @@ out:
static void
up_kbd_backlight_init (UpKbdBacklight *kbd_backlight)
{
- kbd_backlight->priv = UP_KBD_BACKLIGHT_GET_PRIVATE (kbd_backlight);
+ kbd_backlight->priv = up_kbd_backlight_get_instance_private (kbd_backlight);
g_signal_connect (kbd_backlight, "handle-get-brightness",
G_CALLBACK (up_kbd_backlight_get_brightness), kbd_backlight);
@@ -342,7 +340,7 @@ up_kbd_backlight_finalize (GObject *object)
g_return_if_fail (UP_IS_KBD_BACKLIGHT (object));
kbd_backlight = UP_KBD_BACKLIGHT (object);
- kbd_backlight->priv = UP_KBD_BACKLIGHT_GET_PRIVATE (kbd_backlight);
+ kbd_backlight->priv = up_kbd_backlight_get_instance_private (kbd_backlight);
if (kbd_backlight->priv->channel_hw_changed) {
g_io_channel_shutdown (kbd_backlight->priv->channel_hw_changed, FALSE, NULL);
diff --git a/src/up-wakeups.c b/src/up-wakeups.c
index 6f6328a..7f50ca5 100644
--- a/src/up-wakeups.c
+++ b/src/up-wakeups.c
@@ -33,8 +33,6 @@
static void up_wakeups_finalize (GObject *object);
static gboolean up_wakeups_timerstats_enable (UpWakeups *wakeups);
-#define UP_WAKEUPS_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), UP_TYPE_WAKEUPS, UpWakeupsPrivate))
-
#define UP_WAKEUPS_POLL_INTERVAL_KERNEL 2 /* seconds */
#define UP_WAKEUPS_POLL_INTERVAL_USERSPACE 2 /* seconds */
#define UP_WAKEUPS_DISABLE_INTERVAL 30 /* seconds */
@@ -664,7 +662,7 @@ up_wakeups_class_init (UpWakeupsClass *klass)
static void
up_wakeups_init (UpWakeups *wakeups)
{
- wakeups->priv = UP_WAKEUPS_GET_PRIVATE (wakeups);
+ wakeups->priv = up_wakeups_get_instance_private (wakeups);
wakeups->priv->data = g_ptr_array_new_with_free_func ((GDestroyNotify) g_object_unref);
/* test if we have an interface */
@@ -691,7 +689,7 @@ up_wakeups_finalize (GObject *object)
g_return_if_fail (UP_IS_WAKEUPS (object));
wakeups = UP_WAKEUPS (object);
- wakeups->priv = UP_WAKEUPS_GET_PRIVATE (wakeups);
+ wakeups->priv = up_wakeups_get_instance_private (wakeups);
/* stop timerstats */
up_wakeups_timerstats_disable (wakeups);