Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
bcd6403c
Commit
bcd6403c
authored
Nov 04, 2008
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove unnecessary 6g workaround
R=r DELTA=51 (0 added, 0 deleted, 51 changed) OCL=18399 CL=18402
parent
1ff61cef
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
51 deletions
+51
-51
value.go
src/lib/reflect/value.go
+51
-51
No files found.
src/lib/reflect/value.go
View file @
bcd6403c
...
...
@@ -21,17 +21,17 @@ export type Value interface {
// Common fields and functionality for all values
type
Common
V
struct
{
// BUG: want to call this Common but 6g does not hide the name
type
Common
struct
{
kind
int
;
typ
Type
;
addr
Addr
;
}
func
(
c
*
Common
V
)
Kind
()
int
{
func
(
c
*
Common
)
Kind
()
int
{
return
c
.
kind
}
func
(
c
*
Common
V
)
Type
()
Type
{
func
(
c
*
Common
)
Type
()
Type
{
return
c
.
typ
}
...
...
@@ -68,11 +68,11 @@ export type MissingValue interface {
}
type
MissingValueStruct
struct
{
Common
V
Common
}
func
MissingCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
MissingValueStruct
{
Common
V
{
IntKind
,
typ
,
addr
}
}
return
&
MissingValueStruct
{
Common
{
IntKind
,
typ
,
addr
}
}
}
// -- Int
...
...
@@ -85,11 +85,11 @@ export type IntValue interface {
}
type
IntValueStruct
struct
{
Common
V
Common
}
func
IntCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
IntValueStruct
{
Common
V
{
IntKind
,
typ
,
addr
}
}
return
&
IntValueStruct
{
Common
{
IntKind
,
typ
,
addr
}
}
}
func
(
v
*
IntValueStruct
)
Get
()
int
{
...
...
@@ -110,11 +110,11 @@ export type Int8Value interface {
}
type
Int8ValueStruct
struct
{
Common
V
Common
}
func
Int8Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Int8ValueStruct
{
Common
V
{
Int8Kind
,
typ
,
addr
}
}
return
&
Int8ValueStruct
{
Common
{
Int8Kind
,
typ
,
addr
}
}
}
func
(
v
*
Int8ValueStruct
)
Get
()
int8
{
...
...
@@ -135,11 +135,11 @@ export type Int16Value interface {
}
type
Int16ValueStruct
struct
{
Common
V
Common
}
func
Int16Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Int16ValueStruct
{
Common
V
{
Int16Kind
,
typ
,
addr
}
}
return
&
Int16ValueStruct
{
Common
{
Int16Kind
,
typ
,
addr
}
}
}
func
(
v
*
Int16ValueStruct
)
Get
()
int16
{
...
...
@@ -160,11 +160,11 @@ export type Int32Value interface {
}
type
Int32ValueStruct
struct
{
Common
V
Common
}
func
Int32Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Int32ValueStruct
{
Common
V
{
Int32Kind
,
typ
,
addr
}
}
return
&
Int32ValueStruct
{
Common
{
Int32Kind
,
typ
,
addr
}
}
}
func
(
v
*
Int32ValueStruct
)
Get
()
int32
{
...
...
@@ -185,11 +185,11 @@ export type Int64Value interface {
}
type
Int64ValueStruct
struct
{
Common
V
Common
}
func
Int64Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Int64ValueStruct
{
Common
V
{
Int64Kind
,
typ
,
addr
}
}
return
&
Int64ValueStruct
{
Common
{
Int64Kind
,
typ
,
addr
}
}
}
func
(
v
*
Int64ValueStruct
)
Get
()
int64
{
...
...
@@ -210,11 +210,11 @@ export type UintValue interface {
}
type
UintValueStruct
struct
{
Common
V
Common
}
func
UintCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
UintValueStruct
{
Common
V
{
UintKind
,
typ
,
addr
}
}
return
&
UintValueStruct
{
Common
{
UintKind
,
typ
,
addr
}
}
}
func
(
v
*
UintValueStruct
)
Get
()
uint
{
...
...
@@ -235,11 +235,11 @@ export type Uint8Value interface {
}
type
Uint8ValueStruct
struct
{
Common
V
Common
}
func
Uint8Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Uint8ValueStruct
{
Common
V
{
Uint8Kind
,
typ
,
addr
}
}
return
&
Uint8ValueStruct
{
Common
{
Uint8Kind
,
typ
,
addr
}
}
}
func
(
v
*
Uint8ValueStruct
)
Get
()
uint8
{
...
...
@@ -260,11 +260,11 @@ export type Uint16Value interface {
}
type
Uint16ValueStruct
struct
{
Common
V
Common
}
func
Uint16Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Uint16ValueStruct
{
Common
V
{
Uint16Kind
,
typ
,
addr
}
}
return
&
Uint16ValueStruct
{
Common
{
Uint16Kind
,
typ
,
addr
}
}
}
func
(
v
*
Uint16ValueStruct
)
Get
()
uint16
{
...
...
@@ -285,11 +285,11 @@ export type Uint32Value interface {
}
type
Uint32ValueStruct
struct
{
Common
V
Common
}
func
Uint32Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Uint32ValueStruct
{
Common
V
{
Uint32Kind
,
typ
,
addr
}
}
return
&
Uint32ValueStruct
{
Common
{
Uint32Kind
,
typ
,
addr
}
}
}
func
(
v
*
Uint32ValueStruct
)
Get
()
uint32
{
...
...
@@ -310,11 +310,11 @@ export type Uint64Value interface {
}
type
Uint64ValueStruct
struct
{
Common
V
Common
}
func
Uint64Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Uint64ValueStruct
{
Common
V
{
Uint64Kind
,
typ
,
addr
}
}
return
&
Uint64ValueStruct
{
Common
{
Uint64Kind
,
typ
,
addr
}
}
}
func
(
v
*
Uint64ValueStruct
)
Get
()
uint64
{
...
...
@@ -335,11 +335,11 @@ export type FloatValue interface {
}
type
FloatValueStruct
struct
{
Common
V
Common
}
func
FloatCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
FloatValueStruct
{
Common
V
{
FloatKind
,
typ
,
addr
}
}
return
&
FloatValueStruct
{
Common
{
FloatKind
,
typ
,
addr
}
}
}
func
(
v
*
FloatValueStruct
)
Get
()
float
{
...
...
@@ -360,11 +360,11 @@ export type Float32Value interface {
}
type
Float32ValueStruct
struct
{
Common
V
Common
}
func
Float32Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Float32ValueStruct
{
Common
V
{
Float32Kind
,
typ
,
addr
}
}
return
&
Float32ValueStruct
{
Common
{
Float32Kind
,
typ
,
addr
}
}
}
func
(
v
*
Float32ValueStruct
)
Get
()
float32
{
...
...
@@ -385,11 +385,11 @@ export type Float64Value interface {
}
type
Float64ValueStruct
struct
{
Common
V
Common
}
func
Float64Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Float64ValueStruct
{
Common
V
{
Float64Kind
,
typ
,
addr
}
}
return
&
Float64ValueStruct
{
Common
{
Float64Kind
,
typ
,
addr
}
}
}
func
(
v
*
Float64ValueStruct
)
Get
()
float64
{
...
...
@@ -410,11 +410,11 @@ export type Float80Value interface {
}
type
Float80ValueStruct
struct
{
Common
V
Common
}
func
Float80Creator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
Float80ValueStruct
{
Common
V
{
Float80Kind
,
typ
,
addr
}
}
return
&
Float80ValueStruct
{
Common
{
Float80Kind
,
typ
,
addr
}
}
}
/*
...
...
@@ -439,11 +439,11 @@ export type StringValue interface {
}
type
StringValueStruct
struct
{
Common
V
Common
}
func
StringCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
StringValueStruct
{
Common
V
{
StringKind
,
typ
,
addr
}
}
return
&
StringValueStruct
{
Common
{
StringKind
,
typ
,
addr
}
}
}
func
(
v
*
StringValueStruct
)
Get
()
string
{
...
...
@@ -464,11 +464,11 @@ export type BoolValue interface {
}
type
BoolValueStruct
struct
{
Common
V
Common
}
func
BoolCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
BoolValueStruct
{
Common
V
{
BoolKind
,
typ
,
addr
}
}
return
&
BoolValueStruct
{
Common
{
BoolKind
,
typ
,
addr
}
}
}
func
(
v
*
BoolValueStruct
)
Get
()
bool
{
...
...
@@ -489,7 +489,7 @@ export type PtrValue interface {
}
type
PtrValueStruct
struct
{
Common
V
Common
}
func
(
v
*
PtrValueStruct
)
Get
()
Addr
{
...
...
@@ -501,7 +501,7 @@ func (v *PtrValueStruct) Sub() Value {
}
func
PtrCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
PtrValueStruct
{
Common
V
{
PtrKind
,
typ
,
addr
}
};
return
&
PtrValueStruct
{
Common
{
PtrKind
,
typ
,
addr
}
};
}
// -- Array
...
...
@@ -515,7 +515,7 @@ export type ArrayValue interface {
}
type
OpenArrayValueStruct
struct
{
Common
V
;
Common
;
elemtype
Type
;
elemsize
uint64
;
}
...
...
@@ -542,7 +542,7 @@ func (v *OpenArrayValueStruct) Elem(i uint64) Value {
}
type
FixedArrayValueStruct
struct
{
Common
V
;
Common
;
elemtype
Type
;
elemsize
uint64
;
len
uint64
;
...
...
@@ -592,11 +592,11 @@ export type MapValue interface {
}
type
MapValueStruct
struct
{
Common
V
Common
}
func
MapCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
MapValueStruct
{
Common
V
{
MapKind
,
typ
,
addr
}
}
return
&
MapValueStruct
{
Common
{
MapKind
,
typ
,
addr
}
}
}
func
(
v
*
MapValueStruct
)
Len
()
int
{
...
...
@@ -616,11 +616,11 @@ export type ChanValue interface {
}
type
ChanValueStruct
struct
{
Common
V
Common
}
func
ChanCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
ChanValueStruct
{
Common
V
{
ChanKind
,
typ
,
addr
}
}
return
&
ChanValueStruct
{
Common
{
ChanKind
,
typ
,
addr
}
}
}
// -- Struct
...
...
@@ -633,7 +633,7 @@ export type StructValue interface {
}
type
StructValueStruct
struct
{
Common
V
;
Common
;
field
*
[]
Value
;
}
...
...
@@ -648,7 +648,7 @@ func (v *StructValueStruct) Field(i int) Value {
func
StructCreator
(
typ
Type
,
addr
Addr
)
Value
{
t
:=
typ
.
(
StructType
);
nfield
:=
t
.
Len
();
v
:=
&
StructValueStruct
{
Common
V
{
StructKind
,
typ
,
addr
},
new
([]
Value
,
nfield
)
};
v
:=
&
StructValueStruct
{
Common
{
StructKind
,
typ
,
addr
},
new
([]
Value
,
nfield
)
};
for
i
:=
0
;
i
<
nfield
;
i
++
{
name
,
ftype
,
str
,
offset
:=
t
.
Field
(
i
);
v
.
field
[
i
]
=
NewValueAddr
(
ftype
,
addr
+
offset
);
...
...
@@ -665,11 +665,11 @@ export type InterfaceValue interface {
}
type
InterfaceValueStruct
struct
{
Common
V
Common
}
func
InterfaceCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
InterfaceValueStruct
{
Common
V
{
InterfaceKind
,
typ
,
addr
}
}
return
&
InterfaceValueStruct
{
Common
{
InterfaceKind
,
typ
,
addr
}
}
}
// -- Func
...
...
@@ -680,11 +680,11 @@ export type FuncValue interface {
}
type
FuncValueStruct
struct
{
Common
V
Common
}
func
FuncCreator
(
typ
Type
,
addr
Addr
)
Value
{
return
&
FuncValueStruct
{
Common
V
{
FuncKind
,
typ
,
addr
}
}
return
&
FuncValueStruct
{
Common
{
FuncKind
,
typ
,
addr
}
}
}
var
creator
*
map
[
int
]
Creator
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment