]> git.eshelyaron.com Git - emacs.git/commit
Improve integer range checking
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 5 Apr 2020 08:17:32 +0000 (01:17 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 5 Apr 2020 08:24:36 +0000 (01:24 -0700)
commitbec5cfee7660f6e283efbd30a693a6f8e9ea46b8
treeb6b872dfb83579336e848a62f720b629426c0ac0
parent9b8dacdb264412b919782920da916e306102262a
Improve integer range checking

* src/bignum.c (check_integer_range, check_uinteger_max)
(check_int_nonnegative): New functions.
* src/frame.c (check_frame_pixels): New function.
(Fset_frame_height, Fset_frame_width, Fset_frame_size): Use it.
* src/lisp.h (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER):
Remove these macros.  Unless otherwise specified, all callers
replaced by calls to check_integer_range, check_uinteger_range,
check_int_nonnegative.
* src/frame.c (gui_set_right_divider_width)
(gui_set_bottom_divider_width):
* src/nsfns.m (ns_set_internal_border_width):
* src/xfns.c (x_set_internal_border_width):
Using check_int_nonnegative means these functions no longer
incorrectly reject negative bignums; they treat them as 0,
just like negative fixnums.
16 files changed:
src/bignum.c
src/character.c
src/charset.c
src/coding.c
src/fileio.c
src/frame.c
src/lcms.c
src/lisp.h
src/menu.c
src/nsfns.m
src/process.c
src/search.c
src/w32fns.c
src/window.c
src/xfns.c
src/xwidget.c