From patchwork Sat Feb 2 17:17:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 14419 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 96B6D23F96 for ; Sat, 2 Feb 2013 17:17:59 +0000 (UTC) Received: from mail-vb0-f45.google.com (mail-vb0-f45.google.com [209.85.212.45]) by fiordland.canonical.com (Postfix) with ESMTP id 4DBDEA1811F for ; Sat, 2 Feb 2013 17:17:59 +0000 (UTC) Received: by mail-vb0-f45.google.com with SMTP id p1so3056266vbi.18 for ; Sat, 02 Feb 2013 09:17:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:from:to:cc:subject:date:message-id:x-mailer :x-gm-message-state; bh=FpjudlqM6GJmc2rmVf4ZVeeDDt+oHjTk1wDB/LB9qgQ=; b=SNze16EsYMLv1zJLg1FGlU7bNbHT5P+QT8e4hZ6BJBImIhrLOeb/gIK0edmJMt8fng KeXgwJ9r+Gs/oG32yL1eTXC/emi31o09I0+HBi5TkeY+Ir3ur79GseFLmR2oWy8Ybl9w A9DaCXcdYV5SZVVzDwM1c9v69Si36J+OCiVuV4SUUw61G+iNWo8uedyUBG7rBzipuFo/ WcE2aJRMcaYuZM4QdPP5xsFdwQ8eu6pQ1rRT0R+2+1bkqP8/n6yanXKVPlwMnIPVXoMT oAEgf7kccctEKvSiUCnNgFDlFH7wFgEIY2sRSdBHlN1MQomAQgSVAnl9/XeufdRFc/Id YniQ== X-Received: by 10.52.27.50 with SMTP id q18mr13333736vdg.20.1359825478732; Sat, 02 Feb 2013 09:17:58 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.58.252.8 with SMTP id zo8csp16581vec; Sat, 2 Feb 2013 09:17:58 -0800 (PST) X-Received: by 10.180.78.137 with SMTP id b9mr3098388wix.30.1359825477234; Sat, 02 Feb 2013 09:17:57 -0800 (PST) Received: from mnementh.archaic.org.uk (1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.1.0.0.b.8.0.1.0.0.2.ip6.arpa. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id by15si4052145wjb.97.2013.02.02.09.17.56 (version=TLSv1 cipher=RC4-SHA bits=128/128); Sat, 02 Feb 2013 09:17:57 -0800 (PST) Received-SPF: neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) client-ip=2001:8b0:1d0::1; Authentication-Results: mx.google.com; spf=neutral (google.com: 2001:8b0:1d0::1 is neither permitted nor denied by best guess record for domain of pm215@archaic.org.uk) smtp.mail=pm215@archaic.org.uk Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1U1giw-0006wS-Qz; Sat, 02 Feb 2013 17:17:54 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, qemu-trivial@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= Subject: [PATCH] disas/i386.c: Add explicit braces round empty for-loop body Date: Sat, 2 Feb 2013 17:17:54 +0000 Message-Id: <1359825474-26661-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 X-Gm-Message-State: ALoCoQmLlkZ9RDjHMIGjs0MFyV9TJJ5aMNdnQeLreAhuoX6km9qZAa9oUhMm50nW0MMZpX4ukH1U 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