openbsd-ports/devel/libmtp/patches/patch-examples_newplaylist_c
jasper 8756029f01 - update libmtp to 1.0.3
from LEVAI Daniel, with some tweaks by me
ok william@ (MAINTAINER)
2010-12-21 18:16:04 +00:00

35 lines
1.0 KiB
Plaintext

$OpenBSD: patch-examples_newplaylist_c,v 1.2 2010/12/21 18:16:04 jasper Exp $
Fix compilation with GCC2.
--- examples/newplaylist.c.orig Wed Oct 7 01:14:54 2009
+++ examples/newplaylist.c Tue Dec 21 14:05:23 2010
@@ -34,9 +34,11 @@ static void usage(void) {
int main (int argc, char **argv) {
int opt;
+ int ret;
extern int optind;
extern char *optarg;
LIBMTP_mtpdevice_t *device = NULL;
+ LIBMTP_playlist_t *playlist = NULL;
int idcount = 0;
uint32_t *ids = NULL;
uint32_t *tmp = NULL;
@@ -94,13 +96,13 @@ int main (int argc, char **argv) {
return 0;
}
- LIBMTP_playlist_t *playlist = LIBMTP_new_playlist_t();
+ playlist = LIBMTP_new_playlist_t();
playlist->name = playlistname;
playlist->no_tracks = idcount;
playlist->tracks = ids;
playlist->parent_id = parentid;
playlist->storage_id = storageid;
- int ret = LIBMTP_Create_New_Playlist(device,playlist);
+ ret = LIBMTP_Create_New_Playlist(device,playlist);
if (ret != 0) {
printf("Couldn't create playlist object\n");
LIBMTP_Dump_Errorstack(device);