diff options
author | Bastien Nocera <hadess@hadess.net> | 2013-10-10 16:02:05 +0200 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2013-10-14 10:37:03 +0200 |
commit | ad7e809d4d811bead43de58e5041f8d136c88df6 (patch) | |
tree | 293f76f88fba560060eaf527872c7c1b9b6ed4d9 /libupower-glib | |
parent | 5f26bc5caa1b1d3ed352702be1fec5d5625ff1d1 (diff) | |
download | upower-ad7e809d4d811bead43de58e5041f8d136c88df6.tar.gz |
lib: Simplify _new() functions
No need to use a temporary variable.
Diffstat (limited to 'libupower-glib')
-rw-r--r-- | libupower-glib/up-device.c | 4 | ||||
-rw-r--r-- | libupower-glib/up-history-item.c | 4 | ||||
-rw-r--r-- | libupower-glib/up-stats-item.c | 4 | ||||
-rw-r--r-- | libupower-glib/up-wakeup-item.c | 4 | ||||
-rw-r--r-- | libupower-glib/up-wakeups.c | 4 |
5 files changed, 5 insertions, 15 deletions
diff --git a/libupower-glib/up-device.c b/libupower-glib/up-device.c index 31db5ec..72cf530 100644 --- a/libupower-glib/up-device.c +++ b/libupower-glib/up-device.c @@ -1419,8 +1419,6 @@ up_device_finalize (GObject *object) UpDevice * up_device_new (void) { - UpDevice *device; - device = g_object_new (UP_TYPE_DEVICE, NULL); - return UP_DEVICE (device); + return UP_DEVICE (g_object_new (UP_TYPE_DEVICE, NULL)); } diff --git a/libupower-glib/up-history-item.c b/libupower-glib/up-history-item.c index 082b408..e158e1a 100644 --- a/libupower-glib/up-history-item.c +++ b/libupower-glib/up-history-item.c @@ -358,8 +358,6 @@ up_history_item_finalize (GObject *object) UpHistoryItem * up_history_item_new (void) { - UpHistoryItem *history_item; - history_item = g_object_new (UP_TYPE_HISTORY_ITEM, NULL); - return UP_HISTORY_ITEM (history_item); + return UP_HISTORY_ITEM (g_object_new (UP_TYPE_HISTORY_ITEM, NULL)); } diff --git a/libupower-glib/up-stats-item.c b/libupower-glib/up-stats-item.c index 89b319c..859ed71 100644 --- a/libupower-glib/up-stats-item.c +++ b/libupower-glib/up-stats-item.c @@ -231,8 +231,6 @@ up_stats_item_finalize (GObject *object) UpStatsItem * up_stats_item_new (void) { - UpStatsItem *stats_item; - stats_item = g_object_new (UP_TYPE_STATS_ITEM, NULL); - return UP_STATS_ITEM (stats_item); + return UP_STATS_ITEM (g_object_new (UP_TYPE_STATS_ITEM, NULL)); } diff --git a/libupower-glib/up-wakeup-item.c b/libupower-glib/up-wakeup-item.c index 7060a3d..0bdd458 100644 --- a/libupower-glib/up-wakeup-item.c +++ b/libupower-glib/up-wakeup-item.c @@ -458,8 +458,6 @@ up_wakeup_item_finalize (GObject *object) UpWakeupItem * up_wakeup_item_new (void) { - UpWakeupItem *wakeup_item; - wakeup_item = g_object_new (UP_TYPE_WAKEUP_ITEM, NULL); - return UP_WAKEUP_ITEM (wakeup_item); + return UP_WAKEUP_ITEM (g_object_new (UP_TYPE_WAKEUP_ITEM, NULL)); } diff --git a/libupower-glib/up-wakeups.c b/libupower-glib/up-wakeups.c index 20b9f59..e3d3475 100644 --- a/libupower-glib/up-wakeups.c +++ b/libupower-glib/up-wakeups.c @@ -395,8 +395,6 @@ up_wakeups_finalize (GObject *object) UpWakeups * up_wakeups_new (void) { - UpWakeups *wakeups; - wakeups = g_object_new (UP_TYPE_WAKEUPS, NULL); - return UP_WAKEUPS (wakeups); + return UP_WAKEUPS (g_object_new (UP_TYPE_WAKEUPS, NULL)); } |