utils/macros.h: Add <ctype.h> and `foocmp' helper macros.
Both of these have been a nuisance for years. Do something about it.
The command
git grep -En '\<(is|to)[a-z]+\(|\<(str|mem)[a-z]*cmp\(' -- '*.[ch]'
finds code which it might be good to change.
The hairy Emacs command
(query-replace-regexp
"\\<\\(\\(str\\|mem\\)\\sw*cmp\\)(\\([^,]*\\), \\([^)]*\\)) \\(==\\|!=\\|<\\|<=\\|>\\|>=\\) 0"
'(replace-eval-replacement
. (concat (replace-quote (upcase (match-string 1)))
"(\\3, \\5, \\4)"))
nil
(if (and transient-mark-mode mark-active) (region-beginning))
(if (and transient-mark-mode mark-active) (region-end))
nil)
will convert easy cases of `foocmp' calls, but hard ones have to be done
by hand.
- [DBH] codec/baseconv.c
- [DBH] codec/bincode.c
- [DBH] codec/url.c
- [DBH] hash/crc-mktab.c
- [DBH] hash/unihash-mkstatic.c
- [DBH] sel/bres-adns.c
- [DBH] sel/ident.c
- [DBH] struct/dstr-putf.c
- [DBH] struct/sym.c
- [DBH] struct/t/assoc-test.c
- [DBH] struct/t/da-test.c
- [DBH] struct/t/dstr-putf-test.c
- [DBH] struct/t/sym-test.c
- [DBH] sys/t/fdpass-test.c
- [DBH] sys/t/mdup-test.c
- [DBH] test/testrig.c
- [DBH] trace/trace.c
- [DBH] trace/traceopt.c
- [DBH] utils/macros.3
- [DBH] utils/macros.h
- [DBH] utils/str.c
- [DBH] utils/versioncmp.c