From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U1gj2-0002Rv-2J for qemu-devel@nongnu.org; Sat, 02 Feb 2013 12:18:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U1giz-0006M5-Qn for qemu-devel@nongnu.org; Sat, 02 Feb 2013 12:17:59 -0500 From: Peter Maydell Date: Sat, 2 Feb 2013 17:17:54 +0000 Message-Id: <1359825474-26661-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] disas/i386.c: Add explicit braces round empty for-loop body List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-trivial@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , patches@linaro.org Add explicit braces round an empty for-loop body; this fits QEMU style and is easier to read than an inconspicuous semicolon at the end of the line. It also silences a clang warning: disas/i386.c:4723:49: warning: for loop has empty body [-Wempty-body] for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++); ^ disas/i386.c:4723:49: note: put the semicolon on a separate line to silence this warning [-Wempty-body] Signed-off-by: Peter Maydell --- This is the only clang warning on MacOSX apart from the ones about deprecated features in audio/coreaudio.c and ui/cocoa.m, which is why I think it's worth zapping despite it being a style issue in one of the bits of disassembler code we got from binutils and which aren't generally in QEMU style. checkpatch complains about the non-multiple-of-4 indent: WARNING: suspect code indent for conditional statements (10, 10) #27: FILE: disas/i386.c:4723: + for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++) { + } but I didn't see any value in reindenting the whole function just to shut it up. At some point in the 1.5 cycle maybe we could update the code to avoid the deprecated MacOS functions and then we could enable warnings-are-errors on MacOS too. disas/i386.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/disas/i386.c b/disas/i386.c index 3b006b1..dbecf1f 100644 --- a/disas/i386.c +++ b/disas/i386.c @@ -4720,7 +4720,8 @@ print_operand_value (char *buf, size_t bufsize, int hex, bfd_vma disp) buf[0] = '0'; buf[1] = 'x'; snprintf_vma (tmp, sizeof(tmp), disp); - for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++); + for (i = 0; tmp[i] == '0' && tmp[i + 1]; i++) { + } pstrcpy (buf + 2, bufsize - 2, tmp + i); } else -- 1.7.11.4