hal: Branch 'master'

David Zeuthen david at kemper.freedesktop.org
Mon Sep 11 14:42:47 PDT 2006


 doc/api/tmpl/hal-unused.sgml       |   38 +++++++++++++++---------
 doc/api/tmpl/logger.sgml           |   16 ++++++++++
 doc/api/tmpl/util.sgml             |   26 ----------------
 hald/hald_dbus.c                   |    2 -
 hald/linux/addons/addon-hid-ups.c  |    6 +--
 hald/linux/probing/probe-storage.c |   57 -------------------------------------
 hald/linux/probing/probe-volume.c  |    4 --
 libhal-storage/libhal-storage.c    |    4 +-
 partutil/partutil.c                |    2 +
 9 files changed, 49 insertions(+), 106 deletions(-)

New commits:
diff-tree 64cc367c425c6af0b85b8b34bd31e2a56b119d98 (from 9f6191e4df2dedb666883dab897b9e970a5bd001)
Author: David Zeuthen <davidz at redhat.com>
Date:   Mon Sep 11 17:42:44 2006 -0400

    fix some compiler warnings

diff --git a/doc/api/tmpl/hal-unused.sgml b/doc/api/tmpl/hal-unused.sgml
index 4f9d772..fcd175b 100644
--- a/doc/api/tmpl/hal-unused.sgml
+++ b/doc/api/tmpl/hal-unused.sgml
@@ -286,6 +286,30 @@ logging
 main
 
 
+<!-- ##### SECTION ./tmpl/shared.sgml:Long_Description ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/shared.sgml:See_Also ##### -->
+<para>
+
+</para>
+
+
+<!-- ##### SECTION ./tmpl/shared.sgml:Short_Description ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/shared.sgml:Stability_Level ##### -->
+
+
+
+<!-- ##### SECTION ./tmpl/shared.sgml:Title ##### -->
+shared
+
+
 <!-- ##### SECTION ./tmpl/sysfs.sgml:Long_Description ##### -->
 <para>
 
@@ -1537,14 +1561,6 @@ sysfs
 @volume: 
 @Returns: 
 
-<!-- ##### FUNCTION logger_forward_debug ##### -->
-<para>
-
-</para>
-
- at format: 
- at Varargs: 
-
 <!-- ##### FUNCTION lstat ##### -->
 <para>
 
@@ -1607,12 +1623,6 @@ sysfs
 @namespace: 
 @Returns: 
 
-<!-- ##### FUNCTION setup_logger ##### -->
-<para>
-
-</para>
-
-
 <!-- ##### FUNCTION visit_class_device_block ##### -->
 <para>
 
diff --git a/doc/api/tmpl/logger.sgml b/doc/api/tmpl/logger.sgml
index 2878b23..ee46b8c 100644
--- a/doc/api/tmpl/logger.sgml
+++ b/doc/api/tmpl/logger.sgml
@@ -37,6 +37,15 @@ logger
 @Varargs: 
 
 
+<!-- ##### FUNCTION logger_forward_debug ##### -->
+<para>
+
+</para>
+
+ at format: 
+ at Varargs: 
+
+
 <!-- ##### FUNCTION logger_enable ##### -->
 <para>
 
@@ -65,6 +74,13 @@ logger
 
 
 
+<!-- ##### FUNCTION setup_logger ##### -->
+<para>
+
+</para>
+
+
+
 <!-- ##### MACRO HAL_TRACE ##### -->
 <para>
 
diff --git a/doc/api/tmpl/util.sgml b/doc/api/tmpl/util.sgml
index d2e2321..a61ab35 100644
--- a/doc/api/tmpl/util.sgml
+++ b/doc/api/tmpl/util.sgml
@@ -38,32 +38,6 @@ util
 
 
 
-<!-- ##### FUNCTION util_compute_time_remaining ##### -->
-<para>
-
-</para>
-
- at id: 
- at chargeRate: 
- at chargeLevel: 
- at chargeLastFull: 
- at isDischarging: 
- at isCharging: 
- at guessChargeRate: 
- at Returns: 
-
-
-<!-- ##### FUNCTION util_compute_percentage_charge ##### -->
-<para>
-
-</para>
-
- at id: 
- at chargeLevel: 
- at chargeLastFull: 
- at Returns: 
-
-
 <!-- ##### FUNCTION hal_util_remove_trailing_slash ##### -->
 <para>
 
diff --git a/hald/hald_dbus.c b/hald/hald_dbus.c
index a367f72..b45cf29 100644
--- a/hald/hald_dbus.c
+++ b/hald/hald_dbus.c
@@ -2514,8 +2514,6 @@ addon_is_ready (DBusConnection * connect
 	DBusMessageIter iter;
 	DBusMessage *reply;
 	DBusError error;
-	const char *interface_name;
-	const char *introspection_xml;
 	dbus_bool_t res;
 	
 	HAL_TRACE (("entering"));
diff --git a/hald/linux/addons/addon-hid-ups.c b/hald/linux/addons/addon-hid-ups.c
index 698d893..31f3803 100644
--- a/hald/linux/addons/addon-hid-ups.c
+++ b/hald/linux/addons/addon-hid-ups.c
@@ -136,15 +136,15 @@ ups_get_static (LibHalContext *ctx, cons
 	DBusError error;
 	LibHalChangeSet *cs;
 
+	/* set to failure */
+	ret = FALSE;
+
 	cs = libhal_device_new_changeset (udi);
 	if (cs == NULL) {
 		HAL_ERROR (("Cannot initialize changeset"));
 		goto out;
 	}
 
-	/* set to failure */
-	ret = FALSE;
-
 	/* first check that we are an UPS */
 	if (!is_ups (fd))
 		goto out;
diff --git a/hald/linux/probing/probe-storage.c b/hald/linux/probing/probe-storage.c
index 9a6b860..544299c 100644
--- a/hald/linux/probing/probe-storage.c
+++ b/hald/linux/probing/probe-storage.c
@@ -96,62 +96,6 @@ out:
 	return rc;
 }
 
-#define BSIZE 0x200
-#define MSDOS_MAGIC			"\x55\xaa"
-#define MSDOS_SIG_OFF			0x01fe
-#define MSDOS_PARTTABLE_OFFSET		0x01be
-
-#define MAC_MAGIC                       "\x45\x52"
-#define MAC_SIG_OFF                     0x0000
-
-enum {
-	PART_TABLE_UNKNOWN,
-	PART_TABLE_MBR,
-	PART_TABLE_APM,
-	PART_TABLE_GPT
-};
-
-/* Detect partition table scheme */
-static int
-probe_for_part_scheme (LibHalChangeSet *changeset, int fd)
-{
-	int res;
-	const uint8_t buf[BSIZE];
-
-	res = PART_TABLE_UNKNOWN;
-
-	if (lseek(fd, 0, SEEK_SET) < 0) {
-		dbg("lseek failed (%s)", strerror(errno));
-		goto out;
-	}
-	if (read(fd, &buf, BSIZE) < BSIZE) {
-		dbg("read failed (%s)", strerror(errno));
-		goto out;
-	}
-
-	if (memcmp(&buf[MSDOS_SIG_OFF], MSDOS_MAGIC, 2) == 0) {
-		/* if the first partition have type 0xee, it's a GUID Partitioning Table */
-		if (buf[MSDOS_PARTTABLE_OFFSET + 4] == 0xee) {
-			dbg("foo1");
-			res = PART_TABLE_GPT;
-		} else {
-			dbg("foo2");
-			res = PART_TABLE_MBR;
-		}
-		goto out;
-	}
-
-	if (memcmp(&buf[MAC_SIG_OFF], MAC_MAGIC, 2) == 0) {
-		dbg("foo3");
-		res = PART_TABLE_APM;
-		goto out;
-	}
-
-
-out:
-	return res;
-}
-
 int 
 main (int argc, char *argv[])
 {
@@ -167,6 +111,7 @@ main (int argc, char *argv[])
 	dbus_bool_t only_check_for_fs;
 	LibHalChangeSet *cs;
 
+	cs = NULL;
 
 	fd = -1;
 
diff --git a/hald/linux/probing/probe-volume.c b/hald/linux/probing/probe-volume.c
index 3b6b00b..24e3a1b 100644
--- a/hald/linux/probing/probe-volume.c
+++ b/hald/linux/probing/probe-volume.c
@@ -607,8 +607,6 @@ main (int argc, char *argv[])
 		if (partition_number_str != NULL && 
 		    partition_number <= 256 && partition_number > 0 &&
 		    partition_start > 0) {
-			struct msdos_part_entry *idx;
-			int fd;
 			PartitionTable *p;
 
 			if ((stordev_dev_file = libhal_device_get_property_string (
@@ -652,7 +650,7 @@ main (int argc, char *argv[])
 					libhal_changeset_set_property_string (cs, "volume.partition.type", type);
 					libhal_changeset_set_property_string (cs, "volume.partition.label", label);
 					libhal_changeset_set_property_string (cs, "volume.partition.uuid", uuid);
-					libhal_changeset_set_property_strlist (cs, "volume.partition.flags", flags);
+					libhal_changeset_set_property_strlist (cs, "volume.partition.flags", (const char **) flags);
 					
 					/* NOTE: We trust the type from the partition table
 					 * if it explicitly got correct entries for RAID and
diff --git a/libhal-storage/libhal-storage.c b/libhal-storage/libhal-storage.c
index 7395229..2a5072e 100644
--- a/libhal-storage/libhal-storage.c
+++ b/libhal-storage/libhal-storage.c
@@ -844,7 +844,7 @@ libhal_volume_free (LibHalVolume *vol)
 	libhal_free_string (vol->partition_type);
 	libhal_free_string (vol->partition_label);
 	libhal_free_string (vol->partition_uuid);
-	libhal_free_string (vol->partition_flags);
+	libhal_free_string_array (vol->partition_flags);
 
 	free (vol);
 }
@@ -1626,7 +1626,7 @@ libhal_volume_get_partition_uuid (LibHal
 const char **
 libhal_volume_get_partition_flags (LibHalVolume *volume)
 {
-	return volume->partition_flags;
+	return (const char **) volume->partition_flags;
 }
 
 
diff --git a/partutil/partutil.c b/partutil/partutil.c
index beeaedb..5da36d5 100644
--- a/partutil/partutil.c
+++ b/partutil/partutil.c
@@ -225,6 +225,7 @@ get_le_guid (const guint8 *buf)
 			       guid->data4[7]);
 }
 
+#ifdef USE_PARTED
 static gboolean
 set_le_guid (guint8 *buf, const char *source)
 {
@@ -278,6 +279,7 @@ set_le_guid (guint8 *buf, const char *so
 out:
 	return ret;
 }
+#endif
 
 static PartitionEntry *
 part_entry_new (PartitionTable *e_part_table, const guint8 *data, int length, guint64 offset)


More information about the hal-commit mailing list