File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77val_t read_byte (void )
88{
99 char c = getc (in );
10- return (c == EOF ) ? val_wrap_eof () : val_wrap_int (c );
10+ return (c == EOF ) ? val_wrap_eof () : val_wrap_byte (c );
1111}
1212
1313val_t peek_byte (void )
Original file line number Diff line number Diff line change @@ -38,6 +38,10 @@ int64_t val_unwrap_int(val_t x)
3838{
3939 return x >> int_shift ;
4040}
41+ val_t val_wrap_byte (unsigned char b )
42+ {
43+ return (b << int_shift ) | int_type_tag ;
44+ }
4145val_t val_wrap_int (int64_t i )
4246{
4347 return (i << int_shift ) | int_type_tag ;
Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ type_t val_typeof(val_t x);
4949 */
5050int64_t val_unwrap_int (val_t x );
5151val_t val_wrap_int (int64_t i );
52+ val_t val_wrap_byte (unsigned char b );
5253
5354int val_unwrap_bool (val_t x );
5455val_t val_wrap_bool (int b );
You can’t perform that action at this time.
0 commit comments