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

@@ -298,7 +298,9 @@ draw_horizontal(boolean border)
#endif
int i, j, number_of_lines,
cap_and_hunger, exp_points, sho_score,
height, width, w, xtra, clen, x, y, t, ex, ey,
/* both height and width get their values set,
* but only width gets used in this function */
height UNUSED, width, w, xtra, clen, x, y, t, ex, ey,
condstart = 0, conddummy = 0;
#ifdef STATUS_HILITES
int coloridx = NO_COLOR, attrmask = 0;