[vitunes] [PATCH] Linux build warnings

  • From: Peter Polacik <polacik.p@xxxxxxxxx>
  • To: "ryan.flannery" <ryan.flannery@xxxxxxxxx>
  • Date: Sat, 19 Feb 2011 22:19:30 +0100

Hi,

I don't know if it is right this way, but I tried to fix warnings in
playlist.c file, that occur during build on Linux. I attach diff.

Hope it doesn't break anything :-D

-- Peter

P.S. About that github collaboration. I agree with that ;-)
diff -r dd36573ff1f5 playlist.c
--- a/playlist.c        Thu Feb 17 12:21:03 2011 -0500
+++ b/playlist.c        Sat Feb 19 22:12:05 2011 +0100
@@ -214,7 +214,7 @@
    /* create playlist and setup */
    playlist *p = playlist_new();
    p->filename = strdup(filename);
-   p->name     = strdup(basename(filename));
+   p->name     = strdup(basename((char *)filename));
    if (p->filename == NULL || p->name == NULL)
       err(1, "playlist_load: failed to allocate info for playlist '%s'", 
filename);
 
@@ -340,11 +340,11 @@
  *       1. each element of that array
  *       2. the array itself.
  */
-int
+unsigned int
 retrieve_playlist_filenames(const char *dirname, char ***fnames)
 {
    char   *glob_pattern;
-   int     fcount;
+   unsigned int     fcount;
    glob_t  files;
 
    /* build the search pattern */
diff -r dd36573ff1f5 playlist.h
--- a/playlist.h        Thu Feb 17 12:21:03 2011 -0500
+++ b/playlist.h        Sat Feb 19 22:12:05 2011 +0100
@@ -101,7 +101,7 @@
 playlist *playlist_filter(const playlist *p, bool m);
 
 /* retrieve all playlist files in a given directory and return number found */
-int retrieve_playlist_filenames(const char *dirname, char ***files);
+unsigned int retrieve_playlist_filenames(const char *dirname, char ***files);
 
 /* for modification and use of the playlist history */
 playlist_changeset *changeset_create(short t, size_t s, meta_info **f, int l);

Other related posts: