On 21-Apr.-2018 06:01, Bram Moolenaar wrote:
Patch 8.0.1738
Problem:    ":args" output is hard to read.
Solution:   Make columns with the names if the output is more than one line.
Files:      src/ex_cmds2.c, src/version.c, src/proto/version.pro,
             src/testdir/test_arglist.vim


After this patch, mingw64 throws this warning:
<snip>
gcc -c -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603 -DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_DIRECTX -DDYNAMIC_DIRECTX -DFEAT_DIRECTX_COLOR_EMOJI -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -pipe -march=native -Wall -O3 -fomit-frame-pointer -freg-struct-return -s ex_cmds2.c -o gobjnative/ex_cmds2.o
ex_cmds2.c: In function 'ex_args':
ex_cmds2.c:2764:19: warning: passing argument 1 of 'list_in_columns' from incompatible pointer type [-Wincompatible-pointer-types]
   list_in_columns(items, ARGCOUNT, curwin->w_arg_idx);
                   ^~~~~
In file included from proto.h:183:0,
                 from vim.h:2112,
                 from ex_cmds2.c:14:
proto/version.pro:6:6: note: expected 'char_u ** {aka unsigned char **}' but argument is of type 'char **'
 void list_in_columns(char_u **items, int size, int current);
      ^~~~~~~~~~~~~~~
</snip>

The attached patch tries to correct it.
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].
For more options, visit https://groups.google.com/d/optout.
--- ex_cmds2.c.orig     2018-04-21 06:09:42.440284200 +1000
+++ ex_cmds2.c  2018-04-21 06:17:20.810750700 +1000
@@ -2751,7 +2751,7 @@
         */
        if (ARGCOUNT > 0)
        {
-           char **items = (char **)alloc(sizeof(char *) * ARGCOUNT);
+           char_u **items = (char_u **)alloc(sizeof(char_u *) * ARGCOUNT);
 
            if (items != NULL)
            {
@@ -2760,7 +2760,7 @@
                gotocmdline(TRUE);
 
                for (i = 0; i < ARGCOUNT; ++i)
-                   items[i] = (char *)alist_name(&ARGLIST[i]);
+                   items[i] = (char_u *)alist_name(&ARGLIST[i]);
                list_in_columns(items, ARGCOUNT, curwin->w_arg_idx);
                vim_free(items);
            }

Raspunde prin e-mail lui