summaryrefslogtreecommitdiff
path: root/src/menu.c
diff options
context:
space:
mode:
authorKenichi Handa <handa@m17n.org>2011-05-19 09:37:36 +0900
committerKenichi Handa <handa@m17n.org>2011-05-19 09:37:36 +0900
commit23373930daa192623bfda56960ccb04b2703fbe5 (patch)
tree4350ad7774b3d4dc6f2ccf0e6343b505582e0112 /src/menu.c
parenta28d4396018e48479916fd624e2371aa1f75e6e7 (diff)
parent627abcddd1c45a07d58b9c0cbfd6bb62caf256a9 (diff)
downloademacs-23373930daa192623bfda56960ccb04b2703fbe5.tar.gz
merge trunk
Diffstat (limited to 'src/menu.c')
-rw-r--r--src/menu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/menu.c b/src/menu.c
index 7a3edcb6f4f..e4338f349f6 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -21,6 +21,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
#include <setjmp.h>
+#include <limits.h> /* for INT_MAX */
#include "lisp.h"
#include "keyboard.h"
@@ -176,6 +177,8 @@ save_menu_items (void)
static void
grow_menu_items (void)
{
+ if ((INT_MAX - MENU_ITEMS_PANE_LENGTH) / 2 < menu_items_allocated)
+ memory_full ();
menu_items_allocated *= 2;
menu_items = larger_vector (menu_items, menu_items_allocated, Qnil);
}
@@ -1145,13 +1148,13 @@ no quit occurs and `x-popup-menu' returns nil. */)
#else /* not HAVE_X_WINDOWS */
Lisp_Object bar_window;
enum scroll_bar_part part;
- unsigned long time;
+ Time time;
void (*mouse_position_hook) (struct frame **, int,
Lisp_Object *,
enum scroll_bar_part *,
Lisp_Object *,
Lisp_Object *,
- unsigned long *) =
+ Time *) =
FRAME_TERMINAL (new_f)->mouse_position_hook;
if (mouse_position_hook)