aboutsummaryrefslogtreecommitdiff
path: root/src/device.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-07-18 21:33:19 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-07-18 21:33:19 +0000
commit512426b01bfa72a3c0d21b1ffbefd46bd7ebe306 (patch)
treee897bb966a0530f67fb9cfd74e8cc391d6748e8b /src/device.c
parent2d06cbb066f9ae0a0a49d5d260ebe28bb17311fc (diff)
parent9f1ebe8f6c412ab18bdf32bf949fc00152d9671b (diff)
downloadayatana-indicator-power-512426b01bfa72a3c0d21b1ffbefd46bd7ebe306.tar.gz
ayatana-indicator-power-512426b01bfa72a3c0d21b1ffbefd46bd7ebe306.tar.bz2
ayatana-indicator-power-512426b01bfa72a3c0d21b1ffbefd46bd7ebe306.zip
Switch from automake/autoconf to CMake.
Approved by: Ted Gould, PS Jenkins bot
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/device.c b/src/device.c
index 8780d72..f37aa7d 100644
--- a/src/device.c
+++ b/src/device.c
@@ -44,8 +44,6 @@ struct _IndicatorPowerDevicePrivate
GTimer * inestimable;
};
-#define INDICATOR_POWER_DEVICE_GET_PRIVATE(o) (INDICATOR_POWER_DEVICE(o)->priv)
-
/* Properties */
/* Enum for the properties so that they can be quickly found and looked up. */
enum {
@@ -69,7 +67,7 @@ static void set_property (GObject*, guint prop_id, const GValue*, GParamSpec* );
static void get_property (GObject*, guint prop_id, GValue*, GParamSpec* );
/* LCOV_EXCL_START */
-G_DEFINE_TYPE (IndicatorPowerDevice, indicator_power_device, G_TYPE_OBJECT);
+G_DEFINE_TYPE (IndicatorPowerDevice, indicator_power_device, G_TYPE_OBJECT)
/* LCOV_EXCL_STOP */
static void
@@ -189,7 +187,7 @@ get_property (GObject * o, guint prop_id, GValue * value, GParamSpec * pspec)
break;
case PROP_TIME:
- g_value_set_uint64 (value, priv->time);
+ g_value_set_uint64 (value, (guint64)priv->time);
break;
default:
@@ -207,11 +205,11 @@ set_property (GObject * o, guint prop_id, const GValue * value, GParamSpec * psp
switch (prop_id)
{
case PROP_KIND:
- p->kind = g_value_get_int (value);
+ p->kind = (UpDeviceKind) g_value_get_int (value);
break;
case PROP_STATE:
- p->state = g_value_get_int (value);
+ p->state = (UpDeviceState) g_value_get_int (value);
break;
case PROP_OBJECT_PATH:
@@ -224,7 +222,7 @@ set_property (GObject * o, guint prop_id, const GValue * value, GParamSpec * psp
break;
case PROP_TIME:
- p->time = g_value_get_uint64(value);
+ p->time = (time_t) g_value_get_uint64(value);
break;
default:
@@ -627,8 +625,8 @@ get_accessible_time_remaining (const IndicatorPowerDevice * device)
if (p->time && ((p->state == UP_DEVICE_STATE_CHARGING) || (p->state == UP_DEVICE_STATE_DISCHARGING)))
{
- int minutes = p->time / 60;
- const int hours = minutes / 60;
+ guint minutes = (guint)p->time / 60u;
+ const guint hours = minutes / 60u;
minutes %= 60;
if (p->state == UP_DEVICE_STATE_CHARGING)
@@ -889,5 +887,5 @@ indicator_power_device_new_from_variant (GVariant * v)
kind,
percentage,
state,
- time);
+ (time_t)time);
}