File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed
Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -66,17 +66,13 @@ func (v *Value) Release() {
6666// Assign go value to Sciter Value
6767// currently supported go types: bool integer float string and NativeFunctor
6868func (v * Value ) Assign (val interface {}) {
69- const is64Bit = uint64 (^ uintptr (0 )) == ^ uint64 (0 )
7069 switch val .(type ) {
7170 case string :
7271 s := val .(string )
7372 v .SetString (s )
7473 case int32 :
7574 i := val .(int32 )
7675 v .SetInt (i )
77- case int64 :
78- i := val .(int64 )
79- v .SetInt64 (i )
8076 case float64 :
8177 f := val .(float64 )
8278 // valueInit(this); valueFloatDataSet(this, v, T_FLOAT, 0)
@@ -91,19 +87,15 @@ func (v *Value) Assign(val interface{}) {
9187 case float32 :
9288 v .Assign (float64 (val .(float32 )))
9389 case int :
94- if is64Bit {
95- v .Assign (int64 (val .(int )))
96- } else {
97- v .Assign (int32 (val .(int )))
98- }
90+ // TODO: should we check if it's too big?
91+ v .Assign (int32 (val .(int )))
9992 case uint :
100- if is64Bit {
101- v .Assign (uint64 (val .(uint )))
102- } else {
103- v .Assign (uint32 (val .(uint )))
104- }
93+ v .Assign (uint32 (val .(uint )))
10594 case uint32 :
10695 v .Assign (int32 (val .(uint32 )))
96+ case int64 :
97+ // TODO: should we check if it's too big?
98+ v .Assign (int32 (val .(int64 )))
10799 case uint64 :
108100 v .Assign (int64 (val .(uint64 )))
109101 case Value :
You can’t perform that action at this time.
0 commit comments