Except for the added (and sorted) includes, and the removal of redundant parentheses, this patch can be approximated with the following semantic patch:
$ cat ~/tmp/spatch/streq.sp;
@@
expression a, b;
@@
- strcmp(a, b) == 0
+ streq(a, b)
@@
expression a, b;
@@
- 0 == strcmp(a, b)
+ streq(a, b)
@@
expression a, b;
@@
- !strcmp(a, b)
+ streq(a, b)
$ find contrib/ lib* src/ -type f \
| xargs spatch --sp-file ~/tmp/spatch/streq.sp --in-place;
$ git restore lib/string/strcmp/streq.h;
Revisions:
v2
- Use `!streq()` instead of its pattern.
```
$ git range-diff shadow/master gh/streq streq
1: 10fea159 = 1: 10fea159 contrib/, lib/, src/: Use streq() instead of its pattern
-: -------- > 2: 985ac5e5 lib/, src/: Use !streq() instead of its pattern
```
Except for the added (and sorted) includes, and the removal of redundant parentheses, this patch can be approximated with the following semantic patch:
Revisions:
v2
- Use `!streq()` instead of its pattern. ``` $ git range-diff shadow/master gh/streq streq 1: 10fea159 = 1: 10fea159 contrib/, lib/, src/: Use streq() instead of its pattern -: -------- > 2: 985ac5e5 lib/, src/: Use !streq() instead of its pattern ```