Commit 64e598f7 authored by Matthew Dempsky's avatar Matthew Dempsky

runtime: use efaceOf where applicable

Prepared with gofmt -r.

Change-Id: Ifea325c209d800b5692d318955930b10debb548b
Reviewed-on: https://go-review.googlesource.com/c/go/+/198494
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
parent debbb1e7
......@@ -411,7 +411,7 @@ func cgoCheckPointer(ptr interface{}, arg interface{}) {
return
}
ep := (*eface)(unsafe.Pointer(&ptr))
ep := efaceOf(&ptr)
t := ep._type
top := true
......@@ -423,7 +423,7 @@ func cgoCheckPointer(ptr interface{}, arg interface{}) {
if p == nil || !cgoIsGoPointer(p) {
return
}
aep := (*eface)(unsafe.Pointer(&arg))
aep := efaceOf(&arg)
switch aep._type.kind & kindMask {
case kindBool:
if t.kind&kindMask == kindUnsafePointer {
......@@ -650,7 +650,7 @@ func cgoCheckResult(val interface{}) {
return
}
ep := (*eface)(unsafe.Pointer(&val))
ep := efaceOf(&val)
t := ep._type
cgoCheckArg(t, ep.data, t.kind&kindDirectIface == 0, false, cgoResultFail)
}
......@@ -295,11 +295,11 @@ var (
stringEface interface{} = stringInterfacePtr("")
sliceEface interface{} = sliceInterfacePtr(nil)
uint16Type *_type = (*eface)(unsafe.Pointer(&uint16Eface))._type
uint32Type *_type = (*eface)(unsafe.Pointer(&uint32Eface))._type
uint64Type *_type = (*eface)(unsafe.Pointer(&uint64Eface))._type
stringType *_type = (*eface)(unsafe.Pointer(&stringEface))._type
sliceType *_type = (*eface)(unsafe.Pointer(&sliceEface))._type
uint16Type *_type = efaceOf(&uint16Eface)._type
uint32Type *_type = efaceOf(&uint32Eface)._type
uint64Type *_type = efaceOf(&uint64Eface)._type
stringType *_type = efaceOf(&stringEface)._type
sliceType *_type = efaceOf(&sliceEface)._type
)
// The conv and assert functions below do very similar things.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment