]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix compilation warnings in non-toolkit builds
authorLars Ingebrigtsen <larsi@gnus.org>
Tue, 27 Apr 2021 02:25:23 +0000 (04:25 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Tue, 27 Apr 2021 02:25:30 +0000 (04:25 +0200)
* 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

index 744b80c68a002af14533b9a91717a333c81f8a75..11de287aecce39ade603800e9d56a26bd64d1c1a 100644 (file)
@@ -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;
        }
     }