[libvirt] [PATCH 2/2] Prefer STREQ and STRNEQ

Ishmanpreet Khera khera.ishman at gmail.com
Wed Oct 7 17:32:03 UTC 2015


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 at gmail.com>
---
 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20151007/cf1b4d0b/attachment-0001.htm>


More information about the libvir-list mailing list