changeset 36772:0da6c7ff95d2

Revise code of listMgr() command PLAYLIST_ITEM_GET_POS. Use uintptr_t type return variable. Additionally, include stdint.h.
author ib
date Mon, 17 Feb 2014 00:39:09 +0000
parents a706bf2ed700
children 1d094f299aa0
files gui/dialog/playlist.c gui/interface.c gui/ui/actions.c gui/util/list.c
diffstat 4 files changed, 14 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/gui/dialog/playlist.c	Sun Feb 16 16:30:05 2014 +0000
+++ b/gui/dialog/playlist.c	Mon Feb 17 00:39:09 2014 +0000
@@ -21,6 +21,7 @@
 #include <string.h>
 #include <dirent.h>
 #include <unistd.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 
@@ -158,7 +159,7 @@
 	    if ( old )
 	     {
 	      listMgr( PLAYLIST_ITEM_SET_CURR,old );
-	      guiInfo.Track = (intptr_t) listMgr( PLAYLIST_ITEM_GET_POS,old );
+	      guiInfo.Track = (uintptr_t) listMgr( PLAYLIST_ITEM_GET_POS,old );
 	      item = NULL;
 	     }
 	   }
@@ -171,7 +172,7 @@
 	   }
 	 }
 	else if (isPlaylistStreamtype && !guiInfo.Playing) uiUnsetFile();
-	guiInfo.Tracks = (intptr_t) listMgr( PLAYLIST_ITEM_GET_POS,0 );
+	guiInfo.Tracks = (uintptr_t) listMgr( PLAYLIST_ITEM_GET_POS,0 );
 	free(curr.path);
 	free(curr.name);
        }
--- a/gui/interface.c	Sun Feb 16 16:30:05 2014 +0000
+++ b/gui/interface.c	Mon Feb 17 00:39:09 2014 +0000
@@ -17,6 +17,7 @@
  */
 
 #include <stdarg.h>
+#include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -209,7 +210,7 @@
 
     if (playlist && !filename) {
         uiSetFile(playlist->path, playlist->name, STREAMTYPE_FILE);
-        guiInfo.Tracks = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, 0);
+        guiInfo.Tracks = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, 0);
         guiInfo.Track  = 1;
         filename       = NULL; // don't start playing
     }
@@ -619,7 +620,7 @@
         switch (guiInfo.StreamType) {
         case STREAMTYPE_FILE:
         case STREAMTYPE_STREAM:
-            guiInfo.Tracks = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, 0);
+            guiInfo.Tracks = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, 0);
             break;
 
         case STREAMTYPE_CDDA:
@@ -812,7 +813,7 @@
         if (next) {
             uiSetFile(next->path, next->name, STREAMTYPE_FILE);
             guiInfo.NewPlay = GUI_FILE_NEW;
-            guiInfo.Track   = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
+            guiInfo.Track   = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
         } else {
             if (guiInfo.NewPlay == GUI_FILE_NEW)
                 break;
--- a/gui/ui/actions.c	Sun Feb 16 16:30:05 2014 +0000
+++ b/gui/ui/actions.c	Mon Feb 17 00:39:09 2014 +0000
@@ -21,6 +21,7 @@
  * @brief User interface actions
  */
 
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -745,7 +746,7 @@
         if (curr) {
             uiSetFile(curr->path, curr->name, STREAMTYPE_FILE);
             guiInfo.PlaylistNext = False;
-            guiInfo.Track = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, curr);
+            guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, curr);
             break;
         }
 
@@ -815,7 +816,7 @@
         if (prev) {
             uiSetFile(prev->path, prev->name, STREAMTYPE_FILE);
             guiInfo.PlaylistNext = !guiInfo.Playing;
-            guiInfo.Track = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, prev);
+            guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, prev);
             break;
         }
 
@@ -883,7 +884,7 @@
         if (next) {
             uiSetFile(next->path, next->name, STREAMTYPE_FILE);
             guiInfo.PlaylistNext = !guiInfo.Playing;
-            guiInfo.Track = (intptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
+            guiInfo.Track = (uintptr_t)listMgr(PLAYLIST_ITEM_GET_POS, next);
             break;
         }
 
--- a/gui/util/list.c	Sun Feb 16 16:30:05 2014 +0000
+++ b/gui/util/list.c	Mon Feb 17 00:39:09 2014 +0000
@@ -21,6 +21,7 @@
  * @brief List management
  */
 
+#include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
 
@@ -52,7 +53,7 @@
  */
 void *listMgr(int cmd, void *data)
 {
-    unsigned int pos;
+    uintptr_t pos;
     plItem *pdat  = (plItem *)data;
     urlItem *udat = (urlItem *)data;
 
@@ -127,7 +128,7 @@
         pos = 0;
 
         if (plList) {
-            unsigned int i = 0;
+            uintptr_t i  = 0;
             plItem *item   = plList;
 
             do {