зеркало из https://github.com/golang/sys.git
unix: remove unnecessary use of unsafe.Pointer.
Change-Id: I7ae67ce410ae2816c2f3e8ecb26e46265aa11d7f Reviewed-on: https://go-review.googlesource.com/73771 Reviewed-by: Tobias Klauser <tobias.klauser@gmail.com> Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Родитель
3e3646d2c7
Коммит
164713f0df
|
@ -926,7 +926,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
|
|||
msg.Namelen = uint32(SizeofSockaddrAny)
|
||||
var iov Iovec
|
||||
if len(p) > 0 {
|
||||
iov.Base = (*byte)(unsafe.Pointer(&p[0]))
|
||||
iov.Base = &p[0]
|
||||
iov.SetLen(len(p))
|
||||
}
|
||||
var dummy byte
|
||||
|
@ -941,7 +941,7 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
|
|||
iov.Base = &dummy
|
||||
iov.SetLen(1)
|
||||
}
|
||||
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
|
||||
msg.Control = &oob[0]
|
||||
msg.SetControllen(len(oob))
|
||||
}
|
||||
msg.Iov = &iov
|
||||
|
@ -974,11 +974,11 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
|
|||
}
|
||||
}
|
||||
var msg Msghdr
|
||||
msg.Name = (*byte)(unsafe.Pointer(ptr))
|
||||
msg.Name = (*byte)(ptr)
|
||||
msg.Namelen = uint32(salen)
|
||||
var iov Iovec
|
||||
if len(p) > 0 {
|
||||
iov.Base = (*byte)(unsafe.Pointer(&p[0]))
|
||||
iov.Base = &p[0]
|
||||
iov.SetLen(len(p))
|
||||
}
|
||||
var dummy byte
|
||||
|
@ -993,7 +993,7 @@ func SendmsgN(fd int, p, oob []byte, to Sockaddr, flags int) (n int, err error)
|
|||
iov.Base = &dummy
|
||||
iov.SetLen(1)
|
||||
}
|
||||
msg.Control = (*byte)(unsafe.Pointer(&oob[0]))
|
||||
msg.Control = &oob[0]
|
||||
msg.SetControllen(len(oob))
|
||||
}
|
||||
msg.Iov = &iov
|
||||
|
|
Загрузка…
Ссылка в новой задаче