From b91b64a2d54404c4ead09093c25e0002fbab1881 Mon Sep 17 00:00:00 2001 From: bptato Date: Sat, 2 Dec 2023 10:30:51 +0100 Subject: qjs: fix a warning We want to check if d is larger than INT64_MAX, but the conversion rounds it up, so we actually need to use greater-equals. --- lib/quickjs/quickjs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/quickjs/quickjs.c') diff --git a/lib/quickjs/quickjs.c b/lib/quickjs/quickjs.c index aea545a6..4fd42aac 100644 --- a/lib/quickjs/quickjs.c +++ b/lib/quickjs/quickjs.c @@ -10846,7 +10846,7 @@ static int JS_ToInt64SatFree(JSContext *ctx, int64_t *pres, JSValue val) } else { if (d < INT64_MIN) *pres = INT64_MIN; - else if (d > INT64_MAX) + else if (d >= (double)INT64_MAX) *pres = INT64_MAX; else *pres = (int64_t)d; -- cgit 1.4.1-2-gfad0