1
0
mirror of https://github.com/janet-lang/janet synced 2024-09-28 07:08:14 +00:00

Be more consistent with va_arg types.

This commit is contained in:
Calvin Rose 2023-10-08 19:09:35 -05:00
parent 267c603824
commit 6ae81058aa
2 changed files with 6 additions and 6 deletions

View File

@ -338,7 +338,7 @@ int32_t janet_gethalfrange(const Janet *argv, int32_t n, int32_t length, const c
int32_t not_raw = raw;
if (not_raw < 0) not_raw += length + 1;
if (not_raw < 0 || not_raw > length)
janet_panicf("%s index %d out of range [%d,%d]", which, raw, -length - 1, length);
janet_panicf("%s index %d out of range [%d,%d]", which, (int64_t) raw, -(int64_t)length - 1, (int64_t) length);
return not_raw;
}
@ -361,7 +361,7 @@ int32_t janet_getargindex(const Janet *argv, int32_t n, int32_t length, const ch
int32_t not_raw = raw;
if (not_raw < 0) not_raw += length;
if (not_raw < 0 || not_raw > length)
janet_panicf("%s index %d out of range [%d,%d)", which, raw, -length, length);
janet_panicf("%s index %d out of range [%d,%d)", which, (int64_t)raw, -(int64_t)length, (int64_t)length);
return not_raw;
}

View File

@ -850,13 +850,13 @@ void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
c = scanformat(c, form, width, precision);
switch (*c++) {
case 'c': {
int n = va_arg(args, long);
int n = va_arg(args, int);
nb = snprintf(item, MAX_ITEM, form, n);
break;
}
case 'd':
case 'i': {
int64_t n = va_arg(args, int);
int64_t n = va_arg(args, int64_t);
nb = snprintf(item, MAX_ITEM, form, n);
break;
}
@ -864,7 +864,7 @@ void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
case 'X':
case 'o':
case 'u': {
uint64_t n = va_arg(args, unsigned int);
uint64_t n = va_arg(args, uint64_t);
nb = snprintf(item, MAX_ITEM, form, n);
break;
}
@ -908,7 +908,7 @@ void janet_formatbv(JanetBuffer *b, const char *format, va_list args) {
janet_buffer_push_cstring(b, typestr(va_arg(args, Janet)));
break;
case 'T': {
int types = va_arg(args, long);
int types = va_arg(args, int);
pushtypes(b, types);
break;
}