From 31a81628c4d7313782893ceee01bc3c77bfbaa84 Mon Sep 17 00:00:00 2001 From: Bradford Hovinen Date: Tue, 17 Jul 2001 19:08:55 +0000 Subject: strdup the string to remove compiler warnings 2001-07-17 Bradford Hovinen * archive.c (archive_unregister_location): (archive_get_location): strdup the string to remove compiler warnings --- archiver/ChangeLog | 3 +++ archiver/archive.c | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'archiver') diff --git a/archiver/ChangeLog b/archiver/ChangeLog index 655cd23ab..f661c7891 100644 --- a/archiver/ChangeLog +++ b/archiver/ChangeLog @@ -1,5 +1,8 @@ 2001-07-17 Bradford Hovinen + * archive.c (archive_unregister_location): + (archive_get_location): strdup the string to remove compiler warnings + * location.c (location_store): Use return value (location_store_full_snapshot): Use return value diff --git a/archiver/archive.c b/archiver/archive.c index 816ac856f..3a936d750 100644 --- a/archiver/archive.c +++ b/archiver/archive.c @@ -337,12 +337,16 @@ Location * archive_get_location (Archive *archive, const gchar *locid) { GtkObject *loc_obj; + gchar *tmp; g_return_val_if_fail (archive != NULL, NULL); g_return_val_if_fail (IS_ARCHIVE (archive), NULL); g_return_val_if_fail (locid != NULL, NULL); - loc_obj = g_tree_lookup (archive->locations, locid); + /* Stupid borken glib... */ + tmp = g_strdup (locid); + loc_obj = g_tree_lookup (archive->locations, tmp); + g_free (tmp); if (!loc_obj) { loc_obj = location_open (archive, locid); @@ -394,14 +398,18 @@ archive_register_location (Archive *archive, Location *location) void archive_unregister_location (Archive *archive, Location *location) { + gchar *tmp; + g_return_if_fail (archive != NULL); g_return_if_fail (IS_ARCHIVE (archive)); g_return_if_fail (location != NULL); g_return_if_fail (IS_LOCATION (location)); if (GTK_OBJECT_DESTROYED (archive)) return; - - g_tree_remove (archive->locations, location_get_id (location)); + + tmp = g_strdup (location_get_id (location)); + g_tree_remove (archive->locations, tmp); + g_free (tmp); } /** @@ -417,13 +425,11 @@ archive_unregister_location (Archive *archive, Location *location) Location * archive_get_current_location (Archive *archive) { - gchar *locid; + const gchar *locid = archive_get_current_location_id (archive); g_return_val_if_fail (archive != NULL, NULL); g_return_val_if_fail (IS_ARCHIVE (archive), NULL); - locid = archive_get_current_location_id (archive); - if (locid == NULL) return NULL; else -- cgit v1.2.1