aboutsummaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2016-09-19 19:34:18 +0200
committerGitHub <noreply@github.com>2016-09-19 19:34:18 +0200
commit0c97d70213a4fbc6d8d57626c18b603f2a281047 (patch)
treeb06169dbe00277fa6c5438e993090db543d72c4d /sys
parentfebb6155f3997790ed163d6cf4b7122211d39eb3 (diff)
parent48818aa114afca38b61787e215bbec44f8421a9a (diff)
Merge pull request #76 from xairy/various_fixes
Various fixes
Diffstat (limited to 'sys')
-rw-r--r--sys/decl.go39
1 files changed, 4 insertions, 35 deletions
diff --git a/sys/decl.go b/sys/decl.go
index a447948bc..a9f9d1ad3 100644
--- a/sys/decl.go
+++ b/sys/decl.go
@@ -276,27 +276,11 @@ type StructType struct {
}
func (t *StructType) Size() uintptr {
- if !t.padded {
- panic("struct is not padded yet")
- }
- var size uintptr
- for _, f := range t.Fields {
- size += f.Size()
- }
- return size
+ panic("not called")
}
func (t *StructType) Align() uintptr {
- if t.align != 0 {
- return t.align // overrided by user attribute
- }
- var align uintptr
- for _, f := range t.Fields {
- if a1 := f.Align(); align < a1 {
- align = a1
- }
- }
- return align
+ panic("not called")
}
type UnionType struct {
@@ -306,26 +290,11 @@ type UnionType struct {
}
func (t *UnionType) Size() uintptr {
- if t.varlen {
- panic("union size is not statically known")
- }
- size := t.Options[0].Size()
- for _, opt := range t.Options {
- if size < opt.Size() {
- size = opt.Size()
- }
- }
- return size
+ panic("not called")
}
func (t *UnionType) Align() uintptr {
- var align uintptr
- for _, opt := range t.Options {
- if a1 := opt.Align(); align < a1 {
- align = a1
- }
- }
- return align
+ panic("not called")
}
type Dir int