[PATCH 12/17] VIR_REQUIRE_FLAG_(GOTO|RET): Add parens around arguments in expansion

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

 



Make the macro useful also for cases when one of multiple flags is
required.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/internal.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/internal.h b/src/internal.h
index 2e404cd705..b6e4332542 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -374,7 +374,7 @@
  */
 #define VIR_REQUIRE_FLAG_RET(FLAG1, FLAG2, RET) \
     do { \
-        if ((flags & FLAG1) && !(flags & FLAG2)) { \
+        if ((flags & (FLAG1)) && !(flags & (FLAG2))) { \
             virReportInvalidArg(ctl, \
                                 _("Flag '%s' is required by flag '%s'"), \
                                 #FLAG2, #FLAG1); \
@@ -396,7 +396,7 @@
  */
 #define VIR_REQUIRE_FLAG_GOTO(FLAG1, FLAG2, LABEL) \
     do { \
-        if ((flags & FLAG1) && !(flags & FLAG2)) { \
+        if ((flags & (FLAG1)) && !(flags & (FLAG2))) { \
             virReportInvalidArg(ctl, \
                                 _("Flag '%s' is required by flag '%s'"), \
                                 #FLAG2, #FLAG1); \
-- 
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