mirror of
https://github.com/janet-lang/janet
synced 2025-10-30 07:03:02 +00:00
Replace cast with type pun.
This commit is contained in:
@@ -36,7 +36,8 @@ void *janet_nanbox_to_pointer(Janet x) {
|
||||
#else
|
||||
x.i64 = (x.i64 << 16) >> 16;
|
||||
#endif
|
||||
return (void *)x.i64;
|
||||
|
||||
return x.pointer;
|
||||
}
|
||||
|
||||
Janet janet_nanbox_from_pointer(void *p, uint64_t tagmask) {
|
||||
|
||||
@@ -342,6 +342,7 @@ union Janet {
|
||||
uint64_t u64;
|
||||
int64_t i64;
|
||||
double real;
|
||||
void *pointer;
|
||||
};
|
||||
|
||||
#define janet_u64(x) ((x).u64)
|
||||
|
||||
@@ -35,7 +35,7 @@ int janet_line_getter(JanetArgs args) {
|
||||
|
||||
static void simpleline(JanetBuffer *buffer) {
|
||||
buffer->count = 0;
|
||||
char c;
|
||||
int c;
|
||||
for (;;) {
|
||||
c = fgetc(stdin);
|
||||
if (feof(stdin) || c < 0) {
|
||||
|
||||
Reference in New Issue
Block a user