BUILD: cli: clear a maybe-unused warning on some older compilers
authorWilly Tarreau <w@1wt.eu>
Sat, 20 Nov 2021 18:17:38 +0000 (19:17 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 20 Nov 2021 19:15:37 +0000 (20:15 +0100)
commit97b5d07a3e5a33552327bac2e4c9c6a0496f7b5e
tree3d941a5cff29156d2fd896df62eb0dc3bfbff20b
parentf897fc99bd3347a2dc8b04f5f8e7982f1c94e996
BUILD: cli: clear a maybe-unused  warning on some older compilers

The SHOW_TOT() and SHOW_AVG() macros used in cli_io_handler_show_activity()
produce a warning on gcc 4.7 on MIPS with threads disabled because the
compiler doesn't know that global.nbthread is necessarily non-null, hence
that at least one iteration is performed. Let's just change the loop for
a do {} while () that lets the compiler know it's always initialized. It
also has the tiny benefit of making the code shorter.
src/cli.c