From 5983e14cf97bd1302151ffc3dbc53451acdc87e9 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 6 Jan 2022 19:36:09 -0800 Subject: num_ex: eliminate ill-considered cast. * lib.h (num_ex): Remove the cast to ucnum, which will cause this macro to misbehave for negative arguments. For instance, -1 > (ucnum) INT_PTR_MAX will compare as true! The -1 gets converted to the unsigned type and becomes UINT_PTR_MAX. --- lib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib.h') diff --git a/lib.h b/lib.h index f3d45e2b..114205a6 100644 --- a/lib.h +++ b/lib.h @@ -768,7 +768,7 @@ val plist_to_alist(val list); val improper_plist_to_alist(val list, val boolean_keys); val num(cnum val); val unum(ucnum u); -#define num_ex(x) if3((x) > (ucnum) INT_PTR_MAX, unum(x), num(x)) +#define num_ex(x) if3((x) > INT_PTR_MAX, unum(x), num(x)) val flo(double val); cnum c_num(val num, val self); -- cgit v1.2.3