2017-07-23 23:45 GMT+09:00 Bram Moolenaar <[email protected]>:

>
> Patch 8.0.0755
> Problem:    Terminal window does not have colors in the GUI.
> Solution:   Lookup the GUI color.
> Files:      src/terminal.c, src/syntax.c, src/proto/syntax.pro,
> src/term.c,
>             src/proto/term.pro, src/gui_gtk_x11.c, src/proto/
> gui_gtk_x11.pro,
>             src/gui_x11.c, src/proto/gui_x11.pro, src/gui_mac.c,
>             src/proto/gui_mac.pro, src/gui_photon.c, src/proto/
> gui_photon.pro,
>             src/gui_w32.c, src/proto/gui_w32.pro


For some reason, a couple of local variables were declared in a wrong place
and thus resulting in a build failure for Athena and Motif GUI builds
(Please see below for the compiler diagnosis).  Attached is a patch for
fixing it.

BTW, it was really amazing that my making this patch was all done without
leaving gvim except for this very last phase to send out the resulting
patch to vim_dev through a browser. I found the built-in terminal more
useful than I had expected.

Best regards
Kazunobu Kuriyama


clang -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_ATHENA
-I/opt/local/include  -O2 -std=c90 -fstrict-aliasing -Wall -Wextra
-Wmissing-declarations -Wmissing-prototypes -Wuninitialized -Wshadow
 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1     -I/opt/local/include    -o
objects/gui_x11.o gui_x11.c
gui_x11.c:2273:17: warning: unused variable 'available' [-Wunused-variable]
    XColor      available;
                ^
gui_x11.c:2274:14: warning: unused variable 'colormap' [-Wunused-variable]
    Colormap    colormap;
                ^
gui_x11.c:2300:5: error: use of undeclared identifier 'colormap'
    colormap = DefaultColormap(gui.dpy, DefaultScreen(gui.dpy));
    ^
gui_x11.c:2301:30: error: use of undeclared identifier 'colormap'
    if (XParseColor(gui.dpy, colormap, (char *)spec, &available) != 0
                             ^
gui_x11.c:2301:55: error: use of undeclared identifier 'available'
    if (XParseColor(gui.dpy, colormap, (char *)spec, &available) != 0
                                                      ^
gui_x11.c:2302:30: error: use of undeclared identifier 'colormap'
            && XAllocColor(gui.dpy, colormap, &available) != 0)
                                    ^
gui_x11.c:2302:41: error: use of undeclared identifier 'available'
            && XAllocColor(gui.dpy, colormap, &available) != 0)
                                               ^
gui_x11.c:2303:21: error: use of undeclared identifier 'available'
        return (guicolor_T)available.pixel;
                           ^
2 warnings and 6 errors generated.

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/gui_x11.c b/src/gui_x11.c
index e0b91e65c..6a03154a6 100644
--- a/src/gui_x11.c
+++ b/src/gui_x11.c
@@ -2270,8 +2270,6 @@ fontset_ascent(XFontSet fs)
 gui_mch_get_color(char_u *name)
 {
     guicolor_T  requested;
-    XColor      available;
-    Colormap   colormap;
 
     /* can't do this when GUI not running */
     if (!gui.in_use || name == NULL || *name == NUL)
@@ -2295,6 +2293,8 @@ gui_mch_get_color(char_u *name)
 gui_mch_get_rgb_color(int r, int g, int b)
 {
     char        spec[8]; /* space enough to hold "#RRGGBB" */
+    Colormap   colormap;
+    XColor      available;
 
     vim_snprintf(spec, sizeof(spec), "#%.2x%.2x%.2x", r, g, b);
     colormap = DefaultColormap(gui.dpy, DefaultScreen(gui.dpy));

Raspunde prin e-mail lui