some warnings with clang version 13.0.0-9

---------------------
win/curses/cursstat.c:

../win/curses/cursstat.c:301:9: warning: variable 'height' set but not used [-Wunused-but-set-variable]
        height, width, w, xtra, clen, x, y, t, ex, ey,
        ^
1 warning generated.

---------------------
win/Qt/qt_menu.cpp:

../win/Qt/qt_menu.cpp:1123:9: warning: variable 'h' set but not used [-Wunused-but-set-variable]
    int h=0;
        ^
1 warning generated.

---------------------
/win/Qt/qt_yndlg.cpp:

../win/Qt/qt_yndlg.cpp:170:6: warning: variable 'x' set but not used [-Wunused-but-set-variable]
        int x=margin, y=extra+margin;
            ^
../win/Qt/qt_yndlg.cpp:170:16: warning: variable 'y' set but not used [-Wunused-but-set-variable]
        int x=margin, y=extra+margin;
                      ^
2 warnings generated.

Commenting out the x and y references, then leads to the following additional warnings,
so comment those out too:

../win/Qt/qt_yndlg.cpp:167:12: warning: unused variable 'margin' [-Wunused-variable]
        const int margin=8;
                  ^
../win/Qt/qt_yndlg.cpp:168:12: warning: unused variable 'gutter' [-Wunused-variable]
        const int gutter=8;
                  ^
../win/Qt/qt_yndlg.cpp:169:12: warning: unused variable 'extra' [-Wunused-variable]
        const int extra=fontMetrics().height(); // Extra for group
                  ^
3 warnings generated.

---------------------
This commit is contained in:
nhmall
2022-01-31 15:11:05 -05:00
parent ac3c005615
commit ae11c6e25d
3 changed files with 13 additions and 5 deletions

View File

@@ -1120,14 +1120,16 @@ void NetHackQtTextWindow::Display(bool block UNUSED)
lines->setFont(qt_settings->normalFont());
}
int h=0;
/* int h=0; */
if (use_rip) {
h+=rip.height();
/* h+=rip.height(); */
(void) rip.height();
ok.hide();
search.hide();
rip.show();
} else {
h+=ok.height()*2 + 7;
/* h+=ok.height()*2 + 7; */
(void) ok.height();
ok.show();
search.show();
rip.hide();