Commit 164713f0 authored by Christopher Koch's avatar Christopher Koch Committed by Tobias Klauser

unix: remove unnecessary use of unsafe.Pointer.

Change-Id: I7ae67ce410ae2816c2f3e8ecb26e46265aa11d7f
Reviewed-on: https://go-review.googlesource.com/73771Reviewed-by: 's avatarTobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent 3e3646d2
...@@ -926,7 +926,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from ...@@ -926,7 +926,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
msg.Namelen = uint32(SizeofSockaddrAny) msg.Namelen = uint32(SizeofSockaddrAny)
var iov Iovec var iov Iovec
if len(p) > 0 { if len(p) > 0 {
iov.Base = (*byte)(unsafe.Pointer(&p[0])) iov.Base = &p[0]
iov.SetLen(len(p)) iov.SetLen(len(p))
} }
var dummy byte var dummy byte
...@@ -941,7 +941,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from ...@@ -941,7 +941,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
iov.Base = &dummy iov.Base = &dummy
iov.SetLen(1) iov.SetLen(1)
} }
msg.Control = (*byte)(unsafe.Pointer(&oob[0])) msg.Control = &oob[0]
msg.SetControllen(len(oob)) msg.SetControllen(len(oob))
} }
msg.Iov = &iov msg.Iov = &iov
...@@ -974,11 +974,11 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) ...@@ -974,11 +974,11 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
} }
} }
var msg Msghdr var msg Msghdr
msg.Name = (*byte)(unsafe.Pointer(ptr)) msg.Name = (*byte)(ptr)
msg.Namelen = uint32(salen) msg.Namelen = uint32(salen)
var iov Iovec var iov Iovec
if len(p) > 0 { if len(p) > 0 {
iov.Base = (*byte)(unsafe.Pointer(&p[0])) iov.Base = &p[0]
iov.SetLen(len(p)) iov.SetLen(len(p))
} }
var dummy byte var dummy byte
...@@ -993,7 +993,7 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error) ...@@ -993,7 +993,7 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
iov.Base = &dummy iov.Base = &dummy
iov.SetLen(1) iov.SetLen(1)
} }
msg.Control = (*byte)(unsafe.Pointer(&oob[0])) msg.Control = &oob[0]
msg.SetControllen(len(oob)) msg.SetControllen(len(oob))
} }
msg.Iov = &iov msg.Iov = &iov
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment