From c71f07df6d77cccb42e715120f565f2374106d6f Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Fri, 12 Dec 2008 22:50:22 +0100 Subject: [PATCH] eliminate remained compiler warnings --- src/helpers.cpp | 2 +- src/menu.h | 2 +- src/mpdpp.cpp | 2 +- src/mpdpp.h | 6 +++--- src/ncmpcpp.cpp | 8 ++++---- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/helpers.cpp b/src/helpers.cpp index 0313ef5b..b625214b 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -475,7 +475,7 @@ string DisplayColumns(string st) if (result.length() > where) result = result.substr(0, where); else - for (int i = result.length(); i <= where && i < COLS; i++, result += ' ') { } + for (size_t i = result.length(); i <= where && i < size_t(COLS); i++, result += ' ') { } } return result; } diff --git a/src/menu.h b/src/menu.h index 2c1093c1..f2175de3 100644 --- a/src/menu.h +++ b/src/menu.h @@ -265,7 +265,7 @@ template void Menu::Refresh() return; } int MaxBeginning = itsOptions.size() < itsHeight ? 0 : itsOptions.size()-itsHeight; - if (itsHighlight > itsBeginning+itsHeight-1) + if (itsHighlight > itsBeginning+int(itsHeight)-1) itsBeginning = itsHighlight-itsHeight+1; if (itsBeginning < 0) itsBeginning = 0; diff --git a/src/mpdpp.cpp b/src/mpdpp.cpp index 5fc02b27..e2f272e6 100644 --- a/src/mpdpp.cpp +++ b/src/mpdpp.cpp @@ -853,7 +853,7 @@ int Connection::CheckForErrors() { // this is to avoid setting too small max size as we check it before fetching current status // setting real max playlist length is in UpdateStatus() - if (itsConnection->errorCode == MPD_ACK_ERROR_PLAYLIST_MAX && itsMaxPlaylistLength == -1) + if (itsConnection->errorCode == MPD_ACK_ERROR_PLAYLIST_MAX && itsMaxPlaylistLength == size_t(-1)) itsMaxPlaylistLength = 0; if (itsErrorHandler) diff --git a/src/mpdpp.h b/src/mpdpp.h index 3bd570e6..ff5b412e 100644 --- a/src/mpdpp.h +++ b/src/mpdpp.h @@ -123,8 +123,8 @@ namespace MPD long long GetOldPlaylistID() const { return isConnected && itsOldStatus ? itsOldStatus->playlist : -1; } int GetElapsedTime() const { return isConnected && itsCurrentStatus ? itsCurrentStatus->elapsedTime : -1; } - unsigned int GetMaxPlaylistLength() const { return itsMaxPlaylistLength; } - int GetPlaylistLength() const { return isConnected && itsCurrentStatus ? itsCurrentStatus->playlistLength : 0; } + size_t GetMaxPlaylistLength() const { return itsMaxPlaylistLength; } + size_t GetPlaylistLength() const { return isConnected && itsCurrentStatus ? itsCurrentStatus->playlistLength : 0; } void GetPlaylistChanges(long long, SongList &) const; const std::string & GetErrorMessage() const { return itsErrorMessage; } @@ -185,7 +185,7 @@ namespace MPD std::string itsErrorMessage; int itsErrorCode; - unsigned int itsMaxPlaylistLength; + size_t itsMaxPlaylistLength; std::string itsHost; int itsPort; diff --git a/src/ncmpcpp.cpp b/src/ncmpcpp.cpp index 090b2c21..4ef87270 100644 --- a/src/ncmpcpp.cpp +++ b/src/ncmpcpp.cpp @@ -2114,7 +2114,7 @@ int main(int argc, char *argv[]) mPlaylist->GetSelected(list); for (vector::iterator it = list.begin(); it != list.end(); it++) - if (*it == now_playing && list.front() > 0) + if (*it == size_t(now_playing) && list.front() > 0) mPlaylist->BoldOption(now_playing, 0); vector origs(list); @@ -2217,7 +2217,7 @@ int main(int argc, char *argv[]) mPlaylist->GetSelected(list); for (vector::iterator it = list.begin(); it != list.end(); it++) - if (*it == now_playing && list.back() < mPlaylist->Size()-1) + if (*it == size_t(now_playing) && list.back() < mPlaylist->Size()-1) mPlaylist->BoldOption(now_playing, 0); vector origs(list); @@ -2244,7 +2244,7 @@ int main(int argc, char *argv[]) size_t from, to; from = to = mPlaylist->Choice(); // unbold now playing as if song changes during move, this won't be unbolded. - if (to == now_playing && to < mPlaylist->Size()-1) + if (to == size_t(now_playing) && to < mPlaylist->Size()-1) mPlaylist->BoldOption(now_playing, 0); while (Keypressed(input, Key.MvSongDown) && to < mPlaylist->Size()-1) { @@ -2938,7 +2938,7 @@ int main(int argc, char *argv[]) { for (size_t i = 0; i < mPlaylist->Size(); i++) { - if (!mPlaylist->isSelected(i) && i != now_playing) + if (!mPlaylist->isSelected(i) && i != size_t(now_playing)) Mpd->QueueDeleteSongId(mPlaylist->at(i).GetID()); } // if mpd deletes now playing song deletion will be sluggishly slow