Adapt to new reflection API (notified by mattn. thanks)

This commit is contained in:
moriyoshi 2010-06-26 20:31:53 +09:00 committed by Moriyoshi Koizumi
parent ee0debc5b3
commit 8325cce44c
2 changed files with 5 additions and 42 deletions

View File

@ -18,41 +18,14 @@ func equal(lhs reflect.Value, rhs reflect.Value) bool {
case *reflect.BoolValue:
_rhs, ok := rhs.(*reflect.BoolValue)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Uint8Value:
_rhs, ok := rhs.(*reflect.Uint8Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Uint16Value:
_rhs, ok := rhs.(*reflect.Uint16Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Uint32Value:
_rhs, ok := rhs.(*reflect.Uint32Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Uint64Value:
_rhs, ok := rhs.(*reflect.Uint64Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.UintValue:
_rhs, ok := rhs.(*reflect.UintValue)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Int8Value:
_rhs, ok := rhs.(*reflect.Int8Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Int16Value:
_rhs, ok := rhs.(*reflect.Int16Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Int32Value:
_rhs, ok := rhs.(*reflect.Int32Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Int64Value:
_rhs, ok := rhs.(*reflect.Int64Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.IntValue:
_rhs, ok := rhs.(*reflect.IntValue)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Float32Value:
_rhs, ok := rhs.(*reflect.Float32Value)
return ok && _lhs.Get() == _rhs.Get()
case *reflect.Float64Value:
_rhs, ok := rhs.(*reflect.Float64Value)
case *reflect.FloatValue:
_rhs, ok := rhs.(*reflect.FloatValue)
return ok && _lhs.Get() == _rhs.Get()
case reflect.ArrayOrSliceValue:
_rhs := rhs.(reflect.ArrayOrSliceValue)

View File

@ -524,19 +524,9 @@ func PackValue(writer io.Writer, value reflect.Value) (n int, err os.Error) {
if value.Type() == nil { return PackNil(writer) }
switch _value := value.(type) {
case *reflect.BoolValue: return PackBool(writer, _value.Get())
case *reflect.Uint8Value: return PackUint8(writer, _value.Get())
case *reflect.Uint16Value: return PackUint16(writer, _value.Get())
case *reflect.Uint32Value: return PackUint32(writer, _value.Get())
case *reflect.Uint64Value: return PackUint64(writer, _value.Get())
case *reflect.UintValue: return PackUint(writer, _value.Get())
case *reflect.Int8Value: return PackInt8(writer, _value.Get())
case *reflect.Int16Value: return PackInt16(writer, _value.Get())
case *reflect.Int32Value: return PackInt32(writer, _value.Get())
case *reflect.Int64Value: return PackInt64(writer, _value.Get())
case *reflect.IntValue: return PackInt(writer, _value.Get())
case *reflect.Float32Value: return PackFloat32(writer, _value.Get())
case *reflect.Float64Value: return PackFloat64(writer, _value.Get())
case *reflect.FloatValue: return PackFloat(writer, _value.Get())
case *reflect.UintValue: return PackUint64(writer, _value.Get())
case *reflect.IntValue: return PackInt64(writer, _value.Get())
case *reflect.FloatValue: return PackFloat64(writer, _value.Get())
case *reflect.ArrayValue: return PackArray(writer, _value)
case *reflect.SliceValue: return PackArray(writer, _value)
case *reflect.MapValue: return PackMap(writer, _value)