2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
+ * xmenu.c (menu_help_callback): Pointer type fixes.
+ Use const pointers when pointing at readonly data. Avoid pointer
+ signedness clashes.
+ (FALSE): Remove unused macro.
+ (update_frame_menubar): Remove unused decl.
+
* xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
* menu.c (push_submenu_start, push_submenu_end): Do not define unless
#ifndef TRUE
#define TRUE 1
-#define FALSE 0
#endif /* no TRUE */
static Lisp_Object Qdebug_on_next_call;
static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object,
const char **);
#endif
-
-static int update_frame_menubar (struct frame *);
\f
/* Flag which when set indicates a dialog or menu has been posted by
Xt on behalf of one of the widget sets. */
keyboard events. */
static void
-menu_help_callback (char *help_string, int pane, int item)
+menu_help_callback (char const *help_string, int pane, int item)
{
Lisp_Object *first_item;
Lisp_Object pane_name;
{
/* Create a new item within current pane. */
Lisp_Object item_name, enable, descrip, help;
- unsigned char *item_data;
- char *help_string;
+ char *item_data;
+ char const *help_string;
item_name = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_NAME];
enable = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_ENABLE];
descrip
= XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_EQUIV_KEY];
help = XVECTOR (menu_items)->contents[i + MENU_ITEMS_ITEM_HELP];
- help_string = STRINGP (help) ? SDATA (help) : NULL;
+ help_string = STRINGP (help) ? SSDATA (help) : NULL;
if (!NILP (descrip))
{
- int gap = maxwidth - SBYTES (item_name);
/* if alloca is fast, use that to make the space,
to reduce gc needs. */
- item_data
- = (unsigned char *) alloca (maxwidth
- + SBYTES (descrip) + 1);
- memcpy (item_data, SDATA (item_name), SBYTES (item_name));
+ item_data = (char *) alloca (maxwidth + SBYTES (descrip) + 1);
+ memcpy (item_data, SSDATA (item_name), SBYTES (item_name));
for (j = SCHARS (item_name); j < maxwidth; j++)
item_data[j] = ' ';
- memcpy (item_data + j, SDATA (descrip), SBYTES (descrip));
+ memcpy (item_data + j, SSDATA (descrip), SBYTES (descrip));
item_data[j + SBYTES (descrip)] = 0;
}
else
- item_data = SDATA (item_name);
+ item_data = SSDATA (item_name);
if (XMenuAddSelection (FRAME_X_DISPLAY (f),
menu, lpane, 0, item_data,