From: Lars Ingebrigtsen Date: Tue, 27 Apr 2021 02:25:23 +0000 (+0200) Subject: Fix compilation warnings in non-toolkit builds X-Git-Tag: emacs-28.0.90~2698 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=8f52c5da76f7e536e83216a80887aab3294017be;p=emacs.git Fix compilation warnings in non-toolkit builds * src/xterm.c (x_create_toolkit_scroll_bar) (x_create_horizontal_toolkit_scroll_bar): String constants for XtSetArg are defined as const strings (in /usr/include/X11/Xaw3d/ThreeD.h, for instance), but the argument in XtSetArg is defined as either a const char* or a regular char* in /usr/include/X11/Intrinsic.h. Cast the argument to String (which should be correct on all platforms, hopefully) to avoid a compilation warning (bug#47452). --- diff --git a/src/xterm.c b/src/xterm.c index 744b80c68a0..11de287aecc 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -6223,7 +6223,7 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) /* But only if we have a small colormap. Xaw3d can allocate nice colors itself. */ { - XtSetArg (av[ac], XtNbeNiceToColormap, + XtSetArg (av[ac], (String) XtNbeNiceToColormap, DefaultDepthOfScreen (FRAME_X_SCREEN (f)) < 16); ++ac; } @@ -6234,20 +6234,20 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) { /* This tells Xaw3d to use real colors instead of dithering for the shadows. */ - XtSetArg (av[ac], XtNbeNiceToColormap, False); + XtSetArg (av[ac], (String) XtNbeNiceToColormap, False); ++ac; /* Specify the colors. */ pixel = f->output_data.x->scroll_bar_top_shadow_pixel; if (pixel != -1) { - XtSetArg (av[ac], XtNtopShadowPixel, pixel); + XtSetArg (av[ac], (String) XtNtopShadowPixel, pixel); ++ac; } pixel = f->output_data.x->scroll_bar_bottom_shadow_pixel; if (pixel != -1) { - XtSetArg (av[ac], XtNbottomShadowPixel, pixel); + XtSetArg (av[ac], (String) XtNbottomShadowPixel, pixel); ++ac; } } @@ -6424,7 +6424,7 @@ x_create_horizontal_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) /* But only if we have a small colormap. Xaw3d can allocate nice colors itself. */ { - XtSetArg (av[ac], XtNbeNiceToColormap, + XtSetArg (av[ac], (String) XtNbeNiceToColormap, DefaultDepthOfScreen (FRAME_X_SCREEN (f)) < 16); ++ac; } @@ -6435,20 +6435,20 @@ x_create_horizontal_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar) { /* This tells Xaw3d to use real colors instead of dithering for the shadows. */ - XtSetArg (av[ac], XtNbeNiceToColormap, False); + XtSetArg (av[ac], (String) XtNbeNiceToColormap, False); ++ac; /* Specify the colors. */ pixel = f->output_data.x->scroll_bar_top_shadow_pixel; if (pixel != -1) { - XtSetArg (av[ac], XtNtopShadowPixel, pixel); + XtSetArg (av[ac], (String) XtNtopShadowPixel, pixel); ++ac; } pixel = f->output_data.x->scroll_bar_bottom_shadow_pixel; if (pixel != -1) { - XtSetArg (av[ac], XtNbottomShadowPixel, pixel); + XtSetArg (av[ac], (String) XtNbottomShadowPixel, pixel); ++ac; } }