Просмотр исходного кода

dselect: Mark ‘y’ variables as unused for getyx() and getmaxyx()

The ncurses library does not provide a way to only retrieve the ‘x’
variable, so we have to pass a dummy ‘y’ which we are not going to
use, for which the compiler emits a warning.
Guillem Jover лет назад: 15
Родитель
Сommit
9b2cc7aa31
4 измененных файлов с 8 добавлено и 5 удалено
  1. 3 1
      dselect/basecmds.cc
  2. 2 1
      dselect/baselist.cc
  3. 2 2
      dselect/main.cc
  4. 1 1
      dselect/pkgdisplay.cc

+ 3 - 1
dselect/basecmds.cc

@@ -159,7 +159,7 @@ void baselist::displayerror(const char* str) {
 
 
 void baselist::displayhelp(const struct helpmenuentry *helpmenu, int key) {
-  int maxx, maxy, i, y, x, nextkey;
+  int maxx, maxy, i, nextkey;
 
   getmaxyx(stdscr,maxy,maxx);
   wbkgdset(stdscr, ' ' | helpscreen_attr);
@@ -170,6 +170,8 @@ void baselist::displayhelp(const struct helpmenuentry *helpmenu, int key) {
     while (hme->key && hme->key != key)
       hme++;
     if (hme->key) {
+      int x, y DPKG_ATTR_UNUSED;
+
       attrset(helpscreen_attr);
       mvaddstr(1,0, gettext(hme->msg->text));
       attrset(title_attr);

+ 2 - 1
dselect/baselist.cc

@@ -332,7 +332,8 @@ void baselist::wordwrapinfo(int offset, const char *m) {
       waddnstr(infopad, m, l);
       waddch(infopad,'\n'); wrapping= 0;
     } else {
-      int x,y;
+      int x, y DPKG_ATTR_UNUSED;
+
       if (wrapping) {
         getyx(infopad, y,x);
         if (x+1 >= usemax) {

+ 2 - 2
dselect/main.cc

@@ -386,7 +386,7 @@ dme(int i, int so)
           gettext(me->option),
           gettext(me->menuent));
 
-  int y,x;
+  int x, y DPKG_ATTR_UNUSED;
   getmaxyx(stdscr,y,x);
 
   attrset(so ? A_REVERSE : A_NORMAL);
@@ -401,7 +401,7 @@ refreshmenu(void)
 
   curseson(); cbreak(); noecho(); nonl(); keypad(stdscr,TRUE);
 
-  int y,x;
+  int x, y DPKG_ATTR_UNUSED;
   getmaxyx(stdscr,y,x);
 
   clear();

+ 1 - 1
dselect/pkgdisplay.cc

@@ -190,7 +190,7 @@ void packagelist::setwidths() {
 }
 
 void packagelist::redrawtitle() {
-  int x,y;
+  int x, y DPKG_ATTR_UNUSED;
 
   if (title_height) {
     mywerase(titlewin);