aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/syscall
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@google.com>2012-04-22 18:51:44 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2012-04-22 18:51:44 +0000
commitf12e8bd5c3e7063f4e616bda3cab540ea73ac446 (patch)
treedc74fb1f36cb378bbb8295d9aa9daefe37eff0f2 /libgo/go/syscall
parent970aa0b9a95103d518c7e96c70794ba32d074368 (diff)
downloadgcc-f12e8bd5c3e7063f4e616bda3cab540ea73ac446.zip
gcc-f12e8bd5c3e7063f4e616bda3cab540ea73ac446.tar.gz
gcc-f12e8bd5c3e7063f4e616bda3cab540ea73ac446.tar.bz2
godump.c (go_output_typedef): Dump size of structs.
* godump.c (go_output_typedef): Dump size of structs. mksysinfo, syscall: Change Sizeof names from var to const. From-SVN: r186678
Diffstat (limited to 'libgo/go/syscall')
-rw-r--r--libgo/go/syscall/sockcmsg_unix.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/libgo/go/syscall/sockcmsg_unix.go b/libgo/go/syscall/sockcmsg_unix.go
index 1faac84..943ebdd 100644
--- a/libgo/go/syscall/sockcmsg_unix.go
+++ b/libgo/go/syscall/sockcmsg_unix.go
@@ -39,7 +39,7 @@ func CmsgSpace(datalen int) int {
}
func cmsgData(cmsg *Cmsghdr) unsafe.Pointer {
- return unsafe.Pointer(uintptr(unsafe.Pointer(cmsg)) + uintptr(SizeofCmsghdr))
+ return unsafe.Pointer(uintptr(unsafe.Pointer(cmsg)) + SizeofCmsghdr)
}
type SocketControlMessage struct {
@@ -72,7 +72,7 @@ func ParseSocketControlMessage(buf []byte) ([]SocketControlMessage, error) {
func socketControlMessageHeaderAndData(buf []byte) (*Cmsghdr, []byte, error) {
h := (*Cmsghdr)(unsafe.Pointer(&buf[0]))
- if int(h.Len) < SizeofCmsghdr || int(h.Len) > len(buf) {
+ if h.Len < SizeofCmsghdr || int(h.Len) > len(buf) {
return nil, nil, EINVAL
}
return h, buf[cmsgAlignOf(SizeofCmsghdr):], nil