projects
/
haproxy-2.5.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e9f4d67
)
DEV: coccinelle: Add rule to use `isttrim()` where possible
author
Tim Duesterhus
<tim@bastelstu.be>
Mon, 8 Nov 2021 08:05:00 +0000
(09:05 +0100)
committer
Willy Tarreau
<w@1wt.eu>
Mon, 8 Nov 2021 11:08:26 +0000
(12:08 +0100)
This replaces `if (i.len > e) i.len = e;` by `isttrim(i, e)`.
dev/coccinelle/ist.cocci
patch
|
blob
|
history
diff --git
a/dev/coccinelle/ist.cocci
b/dev/coccinelle/ist.cocci
index
5b6aa6b
..
7e9a6ac
100644
(file)
--- a/
dev/coccinelle/ist.cocci
+++ b/
dev/coccinelle/ist.cocci
@@
-46,6
+46,14
@@
struct ist i;
@@
struct ist i;
+expression e;
+@@
+
+- if (\(i.len\|istlen(i)\) > e) { i.len = e; }
++ i = isttrim(i, e);
+
+@@
+struct ist i;
@@
- i.ptr != NULL