[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/4] qemu-img: avoid preprocessor directives in a pr
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 1/4] qemu-img: avoid preprocessor directives in a printf call |
Date: |
Thu, 4 Feb 2010 16:49:56 +0100 |
Other choices include using "(printf)", but this one is not bad in
terms of readability.
Signed-off-by: Paolo Bonzini <address@hidden>
---
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
- [Qemu-devel] Re: "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c, (continued)
- [Qemu-devel] Re: "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c, Paolo Bonzini, 2010/02/04
- Re: [Qemu-devel] "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c, Jamie Lokier, 2010/02/04
- [Qemu-devel] Re: "Enable _FORTIFY_SOURCE=2" result in building failure for qemu-img.c, Juan Quintela, 2010/02/04
- [Qemu-devel] [PATCH] qemu-img: avoid preprocessor directives in a printf call, Paolo Bonzini, 2010/02/04
- [Qemu-devel] Re: [PATCH] qemu-img: avoid preprocessor directives in a printf call, Sheng Yang, 2010/02/04
- [Qemu-devel] [PATCH 0/4] Fix printf calls embedding preprocessor directives, Paolo Bonzini, 2010/02/04
- [Qemu-devel] Re: [PATCH 0/4] Fix printf calls embedding preprocessor directives, Sheng Yang, 2010/02/04
- Re: [Qemu-devel] Re: [PATCH 0/4] Fix printf calls embedding preprocessor directives, Kevin Wolf, 2010/02/05
- [Qemu-devel] Re: [PATCH 0/4] Fix printf calls embedding preprocessor directives, Paolo Bonzini, 2010/02/05
- [Qemu-devel] [PATCH 1/4] qemu-img: avoid preprocessor directives in a printf call,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 2/4] cope with printf macro definition in readline.c, Paolo Bonzini, 2010/02/04
- [Qemu-devel] [PATCH 3/4] do not interpolate % from vl.c to qemu-options.h, Paolo Bonzini, 2010/02/04
- [Qemu-devel] [PATCH 4/4] vl.c: avoid preprocessor directives in a printf call, Paolo Bonzini, 2010/02/04