[PATCH v2 2/8] virQEMUQAPISchemaTraverseEnum: Move helper variables into loop

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Move them closer to where they are actually used.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
Reviewed-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_qapi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/qemu/qemu_qapi.c b/src/qemu/qemu_qapi.c
index 36b184b226..165ecf1180 100644
--- a/src/qemu/qemu_qapi.c
+++ b/src/qemu/qemu_qapi.c
@@ -243,8 +243,6 @@ virQEMUQAPISchemaTraverseEnum(virJSONValue *cur,
 {
     const char *query = virQEMUQAPISchemaTraverseContextNextQuery(ctxt);
     virJSONValue *values;
-    virJSONValue *enumval;
-    const char *value;
     size_t i;

     if (query[0] != '^')
@@ -259,6 +257,9 @@ virQEMUQAPISchemaTraverseEnum(virJSONValue *cur,
         return -2;

     for (i = 0; i < virJSONValueArraySize(values); i++) {
+        virJSONValue *enumval;
+        const char *value;
+
         if (!(enumval = virJSONValueArrayGet(values, i)) ||
             !(value = virJSONValueGetString(enumval)))
             continue;
-- 
2.31.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux