On 17-Nov-2019 04:23, Bram Moolenaar wrote:
Patch 8.1.2304
Problem: Cannot get the mouse position when getting a mouse click.
Solution: Add getmousepos().
Files: runtime/doc/eval.txt, runtime/doc/popup.txt, src/mouse.c
src/proto/mouse.pro, src/evalfunc.c, src/popupwin.c,
src/popupwin.pro, src/testdir/test_popupwin.vim,
src/testdir/test_functions.vim
After this patch, mingw64 (gcc 9.2.1) throws this warning:
gcc -c -I. -Iproto -DWIN32 -DWINVER=0x0603 -D_WIN32_WINNT=0x0603
-DHAVE_PATHDEF -DFEAT_NORMAL -DHAVE_STDINT_H -DFEAT_GUI_MSWIN
-DFEAT_CLIPBOARD -pipe -march=native -Wall -O3 -fomit-frame-pointer
-freg-struct-return mouse.c -o gobjnative/mouse.o
mouse.c: In function 'f_getmousepos':
mouse.c:3056:34: warning: passing argument 4 of 'mouse_comp_pos' from
incompatible pointer type [-Wincompatible-pointer-types]
3056 | mouse_comp_pos(wp, &row, &col, &line, NULL);
| ^~~~~
| |
| varnumber_T * {aka long long
int *}
mouse.c:2816:15: note: expected 'linenr_T *' {aka 'long int *'} but
argument is of type 'varnumber_T *' {aka 'long long int *'}
2816 | linenr_T *lnump,
| ~~~~~~~~~~^~~~~
Please check the attached patch which tries to fix 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/306628f1-b9fd-0b9f-c09f-90d79453ac8a%40internode.on.net.
--- mouse.c.orig 2019-11-17 05:42:44.451810300 +1100
+++ mouse.c 2019-11-17 05:57:50.026986800 +1100
@@ -3019,7 +3019,7 @@
varnumber_T winid = 0;
varnumber_T winrow = 0;
varnumber_T wincol = 0;
- varnumber_T line = 0;
+ linenr_T line = 0;
varnumber_T column = 0;
if (rettv_dict_alloc(rettv) != OK)
@@ -3061,7 +3061,7 @@
dict_add_number(d, "winid", winid);
dict_add_number(d, "winrow", winrow);
dict_add_number(d, "wincol", wincol);
- dict_add_number(d, "line", line);
+ dict_add_number(d, "line", (varnumber_T)line);
dict_add_number(d, "column", column);
}
#endif