summaryrefslogtreecommitdiff
path: root/tests/msg_name.c
diff options
context:
space:
mode:
authorDmitry V. Levin <ldv@altlinux.org>2017-03-16 13:46:36 +0000
committerDmitry V. Levin <ldv@altlinux.org>2017-03-16 13:46:36 +0000
commiteabace12c42399f03b8ae1a19df19ac6a1b0a4c0 (patch)
tree854d0be4ac07e1f432f25c83c250d68393a38b64 /tests/msg_name.c
parentc36875b1709a3ed3f21ef71a84ef5a7a936c8a8e (diff)
downloadstrace-eabace12c42399f03b8ae1a19df19ac6a1b0a4c0.tar.gz
tests: use TAIL_ALLOC_OBJECT_CONST_PTR
Automatically convert tests to use TAIL_ALLOC_OBJECT_CONST_PTR macro with the following sed expression: sed -ri \ 's/^([[:space:]]*)(([^*]+[[:alnum:]_])( \*)?) *\*( *const )?([^ =]+) = tail_alloc\(sizeof\((\2|\*\6)\)\);/\1TAIL_ALLOC_OBJECT_CONST_PTR(\2, \6);/' \ tests/*.c
Diffstat (limited to 'tests/msg_name.c')
-rw-r--r--tests/msg_name.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/msg_name.c b/tests/msg_name.c
index c2ddda2ac..e5038cca1 100644
--- a/tests/msg_name.c
+++ b/tests/msg_name.c
@@ -47,13 +47,13 @@ send_recv(const int send_fd, const int recv_fd,
static void
test_msg_name(const int send_fd, const int recv_fd)
{
- char *const recv_buf = tail_alloc(sizeof(*recv_buf));
- struct iovec *const iov = tail_alloc(sizeof(*iov));
+ TAIL_ALLOC_OBJECT_CONST_PTR(char, recv_buf);
+ TAIL_ALLOC_OBJECT_CONST_PTR(struct iovec, iov);
iov->iov_base = recv_buf;
iov->iov_len = sizeof(*recv_buf);
- struct sockaddr_un *const addr = tail_alloc(sizeof(*addr));
- struct msghdr *const msg = tail_alloc(sizeof(*msg));
+ TAIL_ALLOC_OBJECT_CONST_PTR(struct sockaddr_un, addr);
+ TAIL_ALLOC_OBJECT_CONST_PTR(struct msghdr, msg);
msg->msg_name = addr;
msg->msg_namelen = sizeof(*addr);
msg->msg_iov = iov;