[libvirt PATCH 2/4] src: introduce VIR_UNLESS and VIR_ELSIF

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

 



Inspired by executable line noise, introduce more readable alternatives
to
    if (!(expr))
and
    else if

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/internal.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/internal.h b/src/internal.h
index 4cfb022b41..f8ca751014 100644
--- a/src/internal.h
+++ b/src/internal.h
@@ -548,3 +548,6 @@ enum {
 # define fprintf(fh, ...) g_fprintf(fh, __VA_ARGS__)
 
 #endif /* VIR_NO_GLIB_STDIO */
+
+#define VIR_UNLESS(e) if (!(e))
+#define VIR_ELSIF else if
-- 
2.34.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