summaryrefslogtreecommitdiff
path: root/src/widget.c
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 /src/widget.c
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 'src/widget.c')
-rw-r--r--src/widget.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/widget.c b/src/widget.c
index 96555ed2ac7..d7ec7028517 100644
--- a/src/widget.c
+++ b/src/widget.c
@@ -57,31 +57,34 @@ static XtGeometryResult EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry
#define offset(field) offsetof (EmacsFrameRec, emacs_frame.field)
static XtResource resources[] = {
- {XtNgeometry, XtCGeometry, XtRString, sizeof (String),
+ {(char *) XtNgeometry, (char *) XtCGeometry, XtRString, sizeof (String),
offset (geometry), XtRString, (XtPointer) 0},
{XtNiconic, XtCIconic, XtRBoolean, sizeof (Boolean),
offset (iconic), XtRImmediate, (XtPointer) False},
- {XtNemacsFrame, XtCEmacsFrame, XtRPointer, sizeof (XtPointer),
+ {(char *) XtNemacsFrame, (char *) XtCEmacsFrame,
+ XtRPointer, sizeof (XtPointer),
offset (frame), XtRImmediate, 0},
- {XtNminibuffer, XtCMinibuffer, XtRInt, sizeof (int),
+ {(char *) XtNminibuffer, (char *) XtCMinibuffer, XtRInt, sizeof (int),
offset (minibuffer), XtRImmediate, (XtPointer)0},
- {XtNunsplittable, XtCUnsplittable, XtRBoolean, sizeof (Boolean),
+ {(char *) XtNunsplittable, (char *) XtCUnsplittable,
+ XtRBoolean, sizeof (Boolean),
offset (unsplittable), XtRImmediate, (XtPointer)0},
- {XtNinternalBorderWidth, XtCInternalBorderWidth, XtRInt, sizeof (int),
+ {(char *) XtNinternalBorderWidth, (char *) XtCInternalBorderWidth,
+ XtRInt, sizeof (int),
offset (internal_border_width), XtRImmediate, (XtPointer)4},
- {XtNinterline, XtCInterline, XtRInt, sizeof (int),
+ {(char *) XtNinterline, (char *) XtCInterline, XtRInt, sizeof (int),
offset (interline), XtRImmediate, (XtPointer)0},
- {XtNforeground, XtCForeground, XtRPixel, sizeof (Pixel),
- offset (foreground_pixel), XtRString, "XtDefaultForeground"},
- {XtNcursorColor, XtCForeground, XtRPixel, sizeof (Pixel),
- offset (cursor_color), XtRString, "XtDefaultForeground"},
- {XtNbarCursor, XtCBarCursor, XtRBoolean, sizeof (Boolean),
+ {(char *) XtNforeground, (char *) XtCForeground, XtRPixel, sizeof (Pixel),
+ offset (foreground_pixel), XtRString, (char *) "XtDefaultForeground"},
+ {(char *) XtNcursorColor, (char *) XtCForeground, XtRPixel, sizeof (Pixel),
+ offset (cursor_color), XtRString, (char *) "XtDefaultForeground"},
+ {(char *) XtNbarCursor, (char *) XtCBarCursor, XtRBoolean, sizeof (Boolean),
offset (bar_cursor), XtRImmediate, (XtPointer)0},
- {XtNvisualBell, XtCVisualBell, XtRBoolean, sizeof (Boolean),
+ {(char *) XtNvisualBell, (char *) XtCVisualBell, XtRBoolean, sizeof (Boolean),
offset (visual_bell), XtRImmediate, (XtPointer)0},
- {XtNbellVolume, XtCBellVolume, XtRInt, sizeof (int),
+ {(char *) XtNbellVolume, (char *) XtCBellVolume, XtRInt, sizeof (int),
offset (bell_volume), XtRImmediate, (XtPointer)0},
};
@@ -106,7 +109,7 @@ emacsFrameTranslations [] = "\
static EmacsFrameClassRec emacsFrameClassRec = {
{ /* core fields */
/* superclass */ &widgetClassRec,
- /* class_name */ "EmacsFrame",
+ /* class_name */ (char *) "EmacsFrame",
/* widget_size */ sizeof (EmacsFrameRec),
/* class_initialize */ 0,
/* class_part_initialize */ 0,