Fix msvc warning with bad casts.

This commit is contained in:
Calvin Rose
2026-08-31 18:14:41 -05:00
parent 6615ef0718
commit a6564ba448
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -351,7 +351,7 @@ int8_t janet_getinteger8(const Janet *argv, int32_t n) {
if (!janet_checkint8(x)) {
janet_panicf("bad slot #%d, expected 8 bit signed integer, got %v", n, x);
}
return (int16_t) janet_unwrap_number(x);
return (int8_t) janet_unwrap_number(x);
}
uint8_t janet_getuinteger8(const Janet *argv, int32_t n) {
@@ -359,7 +359,7 @@ uint8_t janet_getuinteger8(const Janet *argv, int32_t n) {
if (!janet_checkuint8(x)) {
janet_panicf("bad slot #%d, expected 8 bit unsigned integer, got %v", n, x);
}
return (uint16_t) janet_unwrap_number(x);
return (uint8_t) janet_unwrap_number(x);
}
int64_t janet_getinteger64(const Janet *argv, int32_t n) {
+3 -3
View File
@@ -444,11 +444,11 @@ JANET_CORE_FN(janet_core_range,
count = (step > 0.0) ? (stop - start) / step :
((step < 0.0) ? (stop - start) / step : 0.0);
} else if (argc == 2) {
start = janet_getnumber(argv, 0.0);
stop = janet_getnumber(argv, 1.0);
start = janet_getnumber(argv, 0);
stop = janet_getnumber(argv, 1);
count = stop - start;
} else {
stop = janet_getnumber(argv, 0.0);
stop = janet_getnumber(argv, 0);
count = stop;
}
if (isinf(step)) {