Currently read_byte returns val_wrap_int(c) where c is the char that was read, but this will encode the byte as a signed integer, whereas a byte should be in (0,256]. The fix is to add a new function to the run-time:
val_t val_wrap_byte(unsigned char b)
and have read_byte return val_wrap_byte(c). The definition is the same as val_wrap_int.
Currently
read_byte
returnsval_wrap_int(c)
wherec
is thechar
that was read, but this will encode the byte as a signed integer, whereas a byte should be in (0,256]. The fix is to add a new function to the run-time:and have
read_byte
returnval_wrap_byte(c)
. The definition is the same asval_wrap_int
.