1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 15:21:37 +03:00
systemd/coccinelle/iovec-make.cocci

30 lines
455 B
Plaintext
Raw Normal View History

@@
expression x, y, p, l;
@@
- x[y].iov_base = p;
- x[y].iov_len = l;
- y++;
+ x[y++] = IOVEC_MAKE(p, l);
@@
expression x, p, l;
@@
- x.iov_base = p;
- x.iov_len = l;
+ x = IOVEC_MAKE(p, l);
@@
expression x, p, l;
@@
- x->iov_base = p;
- x->iov_len = l;
+ *x = IOVEC_MAKE(p, l);
@@
expression s;
@@
- IOVEC_MAKE(s, strlen(s));
+ IOVEC_MAKE_STRING(s);
@@
expression x, y, z;
@@
- x = (struct iovec) { .iov_base = y, .iov_len = z };
+ x = IOVEC_MAKE(y, z);