diff options
author | Danny Kukawka <danny.kukawka@web.de> | 2011-08-23 16:37:20 +0200 |
---|---|---|
committer | Danny Kukawka <danny.kukawka@web.de> | 2011-08-23 16:37:20 +0200 |
commit | c648362a711b029847215ca228454b36a6572783 (patch) | |
tree | 8168965933c62451ad39a8d30925501bd5a2116b | |
parent | c0354cd507b2ba82089d0c785c864fd4b37295ed (diff) |
fix some compiler warnings
Fixed some compiler warnings (strict-aliasing etc.).
-rw-r--r-- | hald/ids.c | 3 | ||||
-rw-r--r-- | hald/linux/addons/addon-leds.c | 5 | ||||
-rw-r--r-- | hald/linux/probing/probe-ieee1394-unit.c | 2 | ||||
-rw-r--r-- | libhal/libhal.c | 5 |
4 files changed, 9 insertions, 6 deletions
@@ -184,8 +184,7 @@ ids_find_pci (int vendor_id, int product_id, * already */ if (*subsys_vendor_name == NULL && subsys_vendor_id != 0) { - if ((*((dbus_uint32_t *) line)) == - (*((dbus_uint32_t *) rep_svi))) { + if (memcmp (line, rep_vi, 4) == 0) { /* found it */ for (i = 4; i < line_len; i++) { if (!isspace (line[i])) diff --git a/hald/linux/addons/addon-leds.c b/hald/linux/addons/addon-leds.c index e3ab34ff..e9994889 100644 --- a/hald/linux/addons/addon-leds.c +++ b/hald/linux/addons/addon-leds.c @@ -61,16 +61,17 @@ get_leds_brightness (const char *udi) int brightness; f = NULL; + brightness = -1; if (!g_hash_table_lookup_extended (leds, udi, NULL, (gpointer) &sysfs_path)) { - return -1; + return brightness; } snprintf (path, sizeof (path), "%s/brightness", sysfs_path); if ((f = fopen (path, "rb")) == NULL) { HAL_WARNING(("Could not read brightness from '%s' for device '%s'", path, udi)); - return -1; + return brightness; } if (fgets (buf, sizeof (buf), f) == NULL) { diff --git a/hald/linux/probing/probe-ieee1394-unit.c b/hald/linux/probing/probe-ieee1394-unit.c index aaa92e24..2b53c30a 100644 --- a/hald/linux/probing/probe-ieee1394-unit.c +++ b/hald/linux/probing/probe-ieee1394-unit.c @@ -253,7 +253,7 @@ handle_request (int fd, struct fw_cdev_event_request *request) send_response (fd, request->handle, RCODE_COMPLETE, NULL, 0); - response = (void *) request->data; + response = u64_to_ptr(request->data); if (response->frame.cts != CTS_AVC) { HAL_ERROR (("not an fcp response")); return -1; diff --git a/libhal/libhal.c b/libhal/libhal.c index c9d9f746..d6ff01c0 100644 --- a/libhal/libhal.c +++ b/libhal/libhal.c @@ -339,11 +339,14 @@ static dbus_bool_t libhal_property_fill_value_from_variant (LibHalProperty *p, DBusMessageIter *var_iter) { DBusMessageIter iter_array; + int type; + + type = p->type; LIBHAL_CHECK_PARAM_VALID(p, "LibHalProperty *p", FALSE); LIBHAL_CHECK_PARAM_VALID(var_iter, "DBusMessageIter *var_iter", FALSE); - switch (p->type) { + switch (type) { case DBUS_TYPE_ARRAY: if (dbus_message_iter_get_element_type (var_iter) != DBUS_TYPE_STRING) return FALSE; |