John Marriott wrote:

> On 26-Nov-2017 03:14, Bram Moolenaar wrote:
> > Patch 8.0.1338 (after 8.0.1337)
> > Problem:    USE_IM_CONTROL is confusing and incomplete.
> > Solution:   Just use FEAT_MBYTE.  Call 'imactivatefunc' also without GUI.
> > Files:      src/vim.h, src/edit.c, src/ex_getln.c, src/getchar.c, src/gui.c,
> >              src/gui_mac.c, src/gui_w32.c, src/mbyte.c, src/normal.c,
> >              src/option.c, src/ui.c, src/globals.h, src/option.h
> This patch causes mingw64 to throw this warning if FEAT_MBYTE is defined 
> but FEAT_MBYTE_IME is not:
> gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 
> -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_W32 
> -DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer 
> -freg-struct-return -s gui_w32.c -o gobjnative/gui_w32.o
> gui_w32.c:505:16: warning: 'sub_logfont' defined but not used 
> [-Wunused-variable]
>   static LOGFONT sub_logfont;
>                  ^~~~~~~~~~~
> gui_w32.c:503:16: warning: 'norm_logfont' defined but not used 
> [-Wunused-variable]
>   static LOGFONT norm_logfont;
>                  ^~~~~~~~~~~~
> 
> sub_logfont and norm_logfont are defined depending on FEAT_MBYTE but is 
> then used in function _OnImeNotify() which is defined depending on 
> FEAT_MBYTE_IME and FEAT_MBYTE and FEAT_MBYTE_IME do not depend on each 
> other, at least in Make_cyg_ming.mak anyway.
> 
> The attached patch tries to fix it by adjusting the ifdefs in gui_w32.c, 
> please check.

Thanks.  The existing #ifdefs are confusing, some have:
        defined(FEAT_MBYTE) && defined(FEAT_MBYTE_IME)
Even though FEAT_MBYTE_IME implies FEAT_MBYTE.  This is enforced in
feature.h.

However, GLOBAL_IME can be defined without FEAT_MBYTE, thus we should
use:
        (defined(FEAT_MBYTE_IME) || defined(GLOBAL_IME))

But then sub_logfont is only used when FEAT_MBYTE_IME is defined.  I
think that's better than to define the use when it wasn't before.

I'll give it a try, but I can't try much combinations.

-- 
It was recently discovered that research causes cancer in rats.

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
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.

Raspunde prin e-mail lui