aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert2013-10-08 13:04:40 -0700
committerPaul Eggert2013-10-08 13:04:40 -0700
commit3b158d1150cbbffc77afef323008623ac5c3e169 (patch)
tree41f4cf689afbcc23831c56d5556a1ab46db88d46 /src
parentc7a7f318ff5593331341d05a762a765f52e6bdd2 (diff)
downloademacs-3b158d1150cbbffc77afef323008623ac5c3e169.tar.gz
emacs-3b158d1150cbbffc77afef323008623ac5c3e169.zip
Fix minor problems found by static checking.
* dispnew.c (save_current_matrix): Omit unnecessary casts. * dispnew.c (update_frame_with_menu): Mark debug local as used. * keyboard.c, keyboard.h (Qmouse_movement): Now static. * keyboard.c (read_menu_command): Remove unused local. * lisp.h (read_menu_command): New decl. * menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for benefit of STRING_CHAR_AND_LENGTH. All uses changed. Return ptrdiff_t, not int. * term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t, not int, for benefit of xpalloc. (tty_menu_create, tty_menu_make_room): Simplify by using xzalloc and xpalloc. (have_menus_p): Remove; unused. (tty_menu_add_pane, tty_menu_add_selection): Change signedness of local char * pointer to pacify STRING_CHAR_AND_LENGTH. (tty_menu_add_selection, tty_menu_locate, tty_meny_destroy): Now static. (save_and_enable_current_matrix): Omit unnecessary casts. (read_menu_input): Omit local extern decl (now in lisp.h). Don't access uninitialized storage if mouse_get_xy fails. (tty_menu_activate): Mark local as initialized, for lint. (tty_menu_activate, tty_meny_show): Remove unused locals.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog26
-rw-r--r--src/dispnew.c6
-rw-r--r--src/keyboard.c3
-rw-r--r--src/keyboard.h2
-rw-r--r--src/lisp.h1
-rw-r--r--src/menu.c10
-rw-r--r--src/menu.h2
-rw-r--r--src/term.c80
8 files changed, 67 insertions, 63 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index e30194d1dfb..5196eb230d8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,29 @@
12013-10-08 Paul Eggert <eggert@cs.ucla.edu>
2
3 Fix minor problems found by static checking.
4 * dispnew.c (save_current_matrix): Omit unnecessary casts.
5 * dispnew.c (update_frame_with_menu): Mark debug local as used.
6 * keyboard.c, keyboard.h (Qmouse_movement): Now static.
7 * keyboard.c (read_menu_command): Remove unused local.
8 * lisp.h (read_menu_command): New decl.
9 * menu.c, menu.h (menu_item_width): Arg is now unsigned char *, for
10 benefit of STRING_CHAR_AND_LENGTH. All uses changed.
11 Return ptrdiff_t, not int.
12 * term.c (tty_menu_struct): 'allocated' member is now ptrdiff_t,
13 not int, for benefit of xpalloc.
14 (tty_menu_create, tty_menu_make_room): Simplify by using xzalloc
15 and xpalloc.
16 (have_menus_p): Remove; unused.
17 (tty_menu_add_pane, tty_menu_add_selection): Change signedness of
18 local char * pointer to pacify STRING_CHAR_AND_LENGTH.
19 (tty_menu_add_selection, tty_menu_locate, tty_meny_destroy):
20 Now static.
21 (save_and_enable_current_matrix): Omit unnecessary casts.
22 (read_menu_input): Omit local extern decl (now in lisp.h).
23 Don't access uninitialized storage if mouse_get_xy fails.
24 (tty_menu_activate): Mark local as initialized, for lint.
25 (tty_menu_activate, tty_meny_show): Remove unused locals.
26
12013-10-08 Eli Zaretskii <eliz@gnu.org> 272013-10-08 Eli Zaretskii <eliz@gnu.org>
2 28
3 Support menus on text-mode terminals. 29 Support menus on text-mode terminals.
diff --git a/src/dispnew.c b/src/dispnew.c
index f5d213e03f4..f5adb359f22 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -1853,7 +1853,7 @@ save_current_matrix (struct frame *f)
1853 if (from->used[LEFT_MARGIN_AREA]) 1853 if (from->used[LEFT_MARGIN_AREA])
1854 { 1854 {
1855 nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph); 1855 nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph);
1856 to->glyphs[LEFT_MARGIN_AREA] = (struct glyph *) xmalloc (nbytes); 1856 to->glyphs[LEFT_MARGIN_AREA] = xmalloc (nbytes);
1857 memcpy (to->glyphs[LEFT_MARGIN_AREA], 1857 memcpy (to->glyphs[LEFT_MARGIN_AREA],
1858 from->glyphs[LEFT_MARGIN_AREA], nbytes); 1858 from->glyphs[LEFT_MARGIN_AREA], nbytes);
1859 to->used[LEFT_MARGIN_AREA] = from->used[LEFT_MARGIN_AREA]; 1859 to->used[LEFT_MARGIN_AREA] = from->used[LEFT_MARGIN_AREA];
@@ -1861,7 +1861,7 @@ save_current_matrix (struct frame *f)
1861 if (from->used[RIGHT_MARGIN_AREA]) 1861 if (from->used[RIGHT_MARGIN_AREA])
1862 { 1862 {
1863 nbytes = from->used[RIGHT_MARGIN_AREA] * sizeof (struct glyph); 1863 nbytes = from->used[RIGHT_MARGIN_AREA] * sizeof (struct glyph);
1864 to->glyphs[RIGHT_MARGIN_AREA] = (struct glyph *) xmalloc (nbytes); 1864 to->glyphs[RIGHT_MARGIN_AREA] = xmalloc (nbytes);
1865 memcpy (to->glyphs[RIGHT_MARGIN_AREA], 1865 memcpy (to->glyphs[RIGHT_MARGIN_AREA],
1866 from->glyphs[RIGHT_MARGIN_AREA], nbytes); 1866 from->glyphs[RIGHT_MARGIN_AREA], nbytes);
1867 to->used[RIGHT_MARGIN_AREA] = from->used[RIGHT_MARGIN_AREA]; 1867 to->used[RIGHT_MARGIN_AREA] = from->used[RIGHT_MARGIN_AREA];
@@ -3123,6 +3123,8 @@ update_frame_with_menu (struct frame *f)
3123 check_window_matrix_pointers (root_window); 3123 check_window_matrix_pointers (root_window);
3124#endif 3124#endif
3125 add_frame_display_history (f, paused_p); 3125 add_frame_display_history (f, paused_p);
3126#else
3127 IF_LINT ((void) paused_p);
3126#endif 3128#endif
3127 3129
3128 /* Reset flags indicating that a window should be updated. */ 3130 /* Reset flags indicating that a window should be updated. */
diff --git a/src/keyboard.c b/src/keyboard.c
index 352402349c0..669e85518f1 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -289,7 +289,7 @@ static struct input_event * volatile kbd_store_ptr;
289 at inopportune times. */ 289 at inopportune times. */
290 290
291/* Symbols to head events. */ 291/* Symbols to head events. */
292Lisp_Object Qmouse_movement; 292static Lisp_Object Qmouse_movement;
293static Lisp_Object Qscroll_bar_movement; 293static Lisp_Object Qscroll_bar_movement;
294Lisp_Object Qswitch_frame; 294Lisp_Object Qswitch_frame;
295static Lisp_Object Qfocus_in, Qfocus_out; 295static Lisp_Object Qfocus_in, Qfocus_out;
@@ -1696,7 +1696,6 @@ command_loop_1 (void)
1696Lisp_Object 1696Lisp_Object
1697read_menu_command (void) 1697read_menu_command (void)
1698{ 1698{
1699 Lisp_Object cmd;
1700 Lisp_Object keybuf[30]; 1699 Lisp_Object keybuf[30];
1701 ptrdiff_t count = SPECPDL_INDEX (); 1700 ptrdiff_t count = SPECPDL_INDEX ();
1702 int i; 1701 int i;
diff --git a/src/keyboard.h b/src/keyboard.h
index 8a8505e406b..49f87b20a43 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -450,7 +450,7 @@ extern Lisp_Object Qswitch_frame;
450extern Lisp_Object Qevent_kind; 450extern Lisp_Object Qevent_kind;
451 451
452/* The values of Qevent_kind properties. */ 452/* The values of Qevent_kind properties. */
453extern Lisp_Object Qmouse_click, Qmouse_movement; 453extern Lisp_Object Qmouse_click;
454 454
455extern Lisp_Object Qhelp_echo; 455extern Lisp_Object Qhelp_echo;
456 456
diff --git a/src/lisp.h b/src/lisp.h
index 3e63aa0255f..3773398d773 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -3905,6 +3905,7 @@ extern bool detect_input_pending_run_timers (bool);
3905extern void safe_run_hooks (Lisp_Object); 3905extern void safe_run_hooks (Lisp_Object);
3906extern void cmd_error_internal (Lisp_Object, const char *); 3906extern void cmd_error_internal (Lisp_Object, const char *);
3907extern Lisp_Object command_loop_1 (void); 3907extern Lisp_Object command_loop_1 (void);
3908extern Lisp_Object read_menu_command (void);
3908extern Lisp_Object recursive_edit_1 (void); 3909extern Lisp_Object recursive_edit_1 (void);
3909extern void record_auto_save (void); 3910extern void record_auto_save (void);
3910extern void force_auto_save_soon (void); 3911extern void force_auto_save_soon (void);
diff --git a/src/menu.c b/src/menu.c
index f741d686cd1..9e135b56ce5 100644
--- a/src/menu.c
+++ b/src/menu.c
@@ -1036,11 +1036,11 @@ find_and_return_menu_selection (struct frame *f, bool keymaps, void *client_data
1036} 1036}
1037#endif /* HAVE_NS */ 1037#endif /* HAVE_NS */
1038 1038
1039int 1039ptrdiff_t
1040menu_item_width (const char *str) 1040menu_item_width (const unsigned char *str)
1041{ 1041{
1042 int len; 1042 ptrdiff_t len;
1043 const char *p; 1043 const unsigned char *p;
1044 1044
1045 for (len = 0, p = str; *p; ) 1045 for (len = 0, p = str; *p; )
1046 { 1046 {
@@ -1104,7 +1104,7 @@ into menu items. */)
1104 if (XINT (pos) <= col 1104 if (XINT (pos) <= col
1105 /* We use <= so the blank between 2 items on a TTY is 1105 /* We use <= so the blank between 2 items on a TTY is
1106 considered part of the previous item. */ 1106 considered part of the previous item. */
1107 && col <= XINT (pos) + menu_item_width (SSDATA (str))) 1107 && col <= XINT (pos) + menu_item_width (SDATA (str)))
1108 { 1108 {
1109 item = AREF (items, i); 1109 item = AREF (items, i);
1110 return item; 1110 return item;
diff --git a/src/menu.h b/src/menu.h
index 9b3b71d757e..c83f7431c45 100644
--- a/src/menu.h
+++ b/src/menu.h
@@ -53,5 +53,5 @@ extern Lisp_Object xmenu_show (struct frame *, int, int, bool, bool,
53 Lisp_Object, const char **, Time); 53 Lisp_Object, const char **, Time);
54extern Lisp_Object tty_menu_show (struct frame *, int, int, int, int, 54extern Lisp_Object tty_menu_show (struct frame *, int, int, int, int,
55 Lisp_Object, int, const char **); 55 Lisp_Object, int, const char **);
56extern int menu_item_width (const char *); 56extern ptrdiff_t menu_item_width (const unsigned char *);
57#endif /* MENU_H */ 57#endif /* MENU_H */
diff --git a/src/term.c b/src/term.c
index 6d53664949e..c357f04cdc6 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2814,7 +2814,7 @@ typedef struct tty_menu_struct
2814 char **text; 2814 char **text;
2815 struct tty_menu_struct **submenu; 2815 struct tty_menu_struct **submenu;
2816 int *panenumber; /* Also used as enabled flag. */ 2816 int *panenumber; /* Also used as enabled flag. */
2817 int allocated; 2817 ptrdiff_t allocated;
2818 int panecount; 2818 int panecount;
2819 int width; 2819 int width;
2820 const char **help_text; 2820 const char **help_text;
@@ -2825,38 +2825,27 @@ typedef struct tty_menu_struct
2825static tty_menu * 2825static tty_menu *
2826tty_menu_create (void) 2826tty_menu_create (void)
2827{ 2827{
2828 tty_menu *menu; 2828 return xzalloc (sizeof *tty_menu_create ());
2829
2830 menu = (tty_menu *) xmalloc (sizeof (tty_menu));
2831 menu->allocated = menu->count = menu->panecount = menu->width = 0;
2832 return menu;
2833} 2829}
2834 2830
2835/* Allocate some (more) memory for MENU ensuring that there is room for one 2831/* Allocate some (more) memory for MENU ensuring that there is room for one
2836 for item. */ 2832 more item. */
2837 2833
2838static void 2834static void
2839tty_menu_make_room (tty_menu *menu) 2835tty_menu_make_room (tty_menu *menu)
2840{ 2836{
2841 if (menu->allocated == 0) 2837 if (menu->allocated == menu->count)
2842 {
2843 int count = menu->allocated = 10;
2844 menu->text = (char **) xmalloc (count * sizeof (char *));
2845 menu->submenu = (tty_menu **) xmalloc (count * sizeof (tty_menu *));
2846 menu->panenumber = (int *) xmalloc (count * sizeof (int));
2847 menu->help_text = (const char **) xmalloc (count * sizeof (char *));
2848 }
2849 else if (menu->allocated == menu->count)
2850 { 2838 {
2851 int count = menu->allocated = menu->allocated + 10; 2839 ptrdiff_t allocated = menu->allocated;
2852 menu->text 2840 menu->text = xpalloc (menu->text, &allocated, 1, -1, sizeof *menu->text);
2853 = (char **) xrealloc (menu->text, count * sizeof (char *)); 2841 menu->text = xrealloc (menu->text, allocated * sizeof *menu->text);
2854 menu->submenu 2842 menu->submenu = xrealloc (menu->submenu,
2855 = (tty_menu **) xrealloc (menu->submenu, count * sizeof (tty_menu *)); 2843 allocated * sizeof *menu->submenu);
2856 menu->panenumber 2844 menu->panenumber = xrealloc (menu->panenumber,
2857 = (int *) xrealloc (menu->panenumber, count * sizeof (int)); 2845 allocated * sizeof *menu->panenumber);
2858 menu->help_text 2846 menu->help_text = xrealloc (menu->help_text,
2859 = (const char **) xrealloc (menu->help_text, count * sizeof (char *)); 2847 allocated * sizeof *menu->help_text);
2848 menu->allocated = allocated;
2860 } 2849 }
2861} 2850}
2862 2851
@@ -2965,18 +2954,13 @@ tty_menu_display (tty_menu *menu, int x, int y, int pn, int *faces,
2965 2954
2966/* --------------------------- X Menu emulation ---------------------- */ 2955/* --------------------------- X Menu emulation ---------------------- */
2967 2956
2968/* Report availability of menus. */
2969
2970int
2971have_menus_p (void) { return 1; }
2972
2973/* Create a new pane and place it on the outer-most level. */ 2957/* Create a new pane and place it on the outer-most level. */
2974 2958
2975static int 2959static int
2976tty_menu_add_pane (tty_menu *menu, const char *txt) 2960tty_menu_add_pane (tty_menu *menu, const char *txt)
2977{ 2961{
2978 int len; 2962 int len;
2979 const char *p; 2963 const unsigned char *p;
2980 2964
2981 tty_menu_make_room (menu); 2965 tty_menu_make_room (menu);
2982 menu->submenu[menu->count] = tty_menu_create (); 2966 menu->submenu[menu->count] = tty_menu_create ();
@@ -2986,7 +2970,7 @@ tty_menu_add_pane (tty_menu *menu, const char *txt)
2986 menu->count++; 2970 menu->count++;
2987 2971
2988 /* Update the menu width, if necessary. */ 2972 /* Update the menu width, if necessary. */
2989 for (len = 0, p = txt; *p; ) 2973 for (len = 0, p = (unsigned char *) txt; *p; )
2990 { 2974 {
2991 int ch_len; 2975 int ch_len;
2992 int ch = STRING_CHAR_AND_LENGTH (p, ch_len); 2976 int ch = STRING_CHAR_AND_LENGTH (p, ch_len);
@@ -3003,12 +2987,12 @@ tty_menu_add_pane (tty_menu *menu, const char *txt)
3003 2987
3004/* Create a new item in a menu pane. */ 2988/* Create a new item in a menu pane. */
3005 2989
3006int 2990static int
3007tty_menu_add_selection (tty_menu *menu, int pane, 2991tty_menu_add_selection (tty_menu *menu, int pane,
3008 char *txt, int enable, char const *help_text) 2992 char *txt, int enable, char const *help_text)
3009{ 2993{
3010 int len; 2994 int len;
3011 char *p; 2995 unsigned char *p;
3012 2996
3013 if (pane) 2997 if (pane)
3014 if (!(menu = tty_menu_search_pane (menu, pane))) 2998 if (!(menu = tty_menu_search_pane (menu, pane)))
@@ -3021,7 +3005,7 @@ tty_menu_add_selection (tty_menu *menu, int pane,
3021 menu->count++; 3005 menu->count++;
3022 3006
3023 /* Update the menu width, if necessary. */ 3007 /* Update the menu width, if necessary. */
3024 for (len = 0, p = txt; *p; ) 3008 for (len = 0, p = (unsigned char *) txt; *p; )
3025 { 3009 {
3026 int ch_len; 3010 int ch_len;
3027 int ch = STRING_CHAR_AND_LENGTH (p, ch_len); 3011 int ch = STRING_CHAR_AND_LENGTH (p, ch_len);
@@ -3038,7 +3022,7 @@ tty_menu_add_selection (tty_menu *menu, int pane,
3038 3022
3039/* Decide where the menu would be placed if requested at (X,Y). */ 3023/* Decide where the menu would be placed if requested at (X,Y). */
3040 3024
3041void 3025static void
3042tty_menu_locate (tty_menu *menu, int x, int y, 3026tty_menu_locate (tty_menu *menu, int x, int y,
3043 int *ulx, int *uly, int *width, int *height) 3027 int *ulx, int *uly, int *width, int *height)
3044{ 3028{
@@ -3085,7 +3069,7 @@ save_and_enable_current_matrix (struct frame *f)
3085 if (from->used[LEFT_MARGIN_AREA]) 3069 if (from->used[LEFT_MARGIN_AREA])
3086 { 3070 {
3087 nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph); 3071 nbytes = from->used[LEFT_MARGIN_AREA] * sizeof (struct glyph);
3088 to->glyphs[LEFT_MARGIN_AREA] = (struct glyph *) xmalloc (nbytes); 3072 to->glyphs[LEFT_MARGIN_AREA] = xmalloc (nbytes);
3089 memcpy (to->glyphs[LEFT_MARGIN_AREA], 3073 memcpy (to->glyphs[LEFT_MARGIN_AREA],
3090 from->glyphs[LEFT_MARGIN_AREA], nbytes); 3074 from->glyphs[LEFT_MARGIN_AREA], nbytes);
3091 to->used[LEFT_MARGIN_AREA] = from->used[LEFT_MARGIN_AREA]; 3075 to->used[LEFT_MARGIN_AREA] = from->used[LEFT_MARGIN_AREA];
@@ -3093,7 +3077,7 @@ save_and_enable_current_matrix (struct frame *f)
3093 if (from->used[RIGHT_MARGIN_AREA]) 3077 if (from->used[RIGHT_MARGIN_AREA])
3094 { 3078 {
3095 nbytes = from->used[RIGHT_MARGIN_AREA] * sizeof (struct glyph); 3079 nbytes = from->used[RIGHT_MARGIN_AREA] * sizeof (struct glyph);
3096 to->glyphs[RIGHT_MARGIN_AREA] = (struct glyph *) xmalloc (nbytes); 3080 to->glyphs[RIGHT_MARGIN_AREA] = xmalloc (nbytes);
3097 memcpy (to->glyphs[RIGHT_MARGIN_AREA], 3081 memcpy (to->glyphs[RIGHT_MARGIN_AREA],
3098 from->glyphs[RIGHT_MARGIN_AREA], nbytes); 3082 from->glyphs[RIGHT_MARGIN_AREA], nbytes);
3099 to->used[RIGHT_MARGIN_AREA] = from->used[RIGHT_MARGIN_AREA]; 3083 to->used[RIGHT_MARGIN_AREA] = from->used[RIGHT_MARGIN_AREA];
@@ -3194,7 +3178,6 @@ read_menu_input (struct frame *sf, int *x, int *y, int min_y, int max_y,
3194 } 3178 }
3195 else 3179 else
3196 { 3180 {
3197 extern Lisp_Object read_menu_command (void);
3198 Lisp_Object cmd; 3181 Lisp_Object cmd;
3199 int usable_input = 1; 3182 int usable_input = 1;
3200 int st = 0; 3183 int st = 0;
@@ -3215,13 +3198,7 @@ read_menu_input (struct frame *sf, int *x, int *y, int min_y, int max_y,
3215 if (EQ (cmd, Qt) || EQ (cmd, Qtty_menu_exit)) 3198 if (EQ (cmd, Qt) || EQ (cmd, Qtty_menu_exit))
3216 return -1; 3199 return -1;
3217 if (EQ (cmd, Qtty_menu_mouse_movement)) 3200 if (EQ (cmd, Qtty_menu_mouse_movement))
3218 { 3201 mouse_get_xy (x, y);
3219 int mx, my;
3220
3221 mouse_get_xy (&mx, &my);
3222 *x = mx;
3223 *y = my;
3224 }
3225 else if (EQ (cmd, Qtty_menu_next_menu)) 3202 else if (EQ (cmd, Qtty_menu_next_menu))
3226 { 3203 {
3227 usable_input = 0; 3204 usable_input = 0;
@@ -3261,13 +3238,14 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3261 int kbd_navigation) 3238 int kbd_navigation)
3262{ 3239{
3263 struct tty_menu_state *state; 3240 struct tty_menu_state *state;
3264 int statecount, x, y, i, b, leave, result, onepane; 3241 int statecount, x, y, i, leave, onepane;
3242 int result IF_LINT (= 0);
3265 int title_faces[4]; /* face to display the menu title */ 3243 int title_faces[4]; /* face to display the menu title */
3266 int faces[4], buffers_num_deleted = 0; 3244 int faces[4], buffers_num_deleted = 0;
3267 struct frame *sf = SELECTED_FRAME (); 3245 struct frame *sf = SELECTED_FRAME ();
3268 struct tty_display_info *tty = FRAME_TTY (sf); 3246 struct tty_display_info *tty = FRAME_TTY (sf);
3269 bool first_time; 3247 bool first_time;
3270 Lisp_Object saved_echo_area_message, selectface; 3248 Lisp_Object selectface;
3271 3249
3272 /* Don't allow non-positive x0 and y0, lest the menu will wrap 3250 /* Don't allow non-positive x0 and y0, lest the menu will wrap
3273 around the display. */ 3251 around the display. */
@@ -3465,7 +3443,7 @@ tty_menu_activate (tty_menu *menu, int *pane, int *selidx,
3465 3443
3466/* Dispose of a menu. */ 3444/* Dispose of a menu. */
3467 3445
3468void 3446static void
3469tty_menu_destroy (tty_menu *menu) 3447tty_menu_destroy (tty_menu *menu)
3470{ 3448{
3471 int i; 3449 int i;
@@ -3576,7 +3554,7 @@ tty_menu_new_item_coords (struct frame *f, int which, int *x, int *y)
3576 if (ix <= *x 3554 if (ix <= *x
3577 /* We use <= so the blank between 2 items on a TTY is 3555 /* We use <= so the blank between 2 items on a TTY is
3578 considered part of the previous item. */ 3556 considered part of the previous item. */
3579 && *x <= ix + menu_item_width (SSDATA (str))) 3557 && *x <= ix + menu_item_width (SDATA (str)))
3580 { 3558 {
3581 /* Found current item. Now compute the X coordinate of 3559 /* Found current item. Now compute the X coordinate of
3582 the previous or next item. */ 3560 the previous or next item. */
@@ -3614,8 +3592,6 @@ tty_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
3614 int dispwidth, dispheight; 3592 int dispwidth, dispheight;
3615 int i, j, lines, maxlines; 3593 int i, j, lines, maxlines;
3616 int maxwidth; 3594 int maxwidth;
3617 int dummy_int;
3618 unsigned int dummy_uint;
3619 ptrdiff_t specpdl_count = SPECPDL_INDEX (); 3595 ptrdiff_t specpdl_count = SPECPDL_INDEX ();
3620 3596
3621 if (! FRAME_TERMCAP_P (f)) 3597 if (! FRAME_TERMCAP_P (f))