mirror of
https://github.com/janet-lang/janet
synced 2024-11-25 09:47:17 +00:00
try and remove warnings on windows, format os.c.
This commit is contained in:
parent
c344a543b0
commit
00450cd9db
@ -673,7 +673,13 @@ static Janet os_date(int32_t argc, Janet *argv) {
|
||||
return janet_wrap_struct(janet_struct_end(st));
|
||||
}
|
||||
|
||||
static int64_t entry_getint(Janet env_entry, char *field) {
|
||||
#ifdef JANET_WINDOWS
|
||||
typedef int32_t timeint_t;
|
||||
#else
|
||||
typedef int64_t timeint_t;
|
||||
#endif
|
||||
|
||||
static timeint_t entry_getint(Janet env_entry, char *field) {
|
||||
Janet i;
|
||||
if (janet_checktype(env_entry, JANET_TABLE)) {
|
||||
JanetTable *entry = janet_unwrap_table(env_entry);
|
||||
@ -689,12 +695,19 @@ static int64_t entry_getint(Janet env_entry, char *field) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!janet_checkint64(i)) {
|
||||
janet_panicf("bad slot :%s, expected 64 bit signed integer, got %v",
|
||||
#ifdef JANET_WINDOWS
|
||||
if (!janet_checkint(i)) {
|
||||
janet_panicf("bad slot #%s, expected 32 bit signed integer, got %v",
|
||||
field, i);
|
||||
}
|
||||
#else
|
||||
if (!janet_checkint64(i)) {
|
||||
janet_panicf("bad slot #%s, expected 64 bit signed integer, got %v",
|
||||
field, i);
|
||||
}
|
||||
#endif
|
||||
|
||||
return (int64_t)janet_unwrap_number(i);
|
||||
return (timeint_t)janet_unwrap_number(i);
|
||||
}
|
||||
|
||||
static Janet os_mktime(int32_t argc, Janet *argv) {
|
||||
|
Loading…
Reference in New Issue
Block a user