]> git.eshelyaron.com Git - emacs.git/commit
Avoid some int overflows in window.c
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Apr 2015 06:26:13 +0000 (23:26 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 14 Apr 2015 06:26:59 +0000 (23:26 -0700)
commitb80c5ebc4f6afd54597012583c6a1390db0ade9c
tree96d02d47732d4dd9fd3c16f66db9fd929b4efd41
parente84d1ca3c6a643370c4273ad569b618d8cd72b53
Avoid some int overflows in window.c

* src/print.c (print_object):
* src/window.c (sequence_number):
* src/window.h (struct window.sequence_number):
Don't assume window sequence number fits in int.
* src/window.c (window_select_count):
* src/window.h (struct window.use_time, window_select_count):
Don't assume window use time fits in int.
* src/window.c (Fsplit_window_internal):
Don't assume user-supplied integer, or sum, fits in int.
(Fset_window_configuration, count_windows, get_leaf_windows)
(save_window_save, Fcurrent_window_configuration):
Use ptrdiff_t for object counts.
(Fset_window_configuration): Omit unused local 'n'.
(count_windows): Simplify by writing in terms of get_leaf_windows.
(get_leaf_windows): Don't store through FLAT if it's null.
(extract_dimension): New static function.
(set_window_margins, set_window_fringes, set_window_scroll_bars):
Use it to avoid undefined behavior when converting user-supplied
integer to 'int'.
src/print.c
src/window.c
src/window.h