[vlc-commits] misc/interrupt: use designated initializers for struct iovec
Filip Roséen
git at videolan.org
Mon Jul 18 05:59:56 CEST 2016
vlc | branch: master | Filip Roséen <filip at videolabs.io> | Sun Jul 17 10:06:11 2016 +0200| [02cd3e04358437fa6f34493dd4aeb72007d734b7] | committer: Jean-Baptiste Kempf
misc/interrupt: use designated initializers for struct iovec
Given that POSIX does not guarantee the order (nor the number) of the
data-members within "struct iovec", we should either use designated
initializers, or direct member-access, to initialize struct iovec.{iov_base,
iov_len}.
As designated-initialiazers are used in other parts of src/misc/interrupt.c,
this patch does the same.
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=02cd3e04358437fa6f34493dd4aeb72007d734b7
---
src/misc/interrupt.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/misc/interrupt.c b/src/misc/interrupt.c
index eddaca6..1049963 100644
--- a/src/misc/interrupt.c
+++ b/src/misc/interrupt.c
@@ -514,7 +514,7 @@ ssize_t vlc_writev_i11e(int fd, const struct iovec *iov, int count)
*/
ssize_t vlc_read_i11e(int fd, void *buf, size_t count)
{
- struct iovec iov = { buf, count };
+ struct iovec iov = { .iov_base = buf, .iov_len = count };
return vlc_readv_i11e(fd, &iov, 1);
}
@@ -527,7 +527,7 @@ ssize_t vlc_read_i11e(int fd, void *buf, size_t count)
*/
ssize_t vlc_write_i11e(int fd, const void *buf, size_t count)
{
- struct iovec iov = { (void *)buf, count };
+ struct iovec iov = { .iov_base = (void*)buf, .iov_len = count };
return vlc_writev_i11e(fd, &iov, 1);
}
More information about the vlc-commits
mailing list