[PATCH] fix compiler warnings and other nits
Artem Kachitchkine
Artem.Kachitchkin at Sun.COM
Tue Aug 8 21:02:54 PDT 2006
Minor changes that make it easier to cleanly compile on non-gcc compilers.
thanks,
-Artem.
-------------- next part --------------
diff --git a/Makefile.am b/Makefile.am
diff --git a/hald/device_info.c b/hald/device_info.c
index 17751d3..478c94a 100644
--- a/hald/device_info.c
+++ b/hald/device_info.c
@@ -1453,8 +1453,12 @@ out:
-static int
+static int
+#ifdef __GLIBC__
my_alphasort(const void *a, const void *b)
+#else
+my_alphasort(const struct dirent **a, const struct dirent **b)
+#endif
{
return -alphasort (a, b);
}
diff --git a/hald/device_store.c b/hald/device_store.c
index 96ca58f..d11cf6e 100644
--- a/hald/device_store.c
+++ b/hald/device_store.c
@@ -203,10 +203,10 @@ hal_device_store_remove (HalDeviceStore
store->devices = g_slist_remove (store->devices, device);
g_signal_handlers_disconnect_by_func (device,
- emit_device_property_changed,
+ (gpointer)emit_device_property_changed,
store);
g_signal_handlers_disconnect_by_func (device,
- emit_device_capability_added,
+ (gpointer)emit_device_capability_added,
store);
g_signal_emit (store, signals[STORE_CHANGED], 0, device, FALSE);
diff --git a/hald/logger.c b/hald/logger.c
index 2dc1cc4..f3a5cde 100644
--- a/hald/logger.c
+++ b/hald/logger.c
@@ -33,7 +33,7 @@ #include <string.h>
#include <stdarg.h>
#include <time.h>
#include <sys/time.h>
-#include <sys/syslog.h>
+#include <syslog.h>
#include "logger.h"
diff --git a/libhal/libhal.c b/libhal/libhal.c
index b7eae2e..a7fbb2d 100644
--- a/libhal/libhal.c
+++ b/libhal/libhal.c
@@ -911,7 +911,7 @@ libhal_device_get_property_type (LibHalC
int type;
DBusError _error;
- LIBHAL_CHECK_LIBHALCONTEXT(ctx, LIBHAL_PROPERTY_TYPE_INVALID); // or return NULL?
+ LIBHAL_CHECK_LIBHALCONTEXT(ctx, LIBHAL_PROPERTY_TYPE_INVALID); /* or return NULL? */
message = dbus_message_new_method_call ("org.freedesktop.Hal", udi,
"org.freedesktop.Hal.Device",
@@ -3201,13 +3201,13 @@ libhal_string_array_length (char **str_a
dbus_bool_t
libhal_device_rescan (LibHalContext *ctx, const char *udi, DBusError *error)
{
- LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
-
DBusMessage *message;
DBusMessageIter reply_iter;
DBusMessage *reply;
dbus_bool_t result;
+ LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
+
message = dbus_message_new_method_call ("org.freedesktop.Hal", udi,
"org.freedesktop.Hal.Device",
"Rescan");
@@ -3260,13 +3260,13 @@ libhal_device_rescan (LibHalContext *ctx
dbus_bool_t
libhal_device_reprobe (LibHalContext *ctx, const char *udi, DBusError *error)
{
- LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
-
DBusMessage *message;
DBusMessageIter reply_iter;
DBusMessage *reply;
dbus_bool_t result;
+ LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
+
message = dbus_message_new_method_call ("org.freedesktop.Hal",
udi,
"org.freedesktop.Hal.Device",
@@ -3326,14 +3326,14 @@ dbus_bool_t libhal_device_emit_condition
const char *condition_details,
DBusError *error)
{
- LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
-
DBusMessage *message;
DBusMessageIter iter;
DBusMessageIter reply_iter;
DBusMessage *reply;
dbus_bool_t result;
+ LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
+
message = dbus_message_new_method_call ("org.freedesktop.Hal",
udi,
"org.freedesktop.Hal.Device",
@@ -3399,14 +3399,14 @@ libhal_device_claim_interface (LibHalCon
const char *introspection_xml,
DBusError *error)
{
- LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
-
DBusMessage *message;
DBusMessageIter iter;
DBusMessageIter reply_iter;
DBusMessage *reply;
dbus_bool_t result;
+ LIBHAL_CHECK_LIBHALCONTEXT(ctx, FALSE);
+
message = dbus_message_new_method_call ("org.freedesktop.Hal",
udi,
"org.freedesktop.Hal.Device",
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 888d03e..bcfbf59 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -20,7 +20,7 @@ INCLUDES = \
-DPACKAGE_LOCALSTATEDIR=\""$(localstatedir)"\" \
-DPACKAGE_SCRIPT_DIR=\""$(datadir)/hal/scripts"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
- -I$(top_srcdir) -I$(top_srcdir)/libhal \
+ -I$(top_srcdir) -I$(top_srcdir)/libhal -I$(top_srcdir)/libhal-storage \
@DBUS_CFLAGS@ @GLIB_CFLAGS@ @POLKIT_CFLAGS@
bin_PROGRAMS = \
diff --git a/tools/hal-device.c b/tools/hal-device.c
index 9bc57a6..a37d2d6 100644
--- a/tools/hal-device.c
+++ b/tools/hal-device.c
@@ -45,7 +45,7 @@ #define DBUS_API_SUBJECT_TO_CHANGE 1
#endif
#include <dbus/dbus.h>
-#include <libhal/libhal.h>
+#include <libhal.h>
typedef struct {
char *udi;
diff --git a/tools/hal-storage-eject.c b/tools/hal-storage-eject.c
index 6cb8ab4..516d078 100644
--- a/tools/hal-storage-eject.c
+++ b/tools/hal-storage-eject.c
@@ -34,8 +34,8 @@ #include <glib/gstdio.h>
#include <sys/types.h>
#include <unistd.h>
-#include <libhal/libhal.h>
-#include <libhal-storage/libhal-storage.h>
+#include <libhal.h>
+#include <libhal-storage.h>
#ifdef HAVE_POLKIT
#include <libpolkit.h>
#endif
diff --git a/tools/hal-storage-mount.c b/tools/hal-storage-mount.c
index 37d7d6b..3da83b8 100644
--- a/tools/hal-storage-mount.c
+++ b/tools/hal-storage-mount.c
@@ -49,8 +49,8 @@ #include <unistd.h>
#include <errno.h>
#include <syslog.h>
-#include <libhal/libhal.h>
-#include <libhal-storage/libhal-storage.h>
+#include <libhal.h>
+#include <libhal-storage.h>
#ifdef HAVE_POLKIT
#include <libpolkit.h>
#endif
diff --git a/tools/hal-storage-shared.h b/tools/hal-storage-shared.h
index 34b9f1e..f87d5d1 100644
--- a/tools/hal-storage-shared.h
+++ b/tools/hal-storage-shared.h
@@ -24,8 +24,8 @@
#ifndef HAL_STORAGE_SHARED_H
#define HAL_STORAGE_SHARED_H
-#include <libhal/libhal.h>
-#include <libhal-storage/libhal-storage.h>
+#include <libhal.h>
+#include <libhal-storage.h>
#ifdef HAVE_POLKIT
#include <libpolkit.h>
#endif
diff --git a/tools/hal-storage-unmount.c b/tools/hal-storage-unmount.c
index 112adc2..d1239f7 100644
--- a/tools/hal-storage-unmount.c
+++ b/tools/hal-storage-unmount.c
@@ -48,8 +48,8 @@ #endif
#include <sys/types.h>
#include <unistd.h>
-#include <libhal/libhal.h>
-#include <libhal-storage/libhal-storage.h>
+#include <libhal.h>
+#include <libhal-storage.h>
#ifdef HAVE_POLKIT
#include <libpolkit.h>
#endif
diff --git a/tools/hal_find_by_capability.c b/tools/hal_find_by_capability.c
index a4b95ef..20a7666 100644
--- a/tools/hal_find_by_capability.c
+++ b/tools/hal_find_by_capability.c
@@ -33,7 +33,7 @@ #include <string.h>
#include <unistd.h>
#include <getopt.h>
-#include <libhal/libhal.h>
+#include <libhal.h>
/** Print out program usage.
diff --git a/tools/hal_find_by_property.c b/tools/hal_find_by_property.c
index 8c25710..f9344fd 100644
--- a/tools/hal_find_by_property.c
+++ b/tools/hal_find_by_property.c
@@ -33,7 +33,7 @@ #include <string.h>
#include <unistd.h>
#include <getopt.h>
-#include <libhal/libhal.h>
+#include <libhal.h>
/** Print out program usage.
diff --git a/tools/hal_get_property.c b/tools/hal_get_property.c
index 6df4a16..c2ec717 100644
--- a/tools/hal_get_property.c
+++ b/tools/hal_get_property.c
@@ -33,7 +33,7 @@ #include <string.h>
#include <unistd.h>
#include <getopt.h>
-#include <libhal/libhal.h>
+#include <libhal.h>
/**
* @defgroup HalGetProperty Get HAL device property
diff --git a/tools/hal_set_property.c b/tools/hal_set_property.c
index 7bb6094..eaeb7fc 100644
--- a/tools/hal_set_property.c
+++ b/tools/hal_set_property.c
@@ -34,7 +34,7 @@ #include <string.h>
#include <unistd.h>
#include <getopt.h>
-#include "libhal/libhal.h"
+#include <libhal.h>
static LibHalContext *hal_ctx;
diff --git a/tools/lshal.c b/tools/lshal.c
index 799e973..71f4e96 100644
--- a/tools/lshal.c
+++ b/tools/lshal.c
@@ -38,7 +38,7 @@ #include <getopt.h>
#include <glib.h>
#include <dbus/dbus-glib-lowlevel.h>
#include <dbus/dbus-glib.h>
-#include <libhal/libhal.h>
+#include <libhal.h>
#ifdef __SUNPRO_C
#define __FUNCTION__ __func__
More information about the hal
mailing list