From 4ccdd78294694dcc56fa186d1532b285d72a4384 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Thu, 31 Aug 2017 19:21:52 +0200 Subject: sys: export struct/union attributes Export struct/union attributes so that they can be filled in by a different package. --- sys/decl.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'sys/decl.go') diff --git a/sys/decl.go b/sys/decl.go index d7a1765c0..7a7c95dbd 100644 --- a/sys/decl.go +++ b/sys/decl.go @@ -343,9 +343,9 @@ func (t *PtrType) Align() uint64 { type StructType struct { TypeCommon Fields []Type + IsPacked bool + AlignAttr uint64 padded bool - packed bool - align uint64 varlen bool varlenAssigned bool } @@ -383,10 +383,10 @@ func (t *StructType) Size() uint64 { } func (t *StructType) Align() uint64 { - if t.align != 0 { - return t.align // overrided by user attribute + if t.AlignAttr != 0 { + return t.AlignAttr // overrided by user attribute } - if t.packed { + if t.IsPacked { return 1 } var align uint64 @@ -400,12 +400,12 @@ func (t *StructType) Align() uint64 { type UnionType struct { TypeCommon - Options []Type - varlen bool // provided by user + Options []Type + IsVarlen bool // provided by user } func (t *UnionType) Varlen() bool { - return t.varlen + return t.IsVarlen } func (t *UnionType) Size() uint64 { -- cgit mrf-deployment