diff options
| author | Paul Eggert | 2011-07-28 16:58:05 -0700 |
|---|---|---|
| committer | Paul Eggert | 2011-07-28 16:58:05 -0700 |
| commit | 0eb0f3187d46ec0efdfc1df38565c160c759ecb2 (patch) | |
| tree | 2f87e3fc4534e20652a07cd897d3e55c5819c247 /src/gtkutil.h | |
| parent | 1ffd9c92ea38e078ec6cde6277c7ce88895212df (diff) | |
| download | emacs-0eb0f3187d46ec0efdfc1df38565c160c759ecb2.tar.gz emacs-0eb0f3187d46ec0efdfc1df38565c160c759ecb2.zip | |
* gtkutil.c: Integer overflow fixes.
(get_utf8_string, xg_store_widget_in_map):
Check for size-calculation overflow.
(get_utf8_string): Use ptrdiff_t, not size_t, where either will
do, as we prefer signed integers.
(id_to_widget.max_size, id_to_widget.used)
(xg_store_widget_in_map, xg_remove_widget_from_map)
(xg_get_widget_from_map, xg_get_scroll_id_for_window)
(xg_remove_scroll_bar, xg_update_scrollbar_pos):
Use and return ptrdiff_t, not int.
(xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
* gtkutil.h: Change prototypes to match the above.
Diffstat (limited to 'src/gtkutil.h')
| -rw-r--r-- | src/gtkutil.h | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gtkutil.h b/src/gtkutil.h index 769e56da917..2dfb3a5ed6c 100644 --- a/src/gtkutil.h +++ b/src/gtkutil.h | |||
| @@ -114,17 +114,17 @@ extern int xg_event_is_for_menubar (FRAME_PTR f, XEvent *event); | |||
| 114 | 114 | ||
| 115 | extern int xg_have_tear_offs (void); | 115 | extern int xg_have_tear_offs (void); |
| 116 | 116 | ||
| 117 | extern int xg_get_scroll_id_for_window (Display *dpy, Window wid); | 117 | extern ptrdiff_t xg_get_scroll_id_for_window (Display *dpy, Window wid); |
| 118 | 118 | ||
| 119 | extern void xg_create_scroll_bar (FRAME_PTR f, | 119 | extern void xg_create_scroll_bar (FRAME_PTR f, |
| 120 | struct scroll_bar *bar, | 120 | struct scroll_bar *bar, |
| 121 | GCallback scroll_callback, | 121 | GCallback scroll_callback, |
| 122 | GCallback end_callback, | 122 | GCallback end_callback, |
| 123 | const char *scroll_bar_name); | 123 | const char *scroll_bar_name); |
| 124 | extern void xg_remove_scroll_bar (FRAME_PTR f, int scrollbar_id); | 124 | extern void xg_remove_scroll_bar (FRAME_PTR f, ptrdiff_t scrollbar_id); |
| 125 | 125 | ||
| 126 | extern void xg_update_scrollbar_pos (FRAME_PTR f, | 126 | extern void xg_update_scrollbar_pos (FRAME_PTR f, |
| 127 | int scrollbar_id, | 127 | ptrdiff_t scrollbar_id, |
| 128 | int top, | 128 | int top, |
| 129 | int left, | 129 | int left, |
| 130 | int width, | 130 | int width, |
| @@ -185,4 +185,3 @@ extern int xg_ignore_gtk_scrollbar; | |||
| 185 | 185 | ||
| 186 | #endif /* USE_GTK */ | 186 | #endif /* USE_GTK */ |
| 187 | #endif /* GTKUTIL_H */ | 187 | #endif /* GTKUTIL_H */ |
| 188 | |||