diff options
Diffstat (limited to 'src/linux/dkp-device-hid.c')
-rw-r--r-- | src/linux/dkp-device-hid.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/linux/dkp-device-hid.c b/src/linux/dkp-device-hid.c index 9a31481..9ecf08e 100644 --- a/src/linux/dkp-device-hid.c +++ b/src/linux/dkp-device-hid.c @@ -30,6 +30,7 @@ #include <glib.h> #include <glib/gstdio.h> +#include <glib/gprintf.h> #include <glib/gi18n-lib.h> #include <glib-object.h> #include <gudev/gudev.h> @@ -90,8 +91,6 @@ struct DkpDeviceHidPrivate int fd; }; -static void dkp_device_hid_class_init (DkpDeviceHidClass *klass); - G_DEFINE_TYPE (DkpDeviceHid, dkp_device_hid, DKP_TYPE_DEVICE) #define DKP_DEVICE_HID_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), DKP_TYPE_HID, DkpDeviceHidPrivate)) @@ -173,8 +172,8 @@ dkp_device_hid_convert_device_technology (const gchar *type) { if (type == NULL) return DKP_DEVICE_TECHNOLOGY_UNKNOWN; - if (strcasecmp (type, "pb") == 0 || - strcasecmp (type, "pbac") == 0) + if (g_ascii_strcasecmp (type, "pb") == 0 || + g_ascii_strcasecmp (type, "pbac") == 0) return DKP_DEVICE_TECHNOLOGY_LEAD_ACID; return DKP_DEVICE_TECHNOLOGY_UNKNOWN; } @@ -381,15 +380,15 @@ dkp_device_hid_refresh (DkpDevice *device) { gboolean set = FALSE; gboolean ret = FALSE; - GTimeVal time; + GTimeVal timeval; guint i; struct hiddev_event ev[64]; int rd; DkpDeviceHid *hid = DKP_DEVICE_HID (device); /* reset time */ - g_get_current_time (&time); - g_object_set (device, "update-time", (guint64) time.tv_sec, NULL); + g_get_current_time (&timeval); + g_object_set (device, "update-time", (guint64) timeval.tv_sec, NULL); /* read any data */ rd = read (hid->priv->fd, ev, sizeof (ev)); |