Skip to contentSkip to conversation

Constants in command line definition

PATCH New Balazs Attila-Mihaly (Cd-MaN) 1 participant 1 message Jun 21, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Constants in command line definition

Hello, this is me again.

In the last time I forgot to specify that the patches are against the current CVS contents. This is a small patch which replaces the numeric values "1" in the "qemu_options" structure (which defines the command line format) with the constant HAS_ARG. I feel that this improves readibility of the code, since having both 1 and the constant HAS_ARG present implies that they have different meaning (0 doesn't need to be replaced with any symbolic name imho, since it is usually associated with "nothing" anyways).

Best regards,
Cd-MaN

___________________________________________________________
All New Yahoo! Mail – Tired of unwanted email come-ons? Let our SpamGuard protect you. http://uk.docs.yahoo.com/nowyoucan.html

Index: vl.c
===================================================================
RCS file: /sources/qemu/qemu/vl.c,v
retrieving revision 1.306

vl.c +4 -4
diff -u -r1.306 vl.c
@@ -6821,10 +6821,10 @@
 #endif
     { "localtime", 0, QEMU_OPTION_localtime },
     { "std-vga", 0, QEMU_OPTION_std_vga },
-    { "echr", 1, QEMU_OPTION_echr },
-    { "monitor", 1, QEMU_OPTION_monitor },
-    { "serial", 1, QEMU_OPTION_serial },
-    { "parallel", 1, QEMU_OPTION_parallel },
+    { "echr", HAS_ARG, QEMU_OPTION_echr },
+    { "monitor", HAS_ARG, QEMU_OPTION_monitor },
+    { "serial", HAS_ARG, QEMU_OPTION_serial },
+    { "parallel", HAS_ARG, QEMU_OPTION_parallel },
     { "loadvm", HAS_ARG, QEMU_OPTION_loadvm },
     { "full-screen", 0, QEMU_OPTION_full_screen },
 #ifdef CONFIG_SDL