[PATCH 6/9] Require a semicolon for VIR_ENUM_IMPL calls

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

 



Move the verify() statement to the end of the macro and drop
the semicolon, so the compiler will require callers to add a
semicolon.

Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx>
---
 src/util/virutil.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virutil.h b/src/util/virutil.h
index d5adab61e2..f8d8d85d27 100644
--- a/src/util/virutil.h
+++ b/src/util/virutil.h
@@ -82,7 +82,6 @@ const char *virEnumToString(const char *const*types,
 
 # define VIR_ENUM_IMPL(name, lastVal, ...) \
     static const char *const name ## TypeList[] = { __VA_ARGS__ }; \
-    verify(ARRAY_CARDINALITY(name ## TypeList) == lastVal); \
     const char *name ## TypeToString(int type) { \
         return virEnumToString(name ## TypeList, \
                                ARRAY_CARDINALITY(name ## TypeList), \
@@ -93,6 +92,7 @@ const char *virEnumToString(const char *const*types,
                                  ARRAY_CARDINALITY(name ## TypeList), \
                                  type); \
     } \
+    verify(ARRAY_CARDINALITY(name ## TypeList) == lastVal)
 
 # define VIR_ENUM_DECL(name) \
     const char *name ## TypeToString(int type); \
-- 
2.20.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[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