-
Notifications
You must be signed in to change notification settings - Fork 246
lib/, src/: Use streq() instead of its pattern #1142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
49434cb
to
a7d1437
Compare
a7d1437
to
2046029
Compare
2046029
to
eb9c40c
Compare
lgtm, just needs a rebase. |
eb9c40c
to
c19d559
Compare
Done. Thanks! (Although it seems I'm late. :) |
Queued after the release of 4.17.0. |
But it's draft? |
Oh, after release of 4.17.0 - i thought you meant after 4.17.0-rc1. |
If you want to apply some now (maybe the ones with semantic patch, which can be easily verified), please let me know and I'll un-draft. But yeah, I prefer to not add much stuff after the RC, so that we get some testing before the release. |
I'll re-open this one already, because it has a semantic patch for verification. Feel free to merge it or not. I'll leave the others for after the release. |
Oh no I"ve gone and done it again... (needs a rebase) |
That's fine. Thanks! :-) |
Except for the added (and sorted) includes, the removal of redundant parentheses, a few cases that have been refactored for readability, and a couple of non-string cases that I've left out of the change, this patch can be approximated with the following semantic patch: $ cat ~/tmp/spatch/streq.sp @@ expression s; @@ - '\0' == *s + streq(s, "") @@ expression s; @@ - '\0' == s[0] + streq(s, "") @@ expression s; @@ - *s == '\0' + streq(s, "") @@ expression s; @@ - s[0] == '\0' + streq(s, "") $ find contrib/ lib* src/ -type f \ | xargs spatch --in-place --sp-file ~/tmp/spatch/streq.sp; Signed-off-by: Alejandro Colomar <[email protected]>
Except for the added (and sorted) includes, the removal of redundant parentheses, and a few non-string cases that I've left out of the change, this patch can be approximated with the following semantic patch: $ cat ~/tmp/spatch/strneq.sp @@ expression s; @@ - '\0' != *s + !streq(s, "") @@ expression s; @@ - '\0' != s[0] + !streq(s, "") @@ expression s; @@ - *s != '\0' + !streq(s, "") @@ expression s; @@ - s[0] != '\0' + !streq(s, "") $ find contrib/ lib* src/ -type f \ | xargs spatch --in-place --sp-file ~/tmp/spatch/strneq.sp; Signed-off-by: Alejandro Colomar <[email protected]>
c19d559
to
fdbd965
Compare
Except for the added (and sorted) includes, the removal of redundant
parentheses, a few cases that have been refactored for readability, and
a couple of non-string cases that I've left out of the change, this
patch can be approximated with semantic patches (see commit messages).
Revisions:
v2
!streq()
).v3
v3b
v3c