On 04-Jul-2019 16:28, Bram Moolenaar wrote:
Patch 8.1.1631
Problem:    Displaying signs is inefficient.
Solution:   Avoid making multiple calls to get information about a placed
             sign. (Yegappan Lakshmanan, closes #4586)
Files:      src/proto/sign.pro, src/screen.c, src/sign.c, src/structs.h


After this patch, mingw64 spits out this warning:
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return screen.c -o objnative/screen.o
screen.c: In function 'win_line':
screen.c:3269:18: warning: unused variable 'sattr' [-Wunused-variable]
 3269 |     sign_attrs_T sattr;
      |                  ^~~~~
screen.c:3268:10: warning: unused variable 'sign_present' [-Wunused-variable]
 3268 |     int  sign_present = FALSE;
      |          ^~~~~~~~~~~~

In screen.c, the above variables in win_line() are included if FEAT_SIGNS, FEAT_QUICKFIX, FEAT_SYN_HL or FEAT_DIFF are defined. However their usage doesn't match these conditionals. For example, here is where they are declared (lines 3266-3272):
#if defined(FEAT_SIGNS) || defined(FEAT_QUICKFIX) \
    || defined(FEAT_SYN_HL) || defined(FEAT_DIFF)
    int        sign_present = FALSE;
    sign_attrs_T sattr;
# define LINE_ATTR
    int        line_attr = 0;        /* attribute for the whole line */
#endif

Here are some lines of usage (lines 3591-3600):
#ifdef FEAT_SIGNS
    sign_present = buf_get_signattrs(wp->w_buffer, lnum, &sattr);
#endif

#ifdef LINE_ATTR
# ifdef FEAT_SIGNS
    /* If this line has a sign with line highlighting set line_attr. */
    if (sign_present)
    line_attr = sattr.linehl;
# endif

In my case, FEAT_SIGNS and FEAT_QUICKFIX are not defined in this build, hence the warning.

Cheers
John

--
--
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/836b6093-6afd-423a-33ff-301647c3f0a3%40internode.on.net.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui