Commit 42ca4633 authored by Jan D's avatar Jan D

Fix -Wwrite_strings in general and for Gtk+ specific code.

* callproc.c (synch_process_death): Make const.
(Fcall_process): Make signame const.

* emacs.c (main): Pass char[] to putenv instead of literal.

* floatfns.c (matherr): Use a const char* variable for x->name.

* font.c (font_open_by_name): Make name const.

* font.h (font_open_by_name): Make name const.

* gtkutil.c (get_utf8_string): Always return an allocated string.
Parameter is const.
(create_dialog, xg_create_one_menuitem, create_menus)
(xg_item_label_same_p, xg_update_menu_item): Free result from
get_utf8_string.
(xg_separator_p, xg_item_label_same_p): label is const.

* gtkutil.h: Replace widget_value with struct _widget_value.
(enum button_type, struct _widget_value): Remove and use the one from
keyboard.h.

* keyboard.h (_widget_value): Add defined USE_GTK.  Replace Boolean
with unsigned char and XtPointer with void *.

* menu.c (Fx_popup_menu): error_name is const.

* menu.h (w32_menu_show, ns_menu_show, xmenu_show): error parameter
is const char **.

* w32menu.c (w32_menu_show):
* nsmenu.m (ns_menu_show): error parameter is const char **.

* process.h (synch_process_death): Is const char*.

* xmenu.c (Fx_popup_dialog): error_name is const char*.
(xmenu_show): error parameter is const char **. pane_string is const
char *.
(button_names): Is const char *.
(xdialog_show): error_name and pane_string is const.

* xrdb.c (get_system_app): Make path const and use char *p for non-const
char.

* xselect.c (Fx_get_atom_name): Use char empty[] instead of literal "".

* xsmfns.c (NOSPLASH_OPT): Change to char[].
(smc_save_yourself_CB): Do xstrdup on all ->type and ->name for
props.  Free them at the end.

* xterm.c (emacs_class): New char[] for EMACS_CLASS.
(xim_open_dpy, xim_initialize, xim_close_dpy): Use emacs_class.
(x_term_init): Use char[] display_opt and name_opt instead of
string literal. file is const char*.
parent 5e3b9a89
2010-08-11 Jan Djärv <jan.h.d@swipnet.se> 2010-08-11 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (emacs_class): New char[] for EMACS_CLASS.
(xim_open_dpy, xim_initialize, xim_close_dpy): Use emacs_class.
(x_term_init): Use char[] display_opt and name_opt instead of
string literal. file is const char*.
* xsmfns.c (NOSPLASH_OPT): Change to char[].
(smc_save_yourself_CB): Do xstrdup on all ->type and ->name for
props. Free them at the end.
* xselect.c (Fx_get_atom_name): Use char empty[] instead of literal "".
* xrdb.c (get_system_app): Make path const and use char *p for non-const
char.
* xmenu.c (Fx_popup_dialog): error_name is const char*.
(xmenu_show): error parameter is const char **. pane_string is const
char *.
(button_names): Is const char *.
(xdialog_show): error_name and pane_string is const.
* process.h (synch_process_death): Is const char*.
* w32menu.c (w32_menu_show):
* nsmenu.m (ns_menu_show): error parameter is const char **.
* menu.h (w32_menu_show, ns_menu_show, xmenu_show): error parameter
is const char **.
* menu.c (Fx_popup_menu): error_name is const.
* keyboard.h (_widget_value): Add defined USE_GTK. Replace Boolean
with unsigned char and XtPointer with void *.
* gtkutil.h: Replace widget_value with struct _widget_value.
(enum button_type, struct _widget_value): Remove and use the one from
keyboard.h.
* gtkutil.c (get_utf8_string): Always return an allocated string.
Parameter is const.
(create_dialog, xg_create_one_menuitem, create_menus)
(xg_item_label_same_p, xg_update_menu_item): Free result from
get_utf8_string.
(xg_separator_p, xg_item_label_same_p): label is const.
* font.h (font_open_by_name): Make name const.
* font.c (font_open_by_name): Make name const.
* floatfns.c (matherr): Use a const char* variable for x->name.
* emacs.c (main): Pass char[] to putenv instead of literal.
* callproc.c (synch_process_death): Make const.
(Fcall_process): Make signame const.
* nsterm.h (parseKeyEquiv, addSubmenuWithTitle) * nsterm.h (parseKeyEquiv, addSubmenuWithTitle)
(addDisplayItemWithImage): Use const char*. (addDisplayItemWithImage): Use const char*.
......
...@@ -115,7 +115,7 @@ Lisp_Object Qbuffer_file_type; ...@@ -115,7 +115,7 @@ Lisp_Object Qbuffer_file_type;
int synch_process_alive; int synch_process_alive;
/* Nonzero => this is a string explaining death of synchronous subprocess. */ /* Nonzero => this is a string explaining death of synchronous subprocess. */
char *synch_process_death; const char *synch_process_death;
/* Nonzero => this is the signal number that terminated the subprocess. */ /* Nonzero => this is the signal number that terminated the subprocess. */
int synch_process_termsig; int synch_process_termsig;
...@@ -818,7 +818,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */) ...@@ -818,7 +818,7 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS) */)
if (synch_process_termsig) if (synch_process_termsig)
{ {
char *signame; const char *signame;
synchronize_system_messages_locale (); synchronize_system_messages_locale ();
signame = strsignal (synch_process_termsig); signame = strsignal (synch_process_termsig);
......
...@@ -839,8 +839,9 @@ main (int argc, char **argv) ...@@ -839,8 +839,9 @@ main (int argc, char **argv)
|| strcmp (argv[argc-1], "bootstrap") == 0) || strcmp (argv[argc-1], "bootstrap") == 0)
&& ! getenv ("EMACS_HEAP_EXEC")) && ! getenv ("EMACS_HEAP_EXEC"))
{ {
static char heapexec[] = "EMACS_HEAP_EXEC=true";
/* Set this so we only do this once. */ /* Set this so we only do this once. */
putenv("EMACS_HEAP_EXEC=true"); putenv(heapexec);
/* A flag to turn off address randomization which is introduced /* A flag to turn off address randomization which is introduced
in linux kernel shipped with fedora core 4 */ in linux kernel shipped with fedora core 4 */
......
...@@ -987,16 +987,18 @@ int ...@@ -987,16 +987,18 @@ int
matherr (struct exception *x) matherr (struct exception *x)
{ {
Lisp_Object args; Lisp_Object args;
const char *name = x->name;
if (! in_float) if (! in_float)
/* Not called from emacs-lisp float routines; do the default thing. */ /* Not called from emacs-lisp float routines; do the default thing. */
return 0; return 0;
if (!strcmp (x->name, "pow")) if (!strcmp (x->name, "pow"))
x->name = "expt"; name = "expt";
args args
= Fcons (build_string (x->name), = Fcons (build_string (name),
Fcons (make_float (x->arg1), Fcons (make_float (x->arg1),
((!strcmp (x->name, "log") || !strcmp (x->name, "pow")) ((!strcmp (name, "log") || !strcmp (name, "pow"))
? Fcons (make_float (x->arg2), Qnil) ? Fcons (make_float (x->arg2), Qnil)
: Qnil))); : Qnil)));
switch (x->type) switch (x->type)
......
...@@ -3506,7 +3506,7 @@ font_open_by_spec (FRAME_PTR f, Lisp_Object spec) ...@@ -3506,7 +3506,7 @@ font_open_by_spec (FRAME_PTR f, Lisp_Object spec)
found, return Qnil. */ found, return Qnil. */
Lisp_Object Lisp_Object
font_open_by_name (FRAME_PTR f, char *name) font_open_by_name (FRAME_PTR f, const char *name)
{ {
Lisp_Object args[2]; Lisp_Object args[2];
Lisp_Object spec, ret; Lisp_Object spec, ret;
......
...@@ -783,7 +783,7 @@ extern void font_prepare_for_face (FRAME_PTR f, struct face *face); ...@@ -783,7 +783,7 @@ extern void font_prepare_for_face (FRAME_PTR f, struct face *face);
extern void font_done_for_face (FRAME_PTR f, struct face *face); extern void font_done_for_face (FRAME_PTR f, struct face *face);
extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec); extern Lisp_Object font_open_by_spec (FRAME_PTR f, Lisp_Object spec);
extern Lisp_Object font_open_by_name (FRAME_PTR f, char *name); extern Lisp_Object font_open_by_name (FRAME_PTR f, const char *name);
extern void font_close_object (FRAME_PTR f, Lisp_Object font_object); extern void font_close_object (FRAME_PTR f, Lisp_Object font_object);
extern Lisp_Object font_intern_prop (const char *str, int len, int force_symbol); extern Lisp_Object font_intern_prop (const char *str, int len, int force_symbol);
......
...@@ -432,20 +432,22 @@ xg_list_remove (xg_list_node *list, xg_list_node *node) ...@@ -432,20 +432,22 @@ xg_list_remove (xg_list_node *list, xg_list_node *node)
} }
/* Allocate and return a utf8 version of STR. If STR is already /* Allocate and return a utf8 version of STR. If STR is already
utf8 or NULL, just return STR. utf8 or NULL, just return a copy of STR.
If not, a new string is allocated and the caller must free the result A new string is allocated and the caller must free the result
with g_free. */ with g_free. */
static char * static char *
get_utf8_string (char *str) get_utf8_string (const char *str)
{ {
char *utf8_str = str; char *utf8_str;
if (!str) return NULL; if (!str) return NULL;
/* If not UTF-8, try current locale. */ /* If not UTF-8, try current locale. */
if (!g_utf8_validate (str, -1, NULL)) if (!g_utf8_validate (str, -1, NULL))
utf8_str = g_locale_to_utf8 (str, -1, 0, 0, 0); utf8_str = g_locale_to_utf8 (str, -1, 0, 0, 0);
else
return g_strdup (str);
if (!utf8_str) if (!utf8_str)
{ {
...@@ -1336,7 +1338,7 @@ create_dialog (widget_value *wv, ...@@ -1336,7 +1338,7 @@ create_dialog (widget_value *wv,
} }
} }
if (utf8_label && utf8_label != item->value) if (utf8_label)
g_free (utf8_label); g_free (utf8_label);
} }
...@@ -2076,7 +2078,7 @@ static const char* separator_names[] = { ...@@ -2076,7 +2078,7 @@ static const char* separator_names[] = {
}; };
static int static int
xg_separator_p (char *label) xg_separator_p (const char *label)
{ {
if (! label) return 0; if (! label) return 0;
else if (strlen (label) > 3 else if (strlen (label) > 3
...@@ -2174,8 +2176,8 @@ xg_create_one_menuitem (widget_value *item, ...@@ -2174,8 +2176,8 @@ xg_create_one_menuitem (widget_value *item,
w = make_menu_item (utf8_label, utf8_key, item, group); w = make_menu_item (utf8_label, utf8_key, item, group);
if (utf8_label && utf8_label != item->name) g_free (utf8_label); if (utf8_label) g_free (utf8_label);
if (utf8_key && utf8_key != item->key) g_free (utf8_key); if (utf8_key) g_free (utf8_key);
cb_data = xmalloc (sizeof (xg_menu_item_cb_data)); cb_data = xmalloc (sizeof (xg_menu_item_cb_data));
...@@ -2311,7 +2313,7 @@ create_menus (widget_value *data, ...@@ -2311,7 +2313,7 @@ create_menus (widget_value *data,
gtk_menu_set_title (GTK_MENU (wmenu), utf8_label); gtk_menu_set_title (GTK_MENU (wmenu), utf8_label);
w = gtk_menu_item_new_with_label (utf8_label); w = gtk_menu_item_new_with_label (utf8_label);
gtk_widget_set_sensitive (w, FALSE); gtk_widget_set_sensitive (w, FALSE);
if (utf8_label && utf8_label != item->name) g_free (utf8_label); if (utf8_label) g_free (utf8_label);
} }
else if (xg_separator_p (item->name)) else if (xg_separator_p (item->name))
{ {
...@@ -2432,7 +2434,7 @@ xg_get_menu_item_label (GtkMenuItem *witem) ...@@ -2432,7 +2434,7 @@ xg_get_menu_item_label (GtkMenuItem *witem)
/* Return non-zero if the menu item WITEM has the text LABEL. */ /* Return non-zero if the menu item WITEM has the text LABEL. */
static int static int
xg_item_label_same_p (GtkMenuItem *witem, char *label) xg_item_label_same_p (GtkMenuItem *witem, const char *label)
{ {
int is_same = 0; int is_same = 0;
char *utf8_label = get_utf8_string (label); char *utf8_label = get_utf8_string (label);
...@@ -2443,7 +2445,7 @@ xg_item_label_same_p (GtkMenuItem *witem, char *label) ...@@ -2443,7 +2445,7 @@ xg_item_label_same_p (GtkMenuItem *witem, char *label)
else if (old_label && utf8_label) else if (old_label && utf8_label)
is_same = strcmp (utf8_label, old_label) == 0; is_same = strcmp (utf8_label, old_label) == 0;
if (utf8_label && utf8_label != label) g_free (utf8_label); if (utf8_label) g_free (utf8_label);
return is_same; return is_same;
} }
...@@ -2590,6 +2592,7 @@ xg_update_menubar (GtkWidget *menubar, ...@@ -2590,6 +2592,7 @@ xg_update_menubar (GtkWidget *menubar,
/* Set the title of the detached window. */ /* Set the title of the detached window. */
gtk_menu_set_title (GTK_MENU (submenu), utf8_label); gtk_menu_set_title (GTK_MENU (submenu), utf8_label);
if (utf8_label) g_free (utf8_label);
iter = g_list_next (iter); iter = g_list_next (iter);
val = val->next; val = val->next;
++pos; ++pos;
...@@ -2729,8 +2732,8 @@ xg_update_menu_item (widget_value *val, ...@@ -2729,8 +2732,8 @@ xg_update_menu_item (widget_value *val,
if (! old_label || strcmp (utf8_label, old_label) != 0) if (! old_label || strcmp (utf8_label, old_label) != 0)
gtk_label_set_text (wlbl, utf8_label); gtk_label_set_text (wlbl, utf8_label);
if (utf8_key && utf8_key != val->key) g_free (utf8_key); if (utf8_key) g_free (utf8_key);
if (utf8_label && utf8_label != val->name) g_free (utf8_label); if (utf8_label) g_free (utf8_label);
if (! val->enabled && gtk_widget_get_sensitive (w)) if (! val->enabled && gtk_widget_get_sensitive (w))
gtk_widget_set_sensitive (w, FALSE); gtk_widget_set_sensitive (w, FALSE);
......
...@@ -38,14 +38,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ ...@@ -38,14 +38,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Key for data that menu items hold. */ /* Key for data that menu items hold. */
#define XG_ITEM_DATA "emacs_menuitem" #define XG_ITEM_DATA "emacs_menuitem"
/* Button types in menus. */
enum button_type
{
BUTTON_TYPE_NONE,
BUTTON_TYPE_TOGGLE,
BUTTON_TYPE_RADIO
};
/* This is a list node in a generic list implementation. */ /* This is a list node in a generic list implementation. */
typedef struct xg_list_node_ typedef struct xg_list_node_
{ {
...@@ -82,48 +74,13 @@ typedef struct xg_menu_item_cb_data_ ...@@ -82,48 +74,13 @@ typedef struct xg_menu_item_cb_data_
} xg_menu_item_cb_data; } xg_menu_item_cb_data;
/* Used to specify menus and dialogs.
This is an adaption from lwlib for Gtk so we can use more of the same
code as lwlib in xmenu.c. */
typedef struct _widget_value
{
/* name of widget */
Lisp_Object lname;
char *name;
/* value (meaning depend on widget type) */
char *value;
/* keyboard equivalent. no implications for XtTranslations */
Lisp_Object lkey;
char *key;
/* Help string or nil if none.
GC finds this string through the frame's menu_bar_vector
or through menu_items. */
Lisp_Object help;
/* true if enabled */
gint enabled;
/* true if selected */
gint selected;
/* The type of a button. */
enum button_type button_type;
/* Contents of the sub-widgets, also selected slot for checkbox */
struct _widget_value *contents;
/* data passed to callback */
gpointer call_data;
/* next one in the list */
struct _widget_value *next;
/* we resource the widget_value structures; this points to the next
one on the free list if this one has been deallocated.
*/
struct _widget_value *free_list;
} widget_value;
#ifdef HAVE_GTK_FILE_SELECTION_NEW #ifdef HAVE_GTK_FILE_SELECTION_NEW
extern int use_old_gtk_file_dialog; extern int use_old_gtk_file_dialog;
#endif #endif
struct _widget_value;
extern widget_value *malloc_widget_value (void); extern struct _widget_value *malloc_widget_value (void);
extern void free_widget_value (widget_value *); extern void free_widget_value (struct _widget_value *);
extern int xg_uses_old_file_dialog (void); extern int xg_uses_old_file_dialog (void);
...@@ -138,14 +95,14 @@ extern char *xg_get_font_name (FRAME_PTR f, const char *); ...@@ -138,14 +95,14 @@ extern char *xg_get_font_name (FRAME_PTR f, const char *);
extern GtkWidget *xg_create_widget (const char *type, extern GtkWidget *xg_create_widget (const char *type,
const char *name, const char *name,
FRAME_PTR f, FRAME_PTR f,
widget_value *val, struct _widget_value *val,
GCallback select_cb, GCallback select_cb,
GCallback deactivate_cb, GCallback deactivate_cb,
GCallback hightlight_cb); GCallback hightlight_cb);
extern void xg_modify_menubar_widgets (GtkWidget *menubar, extern void xg_modify_menubar_widgets (GtkWidget *menubar,
FRAME_PTR f, FRAME_PTR f,
widget_value *val, struct _widget_value *val,
int deep_p, int deep_p,
GCallback select_cb, GCallback select_cb,
GCallback deactivate_cb, GCallback deactivate_cb,
......
...@@ -318,10 +318,7 @@ extern Lisp_Object unuse_menu_items (Lisp_Object dummy); ...@@ -318,10 +318,7 @@ extern Lisp_Object unuse_menu_items (Lisp_Object dummy);
#define ENCODE_MENU_STRING(str) (str) #define ENCODE_MENU_STRING(str) (str)
#endif #endif
#if defined (HAVE_NS) || defined (HAVE_NTGUI) #if defined (HAVE_NS) || defined (HAVE_NTGUI) || defined (USE_GTK)
typedef void * XtPointer;
typedef unsigned char Boolean;
/* Definitions copied from lwlib.h */ /* Definitions copied from lwlib.h */
...@@ -349,21 +346,24 @@ typedef struct _widget_value ...@@ -349,21 +346,24 @@ typedef struct _widget_value
or through menu_items. */ or through menu_items. */
Lisp_Object help; Lisp_Object help;
/* true if enabled */ /* true if enabled */
Boolean enabled; unsigned char enabled;
/* true if selected */ /* true if selected */
Boolean selected; unsigned char selected;
/* The type of a button. */ /* The type of a button. */
enum button_type button_type; enum button_type button_type;
#if defined (HAVE_NTGUI) #if defined (HAVE_NTGUI)
/* true if menu title */ /* true if menu title */
Boolean title; unsigned char title;
#endif #endif
/* Contents of the sub-widgets, also selected slot for checkbox */ /* Contents of the sub-widgets, also selected slot for checkbox */
struct _widget_value* contents; struct _widget_value* contents;
/* data passed to callback */ /* data passed to callback */
XtPointer call_data; void *call_data;
/* next one in the list */ /* next one in the list */
struct _widget_value* next; struct _widget_value* next;
#ifdef USE_GTK
struct _widget_value *free_list;
#endif
} widget_value; } widget_value;
#endif /* HAVE_NS || HAVE_NTGUI */ #endif /* HAVE_NS || HAVE_NTGUI */
......
...@@ -1065,7 +1065,7 @@ no quit occurs and `x-popup-menu' returns nil. */) ...@@ -1065,7 +1065,7 @@ no quit occurs and `x-popup-menu' returns nil. */)
Lisp_Object keymap, tem; Lisp_Object keymap, tem;
int xpos = 0, ypos = 0; int xpos = 0, ypos = 0;
Lisp_Object title; Lisp_Object title;
char *error_name = NULL; const char *error_name = NULL;
Lisp_Object selection = Qnil; Lisp_Object selection = Qnil;
FRAME_PTR f = NULL; FRAME_PTR f = NULL;
Lisp_Object x, y, window; Lisp_Object x, y, window;
......
...@@ -46,11 +46,11 @@ extern void mouse_position_for_popup (FRAME_PTR f, int *x, int *y); ...@@ -46,11 +46,11 @@ extern void mouse_position_for_popup (FRAME_PTR f, int *x, int *y);
#endif #endif
extern Lisp_Object w32_menu_show (FRAME_PTR, int, int, int, int, extern Lisp_Object w32_menu_show (FRAME_PTR, int, int, int, int,
Lisp_Object, char **); Lisp_Object, const char **);
extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, int, int, extern Lisp_Object ns_menu_show (FRAME_PTR, int, int, int, int,
Lisp_Object, char **); Lisp_Object, const char **);
extern Lisp_Object xmenu_show (FRAME_PTR, int, int, int, int, extern Lisp_Object xmenu_show (FRAME_PTR, int, int, int, int,
Lisp_Object, char **, EMACS_UINT); Lisp_Object, const char **, EMACS_UINT);
#endif /* MENU_H */ #endif /* MENU_H */
/* arch-tag: c32b2778-724d-4e85-81d7-45f98530a988 /* arch-tag: c32b2778-724d-4e85-81d7-45f98530a988
......
...@@ -773,7 +773,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f ...@@ -773,7 +773,7 @@ - (Lisp_Object)runMenuAt: (NSPoint)p forFrame: (struct frame *)f
Lisp_Object Lisp_Object
ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, ns_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
Lisp_Object title, char **error) Lisp_Object title, const char **error)
{ {
EmacsMenu *pmenu; EmacsMenu *pmenu;
NSPoint p; NSPoint p;
......
...@@ -142,7 +142,7 @@ extern int synch_process_alive; ...@@ -142,7 +142,7 @@ extern int synch_process_alive;
to Fcall_process. */ to Fcall_process. */
/* Nonzero => this is a string explaining death of synchronous subprocess. */ /* Nonzero => this is a string explaining death of synchronous subprocess. */
extern char *synch_process_death; extern const char *synch_process_death;
/* Nonzero => this is the signal number that terminated the subprocess. */ /* Nonzero => this is the signal number that terminated the subprocess. */
extern int synch_process_termsig; extern int synch_process_termsig;
......
...@@ -662,7 +662,7 @@ free_frame_menubar (FRAME_PTR f) ...@@ -662,7 +662,7 @@ free_frame_menubar (FRAME_PTR f)
Lisp_Object Lisp_Object
w32_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, w32_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
Lisp_Object title, char **error) Lisp_Object title, const char **error)
{ {
int i; int i;
int menu_item_selection; int menu_item_selection;
......
...@@ -111,7 +111,7 @@ Lisp_Object Qdebug_on_next_call; ...@@ -111,7 +111,7 @@ Lisp_Object Qdebug_on_next_call;
#if defined (USE_X_TOOLKIT) || defined (USE_GTK) #if defined (USE_X_TOOLKIT) || defined (USE_GTK)
static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object, static Lisp_Object xdialog_show (FRAME_PTR, int, Lisp_Object, Lisp_Object,
char **); const char **);
#endif #endif
static int update_frame_menubar (struct frame *); static int update_frame_menubar (struct frame *);
...@@ -312,7 +312,7 @@ for instance using the window manager, then this produces a quit and ...@@ -312,7 +312,7 @@ for instance using the window manager, then this produces a quit and
#else #else
{ {
Lisp_Object title; Lisp_Object title;
char *error_name; const char *error_name;
Lisp_Object selection; Lisp_Object selection;
int specpdl_count = SPECPDL_INDEX (); int specpdl_count = SPECPDL_INDEX ();
...@@ -1600,7 +1600,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv, ...@@ -1600,7 +1600,7 @@ create_and_show_popup_menu (FRAME_PTR f, widget_value *first_wv,
Lisp_Object Lisp_Object
xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
Lisp_Object title, char **error, EMACS_UINT timestamp) Lisp_Object title, const char **error, EMACS_UINT timestamp)
{ {
int i; int i;
widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
...@@ -1664,7 +1664,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps, ...@@ -1664,7 +1664,7 @@ xmenu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
{ {
/* Create a new pane. */ /* Create a new pane. */
Lisp_Object pane_name, prefix; Lisp_Object pane_name, prefix;
char *pane_string; const char *pane_string;
pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME); pane_name = AREF (menu_items, i + MENU_ITEMS_PANE_NAME);
prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX); prefix = AREF (menu_items, i + MENU_ITEMS_PANE_PREFIX);
...@@ -1976,12 +1976,16 @@ create_and_show_dialog (FRAME_PTR f, widget_value *first_wv) ...@@ -1976,12 +1976,16 @@ create_and_show_dialog (FRAME_PTR f, widget_value *first_wv)
#endif /* not USE_GTK */ #endif /* not USE_GTK */
static char * button_names [] = { static const char * button_names [] = {
"button1", "button2", "button3", "button4", "button5", "button1", "button2", "button3", "button4", "button5",
"button6", "button7", "button8", "button9", "button10" }; "button6", "button7", "button8", "button9", "button10" };
static Lisp_Object static Lisp_Object
xdialog_show (FRAME_PTR f, int keymaps, Lisp_Object title, Lisp_Object header, char **error_name) xdialog_show (FRAME_PTR f,
int keymaps,
Lisp_Object title,
Lisp_Object header,
const char **error_name)
{ {
int i, nb_buttons=0; int i, nb_buttons=0;
char dialog_name[6]; char dialog_name[6];
...@@ -2008,7 +2012,7 @@ xdialog_show (FRAME_PTR f, int keymaps, Lisp_Object title, Lisp_Object header, c ...@@ -2008,7 +2012,7 @@ xdialog_show (FRAME_PTR f, int keymaps, Lisp_Object title, Lisp_Object header, c
representing the text label and buttons. */ representing the text label and buttons. */
{ {
Lisp_Object pane_name, prefix; Lisp_Object pane_name, prefix;
char *pane_string; const char *pane_string;
pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME]; pane_name = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_NAME];
prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX]; prefix = XVECTOR (menu_items)->contents[MENU_ITEMS_PANE_PREFIX];
pane_string = (NILP (pane_name) pane_string = (NILP (pane_name)
......