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 @@ -29,6 +29,10 @@ val_t val_wrap_int(int64_t i)
2929{
3030 return (i << int_shift ) | int_type_tag ;
3131}
32+ val_t val_wrap_byte (unsigned char b )
33+ {
34+ return (b << int_shift ) | int_type_tag ;
35+ }
3236
3337int val_unwrap_bool (val_t x )
3438{
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type_t val_typeof(val_t x);
2828 */
2929int64_t val_unwrap_int (val_t x );
3030val_t val_wrap_int (int64_t i );
31+ val_t val_wrap_byte (unsigned char b );
3132
3233int val_unwrap_bool (val_t x );
3334val_t val_wrap_bool (int b );
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 @@ -29,6 +29,10 @@ val_t val_wrap_int(int64_t i)
2929{
3030 return (i << int_shift ) | int_type_tag ;
3131}
32+ val_t val_wrap_byte (unsigned char b )
33+ {
34+ return (b << int_shift ) | int_type_tag ;
35+ }
3236
3337int val_unwrap_bool (val_t x )
3438{
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type_t val_typeof(val_t x);
2828 */
2929int64_t val_unwrap_int (val_t x );
3030val_t val_wrap_int (int64_t i );
31+ val_t val_wrap_byte (unsigned char b );
3132
3233int val_unwrap_bool (val_t x );
3334val_t val_wrap_bool (int b );
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 @@ -29,6 +29,10 @@ val_t val_wrap_int(int64_t i)
2929{
3030 return (i << int_shift ) | int_type_tag ;
3131}
32+ val_t val_wrap_byte (unsigned char b )
33+ {
34+ return (b << int_shift ) | int_type_tag ;
35+ }
3236
3337int val_unwrap_bool (val_t x )
3438{
Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ type_t val_typeof(val_t x);
2828 */
2929int64_t val_unwrap_int (val_t x );
3030val_t val_wrap_int (int64_t i );
31+ val_t val_wrap_byte (unsigned char b );
3132
3233int val_unwrap_bool (val_t x );
3334val_t val_wrap_bool (int b );
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 )
You can’t perform that action at this time.
0 commit comments