From 44b16979cf2b9b8ce78c54f7d16edb42e077f12c Mon Sep 17 00:00:00 2001 From: nhmall Date: Wed, 3 Feb 2021 15:31:57 -0500 Subject: [PATCH] unused-but-set-variable warning in qt_main.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit ../win/Qt/qt_main.cpp: In member function ‘virtual void nethack_qt_::NetHackQtMainWindow::closeEvent(QCloseEvent*)’: ../win/Qt/qt_main.cpp:1377:9: warning: variable ‘ok’ set but not used [-Wunused-but-set-variable] 1377 | int ok = 0; | ^~ --- win/Qt/qt_main.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/win/Qt/qt_main.cpp b/win/Qt/qt_main.cpp index 6d692ea83..8be7669aa 100644 --- a/win/Qt/qt_main.cpp +++ b/win/Qt/qt_main.cpp @@ -1374,7 +1374,7 @@ void NetHackQtMainWindow::keyPressEvent(QKeyEvent* event) // game window's Close button has been activated void NetHackQtMainWindow::closeEvent(QCloseEvent *e UNUSED) { - int ok = 0; +// int ok = 0; if ( g.program_state.something_worth_saving ) { /* this used to offer "Save" and "Cancel" but cancel (ignoring the close attempt) won't work @@ -1389,7 +1389,7 @@ void NetHackQtMainWindow::closeEvent(QCloseEvent *e UNUSED) break; case 1: // quit -- bypass the prompting preformed by done2() - ok = 1; +// ok = 1; g.program_state.stopprint++; ::done(QUIT); /*NOTREACHED*/ @@ -1397,7 +1397,7 @@ void NetHackQtMainWindow::closeEvent(QCloseEvent *e UNUSED) } } else { /* nothing worth saving; just close/quit */ - ok = 1; +// ok = 1; } /* if !ok, we should try to continue, but we don't... */ u.uhp = -1; -- 2.50.1