From: NeilBrown Date: Thu, 17 May 2012 07:26:13 +0000 (+1000) Subject: vpatch - use 'cols' in main window. X-Git-Tag: v1.0~110 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=5eb651029aed24bbe4e093ffb11b6a70c02b44e2;p=wiggle.git vpatch - use 'cols' in main window. We currently don't use 'cols' - which causes a warning because it is set by an assignment inside a macro.. The trick to quiet to warning causes different warnings on other compilers. We could just do rows = getmaxy() but that is 'legacy' so I'd rather not. So just find somewhere to use cols.. Reported-by: "P. Martin" Signed-off-by: NeilBrown --- diff --git a/vpatch.c b/vpatch.c index 93102bc..3a8d19a 100644 --- a/vpatch.c +++ b/vpatch.c @@ -2148,7 +2148,7 @@ static void main_window(struct plist *pl, int n, FILE *f, int reverse) if (refresh) { refresh = 0; getmaxyx(stdscr, rows, cols); - cols = cols; /* Silence warning that 'cols' isn't used */ + if (row >= rows + 3) row = (rows+1)/2; if (row >= rows) @@ -2178,7 +2178,7 @@ static void main_window(struct plist *pl, int n, FILE *f, int reverse) } {char bb[20]; sprintf(bb, "%d", c); - mvaddstr(0, 70, bb); + mvaddstr(0, cols-strlen(bb), bb); clrtoeol(); } move(row, 9);