From 8b731ed4b705c3049af917f1c01db5b4a0bc59a1 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 29 Oct 2016 15:55:35 -0600 Subject: sys: replace FilenameType with BufferType{Kind: BufferFilename} FilenameType is effectively a buffer, there is no need for a separate type. --- sys/decl.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'sys') diff --git a/sys/decl.go b/sys/decl.go index 66dc4370a..997298e8a 100644 --- a/sys/decl.go +++ b/sys/decl.go @@ -118,6 +118,7 @@ const ( BufferBlobRand BufferKind = iota BufferBlobRange BufferString + BufferFilename BufferSockaddr BufferFilesystem BufferAlgType @@ -251,18 +252,6 @@ func (t *IntType) Align() uintptr { return t.Size() } -type FilenameType struct { - TypeCommon -} - -func (t *FilenameType) Size() uintptr { - panic("filename size is not statically known") -} - -func (t *FilenameType) Align() uintptr { - return 1 -} - type ArrayKind int const ( @@ -513,7 +502,7 @@ func ForeachType(meta *Call, f func(Type)) { } case *ResourceType, *FileoffType, *BufferType, *VmaType, *LenType, *FlagsType, *ConstType, - *StrConstType, *IntType, *FilenameType: + *StrConstType, *IntType: default: panic("unknown type") } -- cgit mrf-deployment