cosider different size of size_t type on 32bits and 64bits arches

master
Andrzej Rybczak 17 years ago
parent 966510249b
commit 9faf3acf2f
  1. 2
      src/ncmpcpp.cpp
  2. 2
      src/window.cpp
  3. 6
      src/window.h

@ -1789,7 +1789,7 @@ int main(int argc, char *argv[])
size_t number = StrToLong(wFooter->GetString()); size_t number = StrToLong(wFooter->GetString());
UnlockStatusbar(); UnlockStatusbar();
if (number && Mpd->AddRandomSongs(number)) if (number && Mpd->AddRandomSongs(number))
ShowMessage("%lu random song%s added to playlist!", number, number == 1 ? "" : "s"); ShowMessage(SIZE_T_FORMAT " random song%s added to playlist!", number, number == 1 ? "" : "s");
} }
else if (myScreen == myBrowser) else if (myScreen == myBrowser)
{ {

@ -860,7 +860,7 @@ Window &Window::operator<<(const wstring &ws)
Window &Window::operator<<(size_t s) Window &Window::operator<<(size_t s)
{ {
wprintw(itsWindow, "%u", s); wprintw(itsWindow, SIZE_T_FORMAT, s);
return *this; return *this;
} }

@ -32,6 +32,12 @@
#include <vector> #include <vector>
#include <string> #include <string>
# if defined(__WORDSIZE) && __WORDSIZE == 64
# define SIZE_T_FORMAT "%lu"
#else
# define SIZE_T_FORMAT "%u"
#endif
#if defined(__GNUC__) && __GNUC__ >= 3 #if defined(__GNUC__) && __GNUC__ >= 3
# define GNUC_UNUSED __attribute__((unused)) # define GNUC_UNUSED __attribute__((unused))
# define GNUC_PRINTF(a, b) __attribute__((format(printf, a, b))) # define GNUC_PRINTF(a, b) __attribute__((format(printf, a, b)))

Loading…
Cancel
Save