openbsd-ports/audio/gtkpod/patches/patch-src_file_itunesdb_c

107 lines
4.3 KiB
Plaintext

$OpenBSD: patch-src_file_itunesdb_c,v 1.5 2009/03/06 20:44:24 ckuethe Exp $
--- src/file_itunesdb.c.orig Sat Jan 17 22:52:32 2009
+++ src/file_itunesdb.c Thu Feb 26 23:12:27 2009
@@ -585,7 +585,7 @@ iTunesDB *gp_import_itdb (iTunesDB *old_itdb, const gi
gp_itdb_add_extra_full (itdb);
eitdb = itdb->userdata;
- g_return_val_if_fail (eitdb, (release_widgets(), NULL));
+ g_return_val_if_fail (eitdb, (release_widgets(), (iTunesDB *)NULL));
eitdb->offline = offline;
@@ -610,9 +610,9 @@ iTunesDB *gp_import_itdb (iTunesDB *old_itdb, const gi
Track *track = gl->data;
ExtraTrackData *etr;
- g_return_val_if_fail (track, (release_widgets(), NULL));
+ g_return_val_if_fail (track, (release_widgets(), (iTunesDB *)NULL));
etr = track->userdata;
- g_return_val_if_fail (etr, (release_widgets(), NULL));
+ g_return_val_if_fail (etr, (release_widgets(), (iTunesDB *)NULL));
fill_in_extended_info (track, total, num);
gp_track_validate_entries (track);
/* properly set value for has_artwork */
@@ -652,7 +652,7 @@ iTunesDB *gp_import_itdb (iTunesDB *old_itdb, const gi
while (extendeddeletion)
{
Track *track = extendeddeletion->data;
- g_return_val_if_fail (track, (release_widgets(), NULL));
+ g_return_val_if_fail (track, (release_widgets(), (iTunesDB *)NULL));
mark_track_for_deletion (itdb, track);
extendeddeletion = g_list_delete_link (extendeddeletion,
extendeddeletion);
@@ -676,15 +676,15 @@ iTunesDB *gp_import_itdb (iTunesDB *old_itdb, const gi
GHashTable *track_hash = g_hash_table_new (g_direct_hash,
g_direct_equal);
Playlist *mpl = itdb_playlist_mpl (itdb);
- g_return_val_if_fail (mpl, (release_widgets(), NULL));
- g_return_val_if_fail (old_eitdb, (release_widgets(), NULL));
+ g_return_val_if_fail (mpl, (release_widgets(), (iTunesDB *)NULL));
+ g_return_val_if_fail (old_eitdb, (release_widgets(), (iTunesDB *)NULL));
/* add tracks from @old_itdb to new itdb */
for (gl=old_itdb->tracks; gl; gl=gl->next)
{
Track *duptr, *addtr;
Track *track = gl->data;
- g_return_val_if_fail (track, (release_widgets(), NULL));
+ g_return_val_if_fail (track, (release_widgets(), (iTunesDB *)NULL));
duptr = itdb_track_duplicate (track);
/* add to database -- if duplicate detection is on and the
same track already exists in the database, the already
@@ -703,15 +703,15 @@ iTunesDB *gp_import_itdb (iTunesDB *old_itdb, const gi
GList *glm;
Playlist *duppl;
Playlist *pl = gl->next->data; /* skip MPL */
- g_return_val_if_fail (pl, (release_widgets(), NULL));
+ g_return_val_if_fail (pl, (release_widgets(), (iTunesDB *)NULL));
duppl = itdb_playlist_duplicate (pl);
/* switch members */
for (glm=duppl->members; glm; glm=glm->next)
{
Track *newtr;
- g_return_val_if_fail (glm->data, (release_widgets(), NULL));
+ g_return_val_if_fail (glm->data, (release_widgets(), (iTunesDB *)NULL));
newtr = g_hash_table_lookup (track_hash, glm->data);
- g_return_val_if_fail (newtr, (release_widgets(), NULL));
+ g_return_val_if_fail (newtr, (release_widgets(), (iTunesDB *)NULL));
glm->data = newtr;
}
/* if it's the podcasts list, don't add the list again if
@@ -722,7 +722,7 @@ iTunesDB *gp_import_itdb (iTunesDB *old_itdb, const gi
Playlist *podcasts = itdb_playlist_podcasts (itdb);
for (glm=duppl->members; glm; glm=glm->next)
{
- g_return_val_if_fail (glm->data, (release_widgets(), NULL));
+ g_return_val_if_fail (glm->data, (release_widgets(), (iTunesDB *)NULL));
itdb_playlist_add_track (podcasts, glm->data, -1);
}
itdb_playlist_free (duppl);
@@ -801,9 +801,9 @@ static iTunesDB *gp_merge_itdb (iTunesDB *old_itdb)
ExtraiTunesDBData *old_eitdb;
iTunesDB *new_itdb;
- g_return_val_if_fail (old_itdb, NULL);
+ g_return_val_if_fail (old_itdb, (iTunesDB *)NULL);
old_eitdb = old_itdb->userdata;
- g_return_val_if_fail (old_eitdb, NULL);
+ g_return_val_if_fail (old_eitdb, (iTunesDB *)NULL);
if (old_itdb->usertype & GP_ITDB_TYPE_LOCAL)
{
@@ -905,8 +905,11 @@ iTunesDB *gp_load_ipod (iTunesDB *itdb)
ok_to_load = FALSE;
}
}
- g_free (itunesdb);
- g_free (mountpoint);
+ else
+ {
+ g_free (itunesdb);
+ g_free (mountpoint);
+ }
if (ok_to_load)
{