• Paul Eggert's avatar
    Avoid some int overflows in window.c · b80c5ebc
    Paul Eggert authored
    * 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'.
print.c 67.7 KB