diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-01-06 19:36:09 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-01-06 19:36:09 -0800 |
commit | 52b7b42d2bcedc6936ffcb02ce2d74724f4bfaa2 (patch) | |
tree | e5fcbda298bbfe450a19a719e91c9699e6872b4d | |
parent | 1b8fdf96e37a00ec7f364b583c54e997a1fc5529 (diff) | |
download | txr-52b7b42d2bcedc6936ffcb02ce2d74724f4bfaa2.tar.gz txr-52b7b42d2bcedc6936ffcb02ce2d74724f4bfaa2.tar.bz2 txr-52b7b42d2bcedc6936ffcb02ce2d74724f4bfaa2.zip |
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.
-rw-r--r-- | lib.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); |