From 8f52c5da76f7e536e83216a80887aab3294017be Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Tue, 27 Apr 2021 04:25:23 +0200 Subject: [PATCH] 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). --- src/xterm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; } } -- 2.39.5