summaryrefslogtreecommitdiff
path: root/lwlib
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-03-10 09:30:30 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2017-03-10 09:31:59 -0800
commitec168376d1d961be9adceaafcbff04d5b2b0a492 (patch)
treee714c3bc5e3c5323ddbf936c382a0ba079307618 /lwlib
parent817c4d1a3055a12ab2f1a6a06479b5eb4d66286b (diff)
downloademacs-ec168376d1d961be9adceaafcbff04d5b2b0a492.tar.gz
Tweak X toolkit code to pacify modern GCC
* lwlib/lwlib-Xaw.c, lwlib/lwlib-Xm.c, lwlib/lwlib.c: Don’t include <stdlib.h>, since this code now calls emacs_abort rather than abort. * lwlib/lwlib-Xaw.c (make_dialog, xaw_generic_callback) (wm_delete_window): * lwlib/lwlib-Xm.c (make_menu_in_widget, do_call): * lwlib/lwlib.c (instantiate_widget_instance, lw_make_widget): * lwlib/xlwmenu.c (abort_gracefully, draw_separator) (separator_height, XlwMenuInitialize): Use emacs_abort, not abort. Without this change, some calls to ‘abort’ were invalid, as stdlib.h was not always included. * src/widget.c (resources, emacsFrameClassRec): * src/xfns.c (x_window) [USE_X_TOOLKIT]: * src/xmenu.c (create_and_show_popup_menu) [USE_X_TOOLKIT]: * src/xterm.c (emacs_options) [USE_X_TOOLKIT}: (x_term_init) [USE_X_TOOLKIT]: Cast string constants to char * to pacify --enable-gcc-warnings.
Diffstat (limited to 'lwlib')
-rw-r--r--lwlib/lwlib-Xaw.c19
-rw-r--r--lwlib/lwlib-Xm.c11
-rw-r--r--lwlib/lwlib.c7
-rw-r--r--lwlib/xlwmenu.c8
4 files changed, 21 insertions, 24 deletions
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index af57a7fe910..ec33e788296 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -21,7 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <config.h>
#include <stdio.h>
-#include <stdlib.h>
#include <setjmp.h>
#include <lisp.h>
@@ -516,10 +515,10 @@ make_dialog (char* name,
XtTranslations button_override;
#endif
- if (! pop_up_p) abort (); /* not implemented */
- if (text_input_slot) abort (); /* not implemented */
- if (radio_box) abort (); /* not implemented */
- if (list) abort (); /* not implemented */
+ if (! pop_up_p) emacs_abort (); /* not implemented */
+ if (text_input_slot) emacs_abort (); /* not implemented */
+ if (radio_box) emacs_abort (); /* not implemented */
+ if (list) emacs_abort (); /* not implemented */
if (! actions_initted)
{
@@ -764,7 +763,7 @@ xaw_generic_callback (Widget widget, XtPointer closure, XtPointer call_data)
break;
val = val->next;
}
- if (! val) abort ();
+ if (! val) emacs_abort ();
user_data = val->call_data;
}
@@ -790,11 +789,11 @@ wm_delete_window (Widget w,
shell = w;
if (! XtIsSubclass (shell, shellWidgetClass))
- abort ();
+ emacs_abort ();
XtVaGetValues (shell, XtNnumChildren, &nkids, NULL);
XtVaGetValues (shell, XtNchildren, &kids, NULL);
if (!kids || !*kids)
- abort ();
+ emacs_abort ();
for (i = 0; i < nkids; i++)
{
widget = kids[i];
@@ -804,11 +803,11 @@ wm_delete_window (Widget w,
if (! widget) return;
id = lw_get_widget_id (widget);
- if (! id) abort ();
+ if (! id) emacs_abort ();
{
widget_info *info = lw_get_widget_info (id);
- if (! info) abort ();
+ if (! info) emacs_abort ();
if (info->selection_cb)
info->selection_cb (widget, id, (XtPointer) -1);
}
diff --git a/lwlib/lwlib-Xm.c b/lwlib/lwlib-Xm.c
index 6e1e0d69216..b18429067d8 100644
--- a/lwlib/lwlib-Xm.c
+++ b/lwlib/lwlib-Xm.c
@@ -22,7 +22,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#include <stdio.h>
-#include <stdlib.h>
#include <setjmp.h>
#include <X11/StringDefs.h>
@@ -504,14 +503,14 @@ make_menu_in_widget (widget_instance* instance,
/* WIDGET should be a RowColumn. */
if (!XmIsRowColumn (widget))
- abort ();
+ emacs_abort ();
/* Determine whether WIDGET is a menu bar. */
type = -1;
XtSetArg (al[0], XmNrowColumnType, &type);
XtGetValues (widget, al, 1);
if (type != XmMENU_BAR && type != XmMENU_PULLDOWN && type != XmMENU_POPUP)
- abort ();
+ emacs_abort ();
menubar_p = type == XmMENU_BAR;
/* Add a callback to popups and pulldowns that is called when
@@ -528,7 +527,7 @@ make_menu_in_widget (widget_instance* instance,
/* Check that those are all we have
(the caller should have deleted the rest). */
if (old_num_children != keep_first_children)
- abort ();
+ emacs_abort ();
/* Create the rest. */
for (child_index = keep_first_children; cur; child_index++, cur = cur->next)
@@ -677,7 +676,7 @@ update_one_menu_entry (widget_instance* instance,
if (strcmp (XtName (widget_list[i]), XtName (widget)) == 0)
break;
if (i == old_num_children)
- abort ();
+ emacs_abort ();
if (XmIsCascadeButton (widget_list[i]))
{
menu = XmCreatePulldownMenu (parent, XtName(widget), NULL, 0);
@@ -1829,7 +1828,7 @@ do_call (Widget widget,
break;
default:
- abort ();
+ emacs_abort ();
}
}
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index 18a46109eb4..fffb17f7c33 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -26,7 +26,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/types.h>
#include <stdio.h>
-#include <stdlib.h>
#include "lwlib-int.h"
#include "lwlib-utils.h"
#include <X11/StringDefs.h>
@@ -721,13 +720,13 @@ instantiate_widget_instance (widget_instance *instance)
{
printf ("No creation function for widget type %s\n",
instance->info->type);
- abort ();
+ emacs_abort ();
}
instance->widget = (*function) (instance);
if (!instance->widget)
- abort ();
+ emacs_abort ();
/* XtRealizeWidget (instance->widget);*/
}
@@ -772,7 +771,7 @@ lw_make_widget (LWLIB_ID id, Widget parent, Boolean pop_up_p)
initialize_widget_instance (instance);
}
if (!instance->widget)
- abort ();
+ emacs_abort ();
return instance->widget;
}
diff --git a/lwlib/xlwmenu.c b/lwlib/xlwmenu.c
index 11be3407254..1ce4aead93f 100644
--- a/lwlib/xlwmenu.c
+++ b/lwlib/xlwmenu.c
@@ -267,7 +267,7 @@ abort_gracefully (Widget w)
if (XtIsShell (XtParent (w)))
XtRemoveGrab (w);
ungrab_all (w, CurrentTime);
- abort ();
+ emacs_abort ();
}
static void
@@ -897,7 +897,7 @@ draw_separator (XlwMenuWidget mw,
break;
default:
- abort ();
+ emacs_abort ();
}
}
@@ -933,7 +933,7 @@ separator_height (enum menu_separator separator)
return 5;
default:
- abort ();
+ emacs_abort ();
}
}
@@ -1900,7 +1900,7 @@ XlwMenuInitialize (Widget request, Widget w, ArgList args, Cardinal *num_args)
if (!mw->menu.font)
{
fprintf (stderr, "Menu font fixed not found, can't continue.\n");
- abort ();
+ emacs_abort ();
}
}
}