Skip to content

Commit

Permalink
Fixing #144 through Iniquity.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvanhorn committed Jul 1, 2023
1 parent f88b799 commit 6d32cf7
Show file tree
Hide file tree
Showing 18 changed files with 36 additions and 6 deletions.
2 changes: 1 addition & 1 deletion langs/evildoer/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
val_t read_byte(void)
{
char c = getc(in);
return (c == EOF) ? val_wrap_eof() : val_wrap_int(c);
return (c == EOF) ? val_wrap_eof() : val_wrap_byte(c);
}

val_t peek_byte(void)
Expand Down
4 changes: 4 additions & 0 deletions langs/evildoer/values.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ val_t val_wrap_int(int64_t i)
{
return (i << int_shift) | int_type_tag;
}
val_t val_wrap_byte(unsigned char b)
{
return (b << int_shift) | int_type_tag;
}

int val_unwrap_bool(val_t x)
{
Expand Down
1 change: 1 addition & 0 deletions langs/evildoer/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type_t val_typeof(val_t x);
*/
int64_t val_unwrap_int(val_t x);
val_t val_wrap_int(int64_t i);
val_t val_wrap_byte(unsigned char b);

int val_unwrap_bool(val_t x);
val_t val_wrap_bool(int b);
Expand Down
2 changes: 1 addition & 1 deletion langs/extort/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
val_t read_byte(void)
{
char c = getc(in);
return (c == EOF) ? val_wrap_eof() : val_wrap_int(c);
return (c == EOF) ? val_wrap_eof() : val_wrap_byte(c);
}

val_t peek_byte(void)
Expand Down
4 changes: 4 additions & 0 deletions langs/extort/values.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ val_t val_wrap_int(int64_t i)
{
return (i << int_shift) | int_type_tag;
}
val_t val_wrap_byte(unsigned char b)
{
return (b << int_shift) | int_type_tag;
}

int val_unwrap_bool(val_t x)
{
Expand Down
1 change: 1 addition & 0 deletions langs/extort/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type_t val_typeof(val_t x);
*/
int64_t val_unwrap_int(val_t x);
val_t val_wrap_int(int64_t i);
val_t val_wrap_byte(unsigned char b);

int val_unwrap_bool(val_t x);
val_t val_wrap_bool(int b);
Expand Down
2 changes: 1 addition & 1 deletion langs/fraud/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
val_t read_byte(void)
{
char c = getc(in);
return (c == EOF) ? val_wrap_eof() : val_wrap_int(c);
return (c == EOF) ? val_wrap_eof() : val_wrap_byte(c);
}

val_t peek_byte(void)
Expand Down
4 changes: 4 additions & 0 deletions langs/fraud/values.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ val_t val_wrap_int(int64_t i)
{
return (i << int_shift) | int_type_tag;
}
val_t val_wrap_byte(unsigned char b)
{
return (b << int_shift) | int_type_tag;
}

int val_unwrap_bool(val_t x)
{
Expand Down
1 change: 1 addition & 0 deletions langs/fraud/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ type_t val_typeof(val_t x);
*/
int64_t val_unwrap_int(val_t x);
val_t val_wrap_int(int64_t i);
val_t val_wrap_byte(unsigned char b);

int val_unwrap_bool(val_t x);
val_t val_wrap_bool(int b);
Expand Down
2 changes: 1 addition & 1 deletion langs/hoax/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
val_t read_byte(void)
{
char c = getc(in);
return (c == EOF) ? val_wrap_eof() : val_wrap_int(c);
return (c == EOF) ? val_wrap_eof() : val_wrap_byte(c);
}

val_t peek_byte(void)
Expand Down
4 changes: 4 additions & 0 deletions langs/hoax/values.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ val_t val_wrap_int(int64_t i)
{
return (i << int_shift) | int_type_tag;
}
val_t val_wrap_byte(unsigned char b)
{
return (b << int_shift) | int_type_tag;
}

int val_unwrap_bool(val_t x)
{
Expand Down
1 change: 1 addition & 0 deletions langs/hoax/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type_t val_typeof(val_t x);
*/
int64_t val_unwrap_int(val_t x);
val_t val_wrap_int(int64_t i);
val_t val_wrap_byte(unsigned char b);

int val_unwrap_bool(val_t x);
val_t val_wrap_bool(int b);
Expand Down
2 changes: 1 addition & 1 deletion langs/hustle/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
val_t read_byte(void)
{
char c = getc(in);
return (c == EOF) ? val_wrap_eof() : val_wrap_int(c);
return (c == EOF) ? val_wrap_eof() : val_wrap_byte(c);
}

val_t peek_byte(void)
Expand Down
4 changes: 4 additions & 0 deletions langs/hustle/values.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ val_t val_wrap_int(int64_t i)
{
return (i << int_shift) | int_type_tag;
}
val_t val_wrap_byte(unsigned char b)
{
return (b << int_shift) | int_type_tag;
}

int val_unwrap_bool(val_t x)
{
Expand Down
1 change: 1 addition & 0 deletions langs/hustle/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ type_t val_typeof(val_t x);
*/
int64_t val_unwrap_int(val_t x);
val_t val_wrap_int(int64_t i);
val_t val_wrap_byte(unsigned char b);

int val_unwrap_bool(val_t x);
val_t val_wrap_bool(int b);
Expand Down
2 changes: 1 addition & 1 deletion langs/iniquity/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
val_t read_byte(void)
{
char c = getc(in);
return (c == EOF) ? val_wrap_eof() : val_wrap_int(c);
return (c == EOF) ? val_wrap_eof() : val_wrap_byte(c);
}

val_t peek_byte(void)
Expand Down
4 changes: 4 additions & 0 deletions langs/iniquity/values.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ int64_t val_unwrap_int(val_t x)
{
return x >> int_shift;
}
val_t val_wrap_byte(unsigned char b)
{
return (b << int_shift) | int_type_tag;
}
val_t val_wrap_int(int64_t i)
{
return (i << int_shift) | int_type_tag;
Expand Down
1 change: 1 addition & 0 deletions langs/iniquity/values.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ type_t val_typeof(val_t x);
*/
int64_t val_unwrap_int(val_t x);
val_t val_wrap_int(int64_t i);
val_t val_wrap_byte(unsigned char b);

int val_unwrap_bool(val_t x);
val_t val_wrap_bool(int b);
Expand Down

0 comments on commit 6d32cf7

Please sign in to comment.