# HG changeset patch # User ib # Date 1392597549 0 # Node ID 0da6c7ff95d217c7e8a62e88cf80d27112d40ba4 # Parent a706bf2ed70069b64ec963ee502cb2e4f5162cd3 Revise code of listMgr() command PLAYLIST_ITEM_GET_POS. Use uintptr_t type return variable. Additionally, include stdint.h. diff -r a706bf2ed700 -r 0da6c7ff95d2 gui/dialog/playlist.c --- 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 #include #include +#include #include #include @@ -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); } diff -r a706bf2ed700 -r 0da6c7ff95d2 gui/interface.c --- 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 +#include #include #include #include @@ -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; diff -r a706bf2ed700 -r 0da6c7ff95d2 gui/ui/actions.c --- 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 #include #include @@ -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; } diff -r a706bf2ed700 -r 0da6c7ff95d2 gui/util/list.c --- 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 #include #include @@ -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 {