diff --git a/sys/unix/hints/macosx10.10-qt b/sys/unix/hints/macosx10.10-qt index 7391291bb..f63050543 100644 --- a/sys/unix/hints/macosx10.10-qt +++ b/sys/unix/hints/macosx10.10-qt @@ -114,6 +114,7 @@ endif # WANT_WIN_X11 ifdef WANT_WIN_QT CFLAGS += -DQT_GRAPHICS -DNOUSER_SOUNDS +CFLAGS += -Wno-deprecated-declarations CFLAGS += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --cflags) WINLIB += $(shell PKG_CONFIG_PATH=$(QTDIR)/lib/pkgconfig pkg-config Qt5Gui Qt5Widgets Qt5Multimedia --libs) LINK=$(CXX) diff --git a/win/Qt/qt_bind.cpp b/win/Qt/qt_bind.cpp index ca34f5135..3da7089e2 100644 --- a/win/Qt/qt_bind.cpp +++ b/win/Qt/qt_bind.cpp @@ -370,7 +370,7 @@ void NetHackQtBind::qt_display_file(const char *filename, BOOLEAN_P must_exist) } } -void NetHackQtBind::qt_start_menu(winid wid, unsigned long mbehavior) +void NetHackQtBind::qt_start_menu(winid wid, unsigned long mbehavior UNUSED) { NetHackQtWindow* window=id_to_window[(int)wid]; window->StartMenu(); @@ -427,7 +427,7 @@ void NetHackQtBind::qt_cliparound_window(winid wid, int x, int y) NetHackQtWindow* window=id_to_window[(int)wid]; window->ClipAround(x,y); } -void NetHackQtBind::qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph,int bkglyph) +void NetHackQtBind::qt_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph,int bkglyph UNUSED) { /* TODO: bkglyph */ NetHackQtWindow* window=id_to_window[(int)wid]; @@ -681,7 +681,7 @@ bool NetHackQtBind::notify(QObject *receiver, QEvent *event) bool macro=false; for (int i=0; !macro && key_macro[i].key; i++) { if (key_macro[i].key==k - && ((key_macro[i].state&key_event->modifiers())==key_macro[i].state)) + && ((key_macro[i].state&key_event->modifiers()) == (unsigned int) key_macro[i].state)) { keybuffer.Put(key_macro[i].macro); macro=true; @@ -720,9 +720,9 @@ QFrame* NetHackQtBind::splash=0; QStringList *NetHackQtBind::msgs_strings; boolean NetHackQtBind::msgs_saved = false; boolean NetHackQtBind::msgs_initd = false; - +#if 0 static void Qt_positionbar(char *) {} - +#endif } // namespace nethack_qt_ struct window_procs Qt_procs = { @@ -804,7 +804,11 @@ struct window_procs Qt_procs = { }; #ifndef WIN32 +#if defined(USER_SOUNDS) && !defined(QT_NO_SOUND) extern "C" void play_usersound(const char* filename, int volume) +#else +extern "C" void play_usersound(const char* filename UNUSED, int volume UNUSED) +#endif { #ifdef USER_SOUNDS #ifndef QT_NO_SOUND diff --git a/win/Qt/qt_delay.cpp b/win/Qt/qt_delay.cpp index 592bc23cb..e3dbfbe3d 100644 --- a/win/Qt/qt_delay.cpp +++ b/win/Qt/qt_delay.cpp @@ -34,7 +34,7 @@ void NetHackQtDelay::wait() m_loop.exec(); } -void NetHackQtDelay::timerEvent(QTimerEvent* timer) +void NetHackQtDelay::timerEvent(QTimerEvent* timer UNUSED) { m_loop.exit(); killTimer(m_timer); diff --git a/win/Qt/qt_line.cpp b/win/Qt/qt_line.cpp index 790d72a42..f7aab6bb9 100644 --- a/win/Qt/qt_line.cpp +++ b/win/Qt/qt_line.cpp @@ -30,7 +30,7 @@ NetHackQtLineEdit::NetHackQtLineEdit() : { } -NetHackQtLineEdit::NetHackQtLineEdit(QWidget* parent, const char* name) : +NetHackQtLineEdit::NetHackQtLineEdit(QWidget* parent, const char* name UNUSED) : QLineEdit(parent) { } diff --git a/win/Qt/qt_main.cpp b/win/Qt/qt_main.cpp index b86f85f31..a8beea886 100644 --- a/win/Qt/qt_main.cpp +++ b/win/Qt/qt_main.cpp @@ -379,7 +379,7 @@ static const char * rest_xpm[] = { " .... ", " "}; /* XPM */ -static const char * cast_a_xpm[] = { +static const char * cast_a_xpm[] UNUSED = { "12 13 3 1", " c None", ". c #FFFF6DB60000", @@ -398,7 +398,7 @@ static const char * cast_a_xpm[] = { " . X X ", " . X X "}; /* XPM */ -static const char * cast_b_xpm[] = { +static const char * cast_b_xpm[] UNUSED = { "12 13 3 1", " c None", ". c #FFFF6DB60000", @@ -417,7 +417,7 @@ static const char * cast_b_xpm[] = { " . X X ", " . XXX "}; /* XPM */ -static const char * cast_c_xpm[] = { +static const char * cast_c_xpm[] UNUSED = { "12 13 3 1", " c None", ". c #FFFF6DB60000", diff --git a/win/Qt/qt_map.cpp b/win/Qt/qt_map.cpp index d32ebfbf0..1ebb3434c 100644 --- a/win/Qt/qt_map.cpp +++ b/win/Qt/qt_map.cpp @@ -529,9 +529,9 @@ void NetHackQtMapViewport::CursorTo(int x,int y) Changed(cursor.x(),cursor.y()); } -void NetHackQtMapViewport::PrintGlyph(int x,int y,int glyph) +void NetHackQtMapViewport::PrintGlyph(int x,int y,int theglyph) { - Glyph(x,y)=glyph; + Glyph(x,y)=theglyph; Changed(x,y); } @@ -580,7 +580,7 @@ void NetHackQtMapWindow2::clearMessages() messages_rect = QRect(); } -void NetHackQtMapWindow2::putMessage(int attr, const QString& text) +void NetHackQtMapWindow2::putMessage(int attr UNUSED, const QString& text) { if ( !messages.isEmpty() ) messages += "\n"; @@ -617,7 +617,7 @@ void NetHackQtMapWindow2::CursorTo(int x,int y) m_viewport->CursorTo(x, y); } -void NetHackQtMapWindow2::PutStr(int attr, const QString& text) +void NetHackQtMapWindow2::PutStr(int attr UNUSED, const QString& text UNUSED) { puts("unexpected PutStr in MapWindow"); } diff --git a/win/Qt/qt_menu.cpp b/win/Qt/qt_menu.cpp index 76b1aa2b5..8ca4fde11 100644 --- a/win/Qt/qt_menu.cpp +++ b/win/Qt/qt_menu.cpp @@ -241,7 +241,7 @@ int NetHackQtMenuWindow::SelectMenu(int h, MENU_ITEM_P **menu_list) // Determine column widths std::vector col_widths; - for (std::size_t i = 0; i < itemlist.size(); ++i) { + for (std::size_t i = 0; i < (size_t) itemlist.size(); ++i) { QStringList columns = itemlist[i].str.split("\t"); if (!itemlist[i].Selectable() && columns.size() == 1) { @@ -249,7 +249,7 @@ int NetHackQtMenuWindow::SelectMenu(int h, MENU_ITEM_P **menu_list) // Assume this is a section header continue; } - for (std::size_t j = 0U; j < columns.size(); ++j) { + for (std::size_t j = 0U; j < (size_t) columns.size(); ++j) { int w = fm.width(columns[j] + " \t"); if (j >= col_widths.size()) { col_widths.push_back(w); @@ -260,12 +260,12 @@ int NetHackQtMenuWindow::SelectMenu(int h, MENU_ITEM_P **menu_list) } // Pad each column to its column width - for (std::size_t i = 0U; i < itemlist.size(); ++i) { + for (std::size_t i = 0U; i < (size_t) itemlist.size(); ++i) { QTableWidgetItem *twi = table->item(i, 4); if (twi == NULL) { continue; } QString text = twi->text(); QStringList columns = text.split("\t"); - for (std::size_t j = 0U; j+1U < columns.size(); ++j) { + for (std::size_t j = 0U; j+1U < (size_t) columns.size(); ++j) { columns[j] += "\t"; int width = col_widths[j]; while (fm.width(columns[j]) < width) { @@ -396,7 +396,7 @@ void NetHackQtMenuWindow::AddRow(int row, const MenuItem& mi) table->item(row, 4)->setFlags(Qt::ItemIsEnabled); WidenColumn(4, fm.width(text)); - if (mi.color != -1) { + if ((int) mi.color != -1) { twi->setForeground(colors[mi.color]); } @@ -497,7 +497,7 @@ void NetHackQtMenuWindow::keyPressEvent(QKeyEvent* event) InputCount(key); else { for (int i=0; isetFont(qt_settings->normalFixedFont()); @@ -752,7 +752,7 @@ void NetHackQtTextWindow::Display(bool block) exec(); } -void NetHackQtTextWindow::PutStr(int attr, const QString& text) +void NetHackQtTextWindow::PutStr(int attr UNUSED, const QString& text) { str_fixed=str_fixed || text.contains(" "); lines->addItem(text); diff --git a/win/Qt/qt_msg.cpp b/win/Qt/qt_msg.cpp index 9cf789d96..934a7be13 100644 --- a/win/Qt/qt_msg.cpp +++ b/win/Qt/qt_msg.cpp @@ -63,7 +63,7 @@ void NetHackQtMessageWindow::updateFont() map->setFont(qt_settings->normalFont()); } -void NetHackQtMessageWindow::Scroll(int dx, int dy) +void NetHackQtMessageWindow::Scroll(int dx UNUSED, int dy UNUSED) { //RLC Is this necessary? //RLC list->Scroll(dx,dy); @@ -81,7 +81,7 @@ void NetHackQtMessageWindow::ClearMessages() list->clear(); } -void NetHackQtMessageWindow::Display(bool block) +void NetHackQtMessageWindow::Display(bool block UNUSED) { if (changed) { list->repaint(); @@ -139,7 +139,7 @@ void NetHackQtMessageWindow::PutStr(int attr, const QString& text) #endif // ATR_BLINK not supported - if (list->count() >= ::iflags.msg_history) + if (list->count() >= (int) ::iflags.msg_history) delete list->item(0); list->addItem(text2); diff --git a/win/Qt/qt_plsel.cpp b/win/Qt/qt_plsel.cpp index 8598bbd81..2eefe96a8 100644 --- a/win/Qt/qt_plsel.cpp +++ b/win/Qt/qt_plsel.cpp @@ -44,7 +44,7 @@ static const char nh_attribution[] = "
NetHack %1" class NhPSListViewItem : public QTableWidgetItem { public: - NhPSListViewItem( QTableWidget* parent, const QString& name ) : + NhPSListViewItem( QTableWidget* parent UNUSED, const QString& name ) : QTableWidgetItem(name) { } @@ -140,7 +140,7 @@ public: } }; -NetHackQtPlayerSelector::NetHackQtPlayerSelector(NetHackQtKeyBuffer& ks) : +NetHackQtPlayerSelector::NetHackQtPlayerSelector(NetHackQtKeyBuffer& ks UNUSED) : QDialog(NetHackQtBind::mainWidget()), fully_specified_role(true) { @@ -184,8 +184,8 @@ NetHackQtPlayerSelector::NetHackQtPlayerSelector(NetHackQtKeyBuffer& ks) : QButtonGroup *gendergroup = new QButtonGroup(this); QGroupBox* alignbox = new QGroupBox("Alignment",this); QButtonGroup *aligngroup = new QButtonGroup(this); - QVBoxLayout* vbgb = new QVBoxLayout(genderbox); - QVBoxLayout* vbab = new QVBoxLayout(alignbox); + QVBoxLayout* vbgb UNUSED = new QVBoxLayout(genderbox); + QVBoxLayout* vbab UNUSED = new QVBoxLayout(alignbox); char versionbuf[QBUFSZ]; QLabel* logo = new QLabel(QString(nh_attribution).arg(version_string(versionbuf)), this); @@ -414,7 +414,7 @@ void NetHackQtPlayerSelector::selectRole(int crow, int ccol, int prow, int pcol) setupOthers(); } -void NetHackQtPlayerSelector::selectRace(int crow, int ccol, int prow, int pcol) +void NetHackQtPlayerSelector::selectRace(int crow UNUSED, int ccol UNUSED, int prow, int pcol UNUSED) { int ra = race->currentRow(); int ro = role->currentRow(); diff --git a/win/Qt/qt_rip.cpp b/win/Qt/qt_rip.cpp index c95089378..adcb04f9d 100644 --- a/win/Qt/qt_rip.cpp +++ b/win/Qt/qt_rip.cpp @@ -71,7 +71,7 @@ QSize NetHackQtRIP::sizeHint() const return pixmap->size(); } -void NetHackQtRIP::paintEvent(QPaintEvent* event) +void NetHackQtRIP::paintEvent(QPaintEvent* event UNUSED) { if ( riplines ) { int pix_x=(width()-pixmap->width())/2; diff --git a/win/Qt/qt_set.cpp b/win/Qt/qt_set.cpp index 8748f5159..d44365ab2 100644 --- a/win/Qt/qt_set.cpp +++ b/win/Qt/qt_set.cpp @@ -41,7 +41,7 @@ namespace nethack_qt_ { #define TILEWMIN 6 #define TILEHMIN 6 -NetHackQtSettings::NetHackQtSettings(int w, int h) : +NetHackQtSettings::NetHackQtSettings(int w UNUSED, int h UNUSED) : settings(), tilewidth(this), tileheight(this), @@ -151,7 +151,7 @@ void NetHackQtSettings::toggleGlyphSize() whichsize.toggle(); } -void NetHackQtSettings::setGlyphSize(bool which) +void NetHackQtSettings::setGlyphSize(bool which UNUSED) { QSize n = QSize(tilewidth.value(),tileheight.value()); if ( othersize.isValid() ) { diff --git a/win/Qt/qt_stat.cpp b/win/Qt/qt_stat.cpp index c6f4ab737..13cb4a773 100644 --- a/win/Qt/qt_stat.cpp +++ b/win/Qt/qt_stat.cpp @@ -211,14 +211,14 @@ QWidget* NetHackQtStatusWindow::Widget() { return this; } void NetHackQtStatusWindow::Clear() { } -void NetHackQtStatusWindow::Display(bool block) +void NetHackQtStatusWindow::Display(bool block UNUSED) { } void NetHackQtStatusWindow::CursorTo(int,int y) { cursy=y; } -void NetHackQtStatusWindow::PutStr(int attr, const QString& text) +void NetHackQtStatusWindow::PutStr(int attr UNUSED, const QString& text UNUSED) { // do a complete update when line 0 is done (as per X11 fancy status) if (cursy==0) updateStats(); diff --git a/win/Qt/qt_str.cpp b/win/Qt/qt_str.cpp index fc9cd26d7..9450bd895 100644 --- a/win/Qt/qt_str.cpp +++ b/win/Qt/qt_str.cpp @@ -35,7 +35,7 @@ QString str_titlecase(const QString& str) QString nh_capitalize_words(const QString& str) { QStringList words = str.split(" "); - for (size_t i = 0; i < words.size(); ++i) { + for (size_t i = 0; i < (size_t) words.size(); ++i) { words[i] = str_titlecase(words[i]); } return words.join(" "); diff --git a/win/Qt/qt_svsel.cpp b/win/Qt/qt_svsel.cpp index 2b429cb98..2a3aa5d8e 100644 --- a/win/Qt/qt_svsel.cpp +++ b/win/Qt/qt_svsel.cpp @@ -62,7 +62,7 @@ NetHackQtSavedGameSelector::NetHackQtSavedGameSelector(const char** saved) : QGroupBox* box = new QGroupBox("Saved Characters",this); QButtonGroup *bg = new QButtonGroup(this); vbl->addWidget(box); - QVBoxLayout *bgl = new QVBoxLayout(box); + QVBoxLayout *bgl UNUSED = new QVBoxLayout(box); connect(bg, SIGNAL(buttonPressed(int)), this, SLOT(done(int))); for (int i=0; saved[i]; i++) { QPushButton* b = new QPushButton(saved[i],box); diff --git a/win/Qt/qt_win.cpp b/win/Qt/qt_win.cpp index dbd756bf3..501e91b12 100644 --- a/win/Qt/qt_win.cpp +++ b/win/Qt/qt_win.cpp @@ -121,18 +121,18 @@ NetHackQtWindow::~NetHackQtWindow() // XXX Use "expected ..." for now, abort or default later. // void NetHackQtWindow::Clear() { puts("unexpected Clear"); } -void NetHackQtWindow::Display(bool block) { puts("unexpected Display"); } +void NetHackQtWindow::Display(bool block UNUSED) { puts("unexpected Display"); } bool NetHackQtWindow::Destroy() { return true; } -void NetHackQtWindow::CursorTo(int x,int y) { puts("unexpected CursorTo"); } -void NetHackQtWindow::PutStr(int attr, const QString& text) { puts("unexpected PutStr"); } +void NetHackQtWindow::CursorTo(int x UNUSED,int y UNUSED) { puts("unexpected CursorTo"); } +void NetHackQtWindow::PutStr(int attr UNUSED, const QString& text UNUSED) { puts("unexpected PutStr"); } void NetHackQtWindow::StartMenu() { puts("unexpected StartMenu"); } -void NetHackQtWindow::AddMenu(int glyph, const ANY_P* identifier, char ch, char gch, int attr, - const QString& str, unsigned itemflags) { puts("unexpected AddMenu"); } -void NetHackQtWindow::EndMenu(const QString& prompt) { puts("unexpected EndMenu"); } -int NetHackQtWindow::SelectMenu(int how, MENU_ITEM_P **menu_list) { puts("unexpected SelectMenu"); return 0; } -void NetHackQtWindow::ClipAround(int x,int y) { puts("unexpected ClipAround"); } -void NetHackQtWindow::PrintGlyph(int x,int y,int glyph) { puts("unexpected PrintGlyph"); } +void NetHackQtWindow::AddMenu(int glyph UNUSED, const ANY_P* identifier UNUSED, char ch UNUSED, char gch UNUSED, int attr UNUSED, + const QString& str UNUSED, unsigned itemflags UNUSED) { puts("unexpected AddMenu"); } +void NetHackQtWindow::EndMenu(const QString& prompt UNUSED) { puts("unexpected EndMenu"); } +int NetHackQtWindow::SelectMenu(int how UNUSED, MENU_ITEM_P **menu_list UNUSED) { puts("unexpected SelectMenu"); return 0; } +void NetHackQtWindow::ClipAround(int x UNUSED,int y UNUSED) { puts("unexpected ClipAround"); } +void NetHackQtWindow::PrintGlyph(int x UNUSED,int y UNUSED,int glyph UNUSED) { puts("unexpected PrintGlyph"); } //void NetHackQtWindow::PrintGlyphCompose(int x,int y,int,int) { puts("unexpected PrintGlyphCompose"); } -void NetHackQtWindow::UseRIP(int how, time_t when) { puts("unexpected UseRIP"); } +void NetHackQtWindow::UseRIP(int how UNUSED, time_t when UNUSED) { puts("unexpected UseRIP"); } } // namespace nethack_qt_ diff --git a/win/Qt/qt_yndlg.cpp b/win/Qt/qt_yndlg.cpp index 55d31e67b..8e49cd673 100644 --- a/win/Qt/qt_yndlg.cpp +++ b/win/Qt/qt_yndlg.cpp @@ -184,7 +184,7 @@ char NetHackQtYnDialog::Exec() show(); char choice=0; char ch_esc=0; - for (uint i=0; i