File tree 3 files changed +13
-3
lines changed
3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ static REBSER *make_binary(REBVAL *arg, REBOOL make)
234
234
// MAKE/TO BINARY! <vector!>
235
235
case REB_VECTOR :
236
236
// result is in little-endian!
237
- ser = Copy_Bytes (VAL_BIN_DATA (arg ), VAL_LEN (arg ) * VAL_VEC_WIDTH (arg ));
237
+ ser = Copy_Bytes (VAL_DATA (arg ), VAL_LEN (arg ) * VAL_VEC_WIDTH (arg ));
238
238
break ;
239
239
240
240
case REB_BLOCK :
Original file line number Diff line number Diff line change @@ -708,7 +708,7 @@ static void reverse_vector(REBVAL *value, REBCNT len)
708
708
}
709
709
}
710
710
else if (width == 4 ) {
711
- REBCNT * i4 = (REBCNT * )VAL_BIN_DATA (value );
711
+ REBCNT * i4 = (REBCNT * )VAL_DATA (value );
712
712
REBCNT c4 ;
713
713
for (n = 0 , m = len - 1 ; n < len / 2 ; n ++ , m -- ) {
714
714
c4 = i4 [n ];
@@ -717,7 +717,7 @@ static void reverse_vector(REBVAL *value, REBCNT len)
717
717
}
718
718
}
719
719
else if (width == 8 ) {
720
- REBU64 * i8 = (REBU64 * )VAL_BIN_DATA (value );
720
+ REBU64 * i8 = (REBU64 * )VAL_DATA (value );
721
721
REBU64 c8 ;
722
722
for (n = 0 , m = len - 1 ; n < len / 2 ; n ++ , m -- ) {
723
723
c8 = i8 [n ];
Original file line number Diff line number Diff line change @@ -68,6 +68,16 @@ Rebol [
68
68
69
69
--test-- "to-binary vector!"
70
70
--assert #{ 01000200 } = to binary! #[u16! [1 2 ]]
71
+ --assert #{ 0100000002000000 } = to binary! #[i32! [1 2 ]]
72
+ --assert #{ 0000803F00000040 } = to binary! #[f32! [1 2 ]]
73
+ --assert #{ 01000000000000000200000000000000 } = to binary! #[i64! [1 2 ]]
74
+ --assert #{ 000000000000F03F0000000000000040 } = to binary! #[f64! [1 2 ]]
75
+ ;@@ https://github.com/Oldes/Rebol-issues/issues/2518
76
+ --assert #{ 0200 } = to binary! next #[u16! [1 2 ]]
77
+ --assert #{ 02000000 } = to binary! next #[i32! [1 2 ]]
78
+ --assert #{ 00000040 } = to binary! next #[f32! [1 2 ]]
79
+ --assert #{ 0200000000000000 } = to binary! next #[i64! [1 2 ]]
80
+ --assert #{ 0000000000000040 } = to binary! next #[f64! [1 2 ]]
71
81
;@@ https://github.com/Oldes/Rebol-issues/issues/2458
72
82
--assert #{ 01000200 } = to binary! protect #[u16! [1 2 ]]
73
83
You can’t perform that action at this time.
0 commit comments