1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-24 22:23:15 +00:00

Quiet appveyor warnings.

This commit is contained in:
Calvin Rose 2019-03-18 22:00:20 -04:00
parent bad040665f
commit 93f0d5f626
2 changed files with 7 additions and 7 deletions

View File

@ -32,7 +32,7 @@
/* Conditional compilation */
#ifdef JANET_INT_TYPES
#define MAX_INT_IN_DBL 9007199254740992UL /* 2^53 */
#define MAX_INT_IN_DBL 9007199254740992ULL /* 2^53 */
static Janet it_s64_get(void *p, Janet key);
static Janet it_u64_get(void *p, Janet key);

View File

@ -364,7 +364,7 @@ error:
#ifdef JANET_INT_TYPES
static int scan_int64(
static int scan_uint64(
const uint8_t *str,
int32_t len,
uint64_t *out,
@ -432,12 +432,12 @@ static int scan_int64(
int janet_scan_int64(const uint8_t *str, int32_t len, int64_t *out) {
int neg;
uint64_t bi;
if (scan_int64(str, len, &bi, &neg)) {
if (neg && bi <= 0x8000000000000000UL) {
*out = -bi;
if (scan_uint64(str, len, &bi, &neg)) {
if (neg && bi <= 0x8000000000000000ULL) {
*out = -((int64_t) bi);
return 1;
}
if (!neg && bi <= 0x7FFFFFFFFFFFFFFFUL) {
if (!neg && bi <= 0x7FFFFFFFFFFFFFFFULL) {
*out = bi;
return 1;
}
@ -448,7 +448,7 @@ int janet_scan_int64(const uint8_t *str, int32_t len, int64_t *out) {
int janet_scan_uint64(const uint8_t *str, int32_t len, uint64_t *out) {
int neg;
uint64_t bi;
if (scan_int64(str, len, &bi, &neg)) {
if (scan_uint64(str, len, &bi, &neg)) {
if (!neg) {
*out = bi;
return 1;