diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2015-04-13 23:26:13 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2015-04-13 23:26:59 -0700 |
commit | b80c5ebc4f6afd54597012583c6a1390db0ade9c (patch) | |
tree | 96d02d47732d4dd9fd3c16f66db9fd929b4efd41 /src/window.h | |
parent | e84d1ca3c6a643370c4273ad569b618d8cd72b53 (diff) | |
download | emacs-b80c5ebc4f6afd54597012583c6a1390db0ade9c.tar.gz |
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'.
Diffstat (limited to 'src/window.h')
-rw-r--r-- | src/window.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/window.h b/src/window.h index 96e7438f46e..eaff57eaedf 100644 --- a/src/window.h +++ b/src/window.h @@ -195,10 +195,10 @@ struct window Lisp_Object next_buffers; /* Number saying how recently window was selected. */ - int use_time; + EMACS_INT use_time; /* Unique number of window assigned when it was created. */ - int sequence_number; + EMACS_INT sequence_number; /* The upper left corner pixel coordinates of this window, as integers relative to upper left corner of frame = 0, 0. */ @@ -990,7 +990,7 @@ extern Lisp_Object selected_window; recently used window. Its only users are Fselect_window, init_window_once, and make_frame. */ -extern int window_select_count; +extern EMACS_INT window_select_count; /* The minibuffer window of the selected frame. Note that you cannot test for minibufferness of an arbitrary window |