mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-07 05:06:36 +02:00
Fixes for u8-set
This commit is contained in:
parent
0b38fa2b32
commit
e59ce36cb9
1 changed files with 3 additions and 2 deletions
|
@ -1496,11 +1496,12 @@ object Cyc_bytevector_u8_set(void *data, object bv, object k, object b) {
|
||||||
Cyc_check_int(data, b);
|
Cyc_check_int(data, b);
|
||||||
|
|
||||||
buf = ((bytevector)bv)->data;
|
buf = ((bytevector)bv)->data;
|
||||||
idx = obj_is_int(k) ? obj_obj2int(k) : integer_value(k),
|
idx = obj_is_int(k) ? obj_obj2int(k) : integer_value(k);
|
||||||
|
val = obj_is_int(b) ? obj_obj2int(b) : integer_value(b);
|
||||||
len = ((bytevector)bv)->len;
|
len = ((bytevector)bv)->len;
|
||||||
|
|
||||||
Cyc_check_bounds(data, "bytevector-u8-set!", len, idx);
|
Cyc_check_bounds(data, "bytevector-u8-set!", len, idx);
|
||||||
buf[idx] = (unsigned char)(obj_obj2int(b));
|
buf[idx] = (unsigned char)val;
|
||||||
return bv;
|
return bv;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue