mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-17 23:52:30 +00:00
Fixed compiler issues with gcc-4.6 c++0x.
This commit is contained in:
@@ -62,10 +62,10 @@ public:
|
||||
static void resize_term(int x, int y) { resizeterm(y, x); }
|
||||
static void resize_term(std::pair<int, int> dim) { resizeterm(dim.second, dim.first); }
|
||||
|
||||
unsigned int get_x() { int x, y; getyx(m_window, y, x); return x; }
|
||||
unsigned int get_x() { int x, __UNUSED y; getyx(m_window, y, x); return x; }
|
||||
unsigned int get_y() { int x, y; getyx(m_window, y, x); return y; }
|
||||
|
||||
unsigned int width() { int x, y; getmaxyx(m_window, y, x); return x; }
|
||||
unsigned int width() { int x, __UNUSED y; getmaxyx(m_window, y, x); return x; }
|
||||
unsigned int height() { int x, y; getmaxyx(m_window, y, x); return y; }
|
||||
|
||||
void move(unsigned int x, unsigned int y) { wmove(m_window, y, x); }
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
static void initialize();
|
||||
static void cleanup();
|
||||
|
||||
static int get_screen_width() { int x, y; getmaxyx(stdscr, y, x); return x; }
|
||||
static int get_screen_width() { int x, __UNUSED y; getmaxyx(stdscr, y, x); return x; }
|
||||
static int get_screen_height() { int x, y; getmaxyx(stdscr, y, x); return y; }
|
||||
|
||||
static std::pair<int, int> term_size();
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace display {
|
||||
Manager::Manager() :
|
||||
m_forceRedraw(false) {
|
||||
|
||||
m_taskUpdate.set_slot(rak::mem_fn(this, &Manager::receive_update));
|
||||
m_taskUpdate.set_slot(std::tr1::bind(&Manager::receive_update, this));
|
||||
}
|
||||
|
||||
Manager::~Manager() {
|
||||
|
||||
@@ -59,7 +59,7 @@ Window::Window(Canvas* canvas, int flags, extent_type minWidth, extent_type minH
|
||||
m_maxWidth(maxWidth),
|
||||
m_maxHeight(maxHeight) {
|
||||
|
||||
m_taskUpdate.set_slot(rak::mem_fn(this, &Window::redraw));
|
||||
m_taskUpdate.set_slot(std::tr1::bind(&Window::redraw, this));
|
||||
}
|
||||
|
||||
Window::~Window() {
|
||||
|
||||
@@ -93,16 +93,15 @@ WindowDownloadList::redraw() {
|
||||
|
||||
while (range.first != range.second) {
|
||||
char buffer[m_canvas->width() + 1];
|
||||
char* position;
|
||||
char* last = buffer + m_canvas->width() - 2 + 1;
|
||||
|
||||
position = print_download_title(buffer, last, *range.first);
|
||||
print_download_title(buffer, last, *range.first);
|
||||
m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
|
||||
|
||||
position = print_download_info(buffer, last, *range.first);
|
||||
print_download_info(buffer, last, *range.first);
|
||||
m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
|
||||
|
||||
position = print_download_status(buffer, last, *range.first);
|
||||
print_download_status(buffer, last, *range.first);
|
||||
m_canvas->print(0, pos++, "%c %s", range.first == m_view->focus() ? '*' : ' ', buffer);
|
||||
|
||||
++range.first;
|
||||
|
||||
@@ -63,33 +63,31 @@ WindowDownloadStatusbar::redraw() {
|
||||
m_canvas->erase();
|
||||
|
||||
char buffer[m_canvas->width()];
|
||||
char* position;
|
||||
char* last = buffer + m_canvas->width() - 2;
|
||||
|
||||
position = print_download_info(buffer, last, m_download);
|
||||
print_download_info(buffer, last, m_download);
|
||||
m_canvas->print(0, 0, "%s", buffer);
|
||||
|
||||
position = buffer + std::min<ptrdiff_t>(std::max(snprintf(buffer, last - buffer, "Peers: %i(%i) Min/Max: %i/%i Slots: U:%i/%i D:%i/%i U/I/C/A: %i/%i/%i/%i Unchoked: %u/%u Failed: %i",
|
||||
(int)m_download->download()->connection_list()->size(),
|
||||
(int)m_download->download()->peer_list()->available_list_size(),
|
||||
(int)m_download->download()->connection_list()->min_size(),
|
||||
(int)m_download->download()->connection_list()->max_size(),
|
||||
(int)m_download->download()->uploads_min(),
|
||||
(int)m_download->download()->uploads_max(),
|
||||
(int)m_download->download()->downloads_min(),
|
||||
(int)m_download->download()->downloads_max(),
|
||||
(int)m_download->download()->peers_currently_unchoked(),
|
||||
(int)m_download->download()->peers_currently_interested(),
|
||||
(int)m_download->download()->peers_complete(),
|
||||
(int)m_download->download()->peers_accounted(),
|
||||
(int)m_download->info()->upload_unchoked(),
|
||||
(int)m_download->info()->download_unchoked(),
|
||||
(int)m_download->chunks_failed()),
|
||||
0), last - buffer);
|
||||
snprintf(buffer, last - buffer, "Peers: %i(%i) Min/Max: %i/%i Slots: U:%i/%i D:%i/%i U/I/C/A: %i/%i/%i/%i Unchoked: %u/%u Failed: %i",
|
||||
(int)m_download->download()->connection_list()->size(),
|
||||
(int)m_download->download()->peer_list()->available_list_size(),
|
||||
(int)m_download->download()->connection_list()->min_size(),
|
||||
(int)m_download->download()->connection_list()->max_size(),
|
||||
(int)m_download->download()->uploads_min(),
|
||||
(int)m_download->download()->uploads_max(),
|
||||
(int)m_download->download()->downloads_min(),
|
||||
(int)m_download->download()->downloads_max(),
|
||||
(int)m_download->download()->peers_currently_unchoked(),
|
||||
(int)m_download->download()->peers_currently_interested(),
|
||||
(int)m_download->download()->peers_complete(),
|
||||
(int)m_download->download()->peers_accounted(),
|
||||
(int)m_download->info()->upload_unchoked(),
|
||||
(int)m_download->info()->download_unchoked(),
|
||||
(int)m_download->chunks_failed());
|
||||
|
||||
m_canvas->print(0, 1, "%s", buffer);
|
||||
|
||||
position = print_download_status(buffer, last, m_download);
|
||||
print_download_status(buffer, last, m_download);
|
||||
m_canvas->print(0, 2, "[%c:%i] %s",
|
||||
m_download->tracker_list()->has_active() ? 'C' : ' ',
|
||||
(int)(m_download->download()->tracker_controller()->seconds_to_next_timeout()),
|
||||
|
||||
@@ -48,7 +48,7 @@ WindowLog::WindowLog(core::Log* l) :
|
||||
Window(new Canvas, 0, 0, 0, extent_full, extent_static),
|
||||
m_log(l) {
|
||||
|
||||
m_taskUpdate.set_slot(rak::mem_fn(this, &WindowLog::receive_update)),
|
||||
m_taskUpdate.set_slot(std::tr1::bind(&WindowLog::receive_update, this)),
|
||||
|
||||
// We're trying out scheduled tasks instead.
|
||||
m_connUpdate = l->signal_update().connect(sigc::mem_fun(*this, &WindowLog::receive_update));
|
||||
|
||||
Reference in New Issue
Block a user