From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nd3y3-0002FY-MC for qemu-devel@nongnu.org; Thu, 04 Feb 2010 10:50:07 -0500 Received: from [199.232.76.173] (port=38553 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nd3y3-0002FQ-8f for qemu-devel@nongnu.org; Thu, 04 Feb 2010 10:50:07 -0500 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nd3y1-000571-VN for qemu-devel@nongnu.org; Thu, 04 Feb 2010 10:50:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55742) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nd3y1-00056t-KK for qemu-devel@nongnu.org; Thu, 04 Feb 2010 10:50:05 -0500 From: Paolo Bonzini Date: Thu, 4 Feb 2010 16:49:56 +0100 Message-Id: <1265298599-4186-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <201002042313.45353.sheng@linux.intel.com> References: <201002042313.45353.sheng@linux.intel.com> Subject: [Qemu-devel] [PATCH 1/4] qemu-img: avoid preprocessor directives in a printf call List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, quintela@redhat.com, sheng@linux.intel.com Other choices include using "(printf)", but this one is not bad in terms of readability. Signed-off-by: Paolo Bonzini --- qemu-img.c | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index cbba4fc..eb5c0f0 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -58,7 +58,8 @@ static void format_print(void *opaque, const char *name) /* Please keep in synch with qemu-img.texi */ static void help(void) { - printf("qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 Fabrice Bellard\n" + const char *help_msg = + "qemu-img version " QEMU_VERSION ", Copyright (c) 2004-2008 Fabrice Bellard\n" "usage: qemu-img command [command options]\n" "QEMU disk image utility\n" "\n" @@ -91,9 +92,9 @@ static void help(void) " '-a' applies a snapshot (revert disk to saved state)\n" " '-c' creates a snapshot\n" " '-d' deletes a snapshot\n" - " '-l' lists all snapshots in the given image\n" - ); - printf("\nSupported formats:"); + " '-l' lists all snapshots in the given image\n"; + + printf("%s\nSupported formats:", help_msg); bdrv_iterate_format(format_print, NULL); printf("\n"); exit(1); -- 1.6.6