Patchwork Avoid issue with pp-directive in macro

login
register
mail settings
Submitter Bruce Rogers
Date Aug. 10, 2009, 5:30 p.m.
Message ID <4A8004D3020000480007E21F@lucius.provo.novell.com>
Download mbox | patch
Permalink /patch/31093/
State Superseded
Headers show

Comments

Bruce Rogers - Aug. 10, 2009, 5:30 p.m.
Is this any more palatable then?

Signed-off-by: Bruce Rogers <brogers@novell.com>
---
 qemu-img.c |   70 +++++++++++++++++++++++++++++++------------------------------
 vl.c       |   30 +++++++++++++-------------
 2 files changed, 52 insertions(+), 48 deletions(-)

Patch

diff --git a/qemu-img.c b/qemu-img.c
index 070fe2e..313b136 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -58,44 +58,46 @@  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"
-           "usage: qemu-img command [command options]\n"
-           "QEMU disk image utility\n"
-           "\n"
-           "Command syntax:\n"
+    static const char *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"
+        "Command syntax:\n"
 #define DEF(option, callback, arg_string)        \
-           "  " arg_string "\n"
+        "  " arg_string "\n"
 #include "qemu-img-cmds.h"
 #undef DEF
 #undef GEN_DOCS
-           "\n"
-           "Command parameters:\n"
-           "  'filename' is a disk image filename\n"
-           "  'base_image' is the read-only disk image which is used as base for a copy on\n"
-           "    write image; the copy on write image only stores the modified data\n"
-           "  'output_base_image' forces the output image to be created as a copy on write\n"
-           "    image of the specified base image; 'output_base_image' should have the same\n"
-           "    content as the input's base image, however the path, image format, etc may\n"
-           "    differ\n"
-           "  'fmt' is the disk image format. It is guessed automatically in most cases\n"
-           "  'size' is the disk image size in kilobytes. Optional suffixes\n"
-           "    'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * 1024 * 1024) are\n"
-           "    supported any 'k' or 'K' is ignored\n"
-           "  'output_filename' is the destination disk image filename\n"
-           "  'output_fmt' is the destination format\n"
-           "  'options' is a comma separated list of format specific options in a\n"
-           "    name=value format. Use -o ? for an overview of the options supported by the\n"
-           "    used format\n"
-           "  '-c' indicates that target image must be compressed (qcow format only)\n"
-           "  '-h' with or without a command shows this help and lists the supported formats\n"
-           "\n"
-           "Parameters to snapshot subcommand:\n"
-           "  'snapshot' is the name of the snapshot to create, apply or delete\n"
-           "  '-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"
-           );
+        "\n"
+        "Command parameters:\n"
+        "  'filename' is a disk image filename\n"
+        "  'base_image' is the read-only disk image which is used as base for a copy on\n"
+        "    write image; the copy on write image only stores the modified data\n"
+        "  'output_base_image' forces the output image to be created as a copy on write\n"
+        "    image of the specified base image; 'output_base_image' should have the same\n"
+        "    content as the input's base image, however the path, image format, etc may\n"
+        "    differ\n"
+        "  'fmt' is the disk image format. It is guessed automatically in most cases\n"
+        "  'size' is the disk image size in kilobytes. Optional suffixes\n"
+        "    'M' (megabyte, 1024 * 1024) and 'G' (gigabyte, 1024 * 1024 * 1024) are\n"
+        "    supported any 'k' or 'K' is ignored\n"
+        "  'output_filename' is the destination disk image filename\n"
+        "  'output_fmt' is the destination format\n"
+        "  'options' is a comma separated list of format specific options in a\n"
+        "    name=value format. Use -o ? for an overview of the options supported by the\n"
+        "    used format\n"
+        "  '-c' indicates that target image must be compressed (qcow format only)\n"
+        "  '-h' with or without a command shows this help and lists the supported formats\n"
+        "\n"
+        "Parameters to snapshot subcommand:\n"
+        "  'snapshot' is the name of the snapshot to create, apply or delete\n"
+        "  '-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(msg);
     printf("\nSupported formats:");
     bdrv_iterate_format(format_print, NULL);
     printf("\n");
diff --git a/vl.c b/vl.c
index a526cb0..b173274 100644
--- a/vl.c
+++ b/vl.c
@@ -4339,26 +4339,28 @@  static void version(void)
 
 static void help(int exitcode)
 {
-    version();
-    printf("usage: %s [options] [disk_image]\n"
-           "\n"
-           "'disk_image' is a raw hard image image for IDE hard disk 0\n"
-           "\n"
+    static const char *msg = 
+        "usage: %s [options] [disk_image]\n"
+        "\n"
+        "'disk_image' is a raw hard image image for IDE hard disk 0\n"
+        "\n"
 #define DEF(option, opt_arg, opt_enum, opt_help)        \
-           opt_help
+        opt_help
 #define DEFHEADING(text) stringify(text) "\n"
 #include "qemu-options.h"
 #undef DEF
 #undef DEFHEADING
 #undef GEN_DOCS
-           "\n"
-           "During emulation, the following keys are useful:\n"
-           "ctrl-alt-f      toggle full screen\n"
-           "ctrl-alt-n      switch to virtual console 'n'\n"
-           "ctrl-alt        toggle mouse and keyboard grab\n"
-           "\n"
-           "When using -nographic, press 'ctrl-a h' to get some help.\n"
-           ,
+        "\n"
+        "During emulation, the following keys are useful:\n"
+        "ctrl-alt-f      toggle full screen\n"
+        "ctrl-alt-n      switch to virtual console 'n'\n"
+        "ctrl-alt        toggle mouse and keyboard grab\n"
+        "\n"
+        "When using -nographic, press 'ctrl-a h' to get some help.\n";
+
+    version();
+    printf(msg,
            "qemu",
            DEFAULT_RAM_SIZE,
 #ifndef _WIN32