Commit 2961cab9 authored by Ian Lance Taylor's avatar Ian Lance Taylor

runtime: remove _Kind constants

The duplication of _Kind and kind constants is a legacy of the
conversion from C.

Change-Id: I368b35a41f215cf91ac4b09dac59699edb414a0e
Reviewed-on: https://go-review.googlesource.com/15800Reviewed-by: 's avatarMinux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent 29aaf679
...@@ -132,11 +132,11 @@ func BenchSetType(n int, x interface{}) { ...@@ -132,11 +132,11 @@ func BenchSetType(n int, x interface{}) {
var size uintptr var size uintptr
var p unsafe.Pointer var p unsafe.Pointer
switch t.kind & kindMask { switch t.kind & kindMask {
case _KindPtr: case kindPtr:
t = (*ptrtype)(unsafe.Pointer(t)).elem t = (*ptrtype)(unsafe.Pointer(t)).elem
size = t.size size = t.size
p = e.data p = e.data
case _KindSlice: case kindSlice:
slice := *(*struct { slice := *(*struct {
ptr unsafe.Pointer ptr unsafe.Pointer
len, cap uintptr len, cap uintptr
......
...@@ -5,37 +5,37 @@ ...@@ -5,37 +5,37 @@
package runtime package runtime
const ( const (
kindBool = _KindBool kindBool = 1 + iota
kindInt = _KindInt kindInt
kindInt8 = _KindInt8 kindInt8
kindInt16 = _KindInt16 kindInt16
kindInt32 = _KindInt32 kindInt32
kindInt64 = _KindInt64 kindInt64
kindUint = _KindUint kindUint
kindUint8 = _KindUint8 kindUint8
kindUint16 = _KindUint16 kindUint16
kindUint32 = _KindUint32 kindUint32
kindUint64 = _KindUint64 kindUint64
kindUintptr = _KindUintptr kindUintptr
kindFloat32 = _KindFloat32 kindFloat32
kindFloat64 = _KindFloat64 kindFloat64
kindComplex64 = _KindComplex64 kindComplex64
kindComplex128 = _KindComplex128 kindComplex128
kindArray = _KindArray kindArray
kindChan = _KindChan kindChan
kindFunc = _KindFunc kindFunc
kindInterface = _KindInterface kindInterface
kindMap = _KindMap kindMap
kindPtr = _KindPtr kindPtr
kindSlice = _KindSlice kindSlice
kindString = _KindString kindString
kindStruct = _KindStruct kindStruct
kindUnsafePointer = _KindUnsafePointer kindUnsafePointer
kindDirectIface = _KindDirectIface kindDirectIface = 1 << 5
kindGCProg = _KindGCProg kindGCProg = 1 << 6
kindNoPointers = _KindNoPointers kindNoPointers = 1 << 7
kindMask = _KindMask kindMask = (1 << 5) - 1
) )
// isDirectIface reports whether t is stored directly in an interface value. // isDirectIface reports whether t is stored directly in an interface value.
......
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime
const (
_KindBool = 1 + iota
_KindInt
_KindInt8
_KindInt16
_KindInt32
_KindInt64
_KindUint
_KindUint8
_KindUint16
_KindUint32
_KindUint64
_KindUintptr
_KindFloat32
_KindFloat64
_KindComplex64
_KindComplex128
_KindArray
_KindChan
_KindFunc
_KindInterface
_KindMap
_KindPtr
_KindSlice
_KindString
_KindStruct
_KindUnsafePointer
_KindDirectIface = 1 << 5
_KindGCProg = 1 << 6 // Type.gc points to GC program
_KindNoPointers = 1 << 7
_KindMask = (1 << 5) - 1
)
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