[PATCH 2/2] Prefer STREQ and STRNEQ

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

 



new syntax-check rule for !STREQ and !STRNEQ so that
we don't end up in the same situation again.

Signed-off-by: Ishmanpreet Kaur Khera <khera.ishman@xxxxxxxxx>
---
 cfg.mk | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/cfg.mk b/cfg.mk
index e436434..7343dfc 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -1011,6 +1011,18 @@ sc_prohibit_pthread_create:
     halt="avoid using 'pthread_create', use 'virThreadCreate' instead" \
       $(_sc_search_regexp)
 
+sc_prohibit_not_streq:
+       @prohibit='!STREQ'                \
+       exclude='exempt from syntax-check'        \
+       halt='Use STRNEQ instead of !STREQ'        \
+         $(_sc_search_regexp)
+
+sc_prohibit_not_strneq:
+       @prohibit='!STRNEQ'                \
+       exclude='exempt from syntax-check'        \
+       halt='Use STREQ instead of !STRNEQ'        \
+         $(_sc_search_regexp)
+
 # We don't use this feature of maint.mk.
 prev_version_file = /dev/null
 
@@ -1213,3 +1225,9 @@ exclude_file_name_regexp--sc_prohibit_sysconf_pagesize = \
 
 exclude_file_name_regexp--sc_prohibit_pthread_create = \
   ^(cfg\.mk|src/util/virthread\.c|tests/.*)$$
+
+exclude_file_name_regexp--sc_prohibit_not_streq = \
+  ^tests/.*\.[ch]$$
+
+exclude_file_name_regexp--sc_prohibit_not_strneq = \
+  ^tests/.*\.[ch]$$
--
1.9.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]