hyatskov
b42c80e561
eval, ex_getln: Fix incompatible pointer types ( #8792 )
...
Fixes #8786
gcc (GCC) 8.1.1 20180531 warning:
[76/182] Building C object src/nvim/CMakeFiles/nvim.dir/ex_getln.c.o
../src/nvim/ex_getln.c: In function ‘ExpandUserDefined’:
../src/nvim/ex_getln.c:5071:34: warning: cast between incompatible function types from ‘char * (*)(const char * const, const int, const char_u * const* const, const _Bool)’ {aka ‘char * (*)(const char * const, const int, const unsigned char * const* const, const _Bool)’} to ‘void * (*)(char_u *, int, char_u **, int)’ {aka ‘void * (*)(unsigned char *, int, unsigned char **, int)’} [-Wcast-function-type]
retstr = call_user_expand_func((user_expand_func_T)call_func_retstr, xp,
2018-08-05 02:37:00 +02:00
Justin M. Keyes
5d8a47b6e0
syntax.h: fix include #8742
2018-08-05 01:50:25 +02:00
Justin M. Keyes
7a4d167a92
Merge #8742 vim-patch:8.0.0791,0831,1072,1078,1088
2018-08-04 20:12:48 +02:00
Justin M. Keyes
e861da247e
Merge #8749 from janlazo/clint-tristate
2018-08-04 19:37:58 +02:00
Justin M. Keyes
a4c9447623
Merge #8799 from janlazo/nvim-8.0.1541
2018-08-04 19:09:46 +02:00
Jan Edmund Lazo
c51c2f5a65
misc: refactor plines_win{,_nofill}()
...
Add const to params and variables (declare and init on same line).
winheight (param) is bool so replace TRUE/FALSE macros with true/false.
2018-08-02 23:11:27 -04:00
Jan Edmund Lazo
766683622a
fold: add const to foldSplit() variables
2018-08-02 18:29:16 -04:00
Jan Edmund Lazo
6710522751
fold: add const to foldUpdateIEMSRecurse() vars
2018-08-02 17:51:38 -04:00
Jan Edmund Lazo
21acc7c0fa
fold: add const to foldUpdateIEMS() variables
2018-08-02 17:29:21 -04:00
Jan Edmund Lazo
1ec5485db4
fold: add const to checkSmall() variables
2018-08-02 17:15:53 -04:00
Jan Edmund Lazo
20eeb61fb2
fold: declare and init vars in deleteFoldEntry()
...
Use sizeof() on pointer value, not explicit type, for memmove.
2018-08-02 13:10:25 -04:00
Jan Edmund Lazo
a515401cf0
fold: add const to foldMoveTo() variables
...
Declare and initialize variables on same line if possible.
2018-08-02 12:50:50 -04:00
Jan Edmund Lazo
407ac8b42d
fold: add const to deleteFold() variables
...
Declare and initialize variables on same line if possible.
2018-08-02 11:58:50 -04:00
Jan Edmund Lazo
3de785e7b5
fold: add const to hasFoldingWin() variables
...
cache is bool so update callers to pass true/false, not TRUE/FALSE.
2018-08-02 08:44:42 -04:00
Björn Linse
2b9fc9a13f
Merge pull request #8660 from phodge/7688-nvim-buf-lines-should-return-empty-list-for-unloaded-buffer
...
handle unloaded buffers in nvim_buf_*() functions
2018-08-02 13:28:36 +02:00
Jan Edmund Lazo
d2c1d9c466
ex_cmds: add const to helptags_one() variables
2018-08-01 23:21:17 -04:00
Jan Edmund Lazo
144e85b7b9
ex_cmds: add const to fix_help_buffer() variables
2018-08-01 23:02:52 -04:00
Jan Edmund Lazo
d29c02710e
hardcopy: refactor mch_print_start_line()
...
Refactor the following affected functions:
- prt_line_number()
- prt_header()
These use prt_set_font(), refactored in 872a76f3dac14fdcb7dc7b34cecd3acb4370d56f for TriState.
2018-08-01 15:28:50 -04:00
Jan Edmund Lazo
d536fb018f
hardcopy: bold,italic,underline are TriState
2018-08-01 15:28:50 -04:00
Jan Edmund Lazo
c0dbd8df95
fold: use_level,maybe_small are bool
...
use_levelp, maybe_smallp in check_closed() are bool ptrs.
2018-08-01 15:28:50 -04:00
Jan Edmund Lazo
44cb491f6e
globals: virtual_op is TriState
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
faa9869a9e
fold: recursive in deleteFoldEntry() is bool
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
14cffc3d1d
fold: fold_changed is bool
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
667b8cd108
fold: finish in foldUpdateIEMSRecurse() is bool
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
3f8ba68895
screen: screen_cleared is TriState
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
971e9370ad
fold: lineFolded() is bool
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
6dfaf8e914
fold: check_closed() returns bool
...
Update affected variables (ie. had_folded).
Add const to params to restrict usage.
TODO: refactor win_T.w_lines[idx].wl_folded from char to bool
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
4fb9b42869
search: refactor variables in findmatchlimit()
...
Combine declaration and initialization.
Refactor int variables, that use TRUE/FALSE macros (not MAYBE), to bool.
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
ba6417091c
search: start_in_quotes in findmatchlimit is TriState
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
0e55d88639
edit: dont_sync_undo is TriState
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
deae2e8434
ex_cmds: refactor utf8 variables to TriState
...
- utf8 in helptags_one()
- this_utf in fix_help_buffer()
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
f35df8d697
menu: enable in ex_menu() is TriState
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
f193b5241f
fold: fold_T.fd_small is TriState
2018-08-01 15:28:49 -04:00
Jan Edmund Lazo
9e20398908
diff: refactor diff_a_works to use TriState
2018-08-01 15:28:44 -04:00
Jan Edmund Lazo
a095a48987
clint: detect MAYBE and recommend TriState
...
Vim uses MAYBE for 3-value boolean with FALSE/TRUE/MAYBE.
Use TriState type instead to restrict to 3 values, kFalse/kTrue/kNone.
2018-08-01 15:23:01 -04:00
Jan Edmund Lazo
c83ecee885
syntax: syn_pattern.sp_syncing is bool
2018-07-30 18:09:34 -04:00
Jan Edmund Lazo
1c5eee3c91
syntax: add const to get_syntax_attr() params
2018-07-30 16:19:38 -04:00
Jan Edmund Lazo
8f647cf03c
syntax: add const to syn_finish_line() params,vars
2018-07-30 15:29:22 -04:00
Jan Edmund Lazo
eafcfb2fb5
syntax: did_header is bool
...
Refactor all affected functions:
- add const
- declare and initialize on same line
- update boolean declarations from int with bool
2018-07-29 20:28:44 -04:00
Jan Edmund Lazo
d3f609db05
syntax: disptick_T is uint16_t
2018-07-29 18:03:16 -04:00
Jan Edmund Lazo
3feabcacb0
syntax: scl_id is int
2018-07-29 08:20:00 -04:00
Jan Edmund Lazo
3e6d3bf3bd
vim-patch:8.0.1088: occasional memory use after free
...
Problem: Occasional memory use after free.
Solution: Use the highlight table directly, don't keep a pointer.
414168d97f
2018-07-29 07:52:45 -04:00
Jan Edmund Lazo
f0ca2283b0
vim-patch:8.0.1078: using freed memory with ":hi Normal"
...
Problem: Using freed memory with ":hi Normal".
Solution: Get "item" again after updating the table.
b4ea1914b8
2018-07-29 07:52:45 -04:00
Jan Edmund Lazo
6b7b56dabe
vim-patch:8.0.1072: :highlight command causes a redraw even when nothing changed
...
Problem: The :highlight command causes a redraw even when nothing changed.
Solution: Only set "need_highlight_changed" when an attribute changed.
99433291b1
2018-07-29 07:52:45 -04:00
Jan Edmund Lazo
0c0318f8a7
vim-patch:8.0.0831: with 8 colors the bold attribute is not set properly
...
Problem: With 8 colors the bold attribute is not set properly.
Solution: Move setting HL_TABLE() out of lookup_color. (closes vim/vim#1901 )
12d853fae1
Use TriState on lookup_color() to avoid 'NOLINT' comments.
2018-07-29 07:52:45 -04:00
Jan Edmund Lazo
5af90e2ee7
vim-patch:8.0.0791: terminal colors depend on the system
...
Problem: Terminal colors depend on the system.
Solution: Use the highlight color lookup tables.
b41bf8e6b4
2018-07-29 07:52:45 -04:00
Jan Edmund Lazo
51f939e912
syntax: refactor get_id_list()
...
Add const to parameters and variables.
Declare and init variables on same line.
Use `sizeof(*ptr)` to calculate size for malloc().
2018-07-29 07:51:51 -04:00
Jan Edmund Lazo
c18a1b9034
syntax: refactor syn_combine_list()
...
Add const on parameters and variables.
Update declarations to avoid typecasts.
Use `sizeof(*ptr)` for malloc() to reduce effect of type changes.
ie. short to int16_t
Update syn_compare_stub() variable declarations for consistency.
2018-07-29 07:51:51 -04:00
Jan Edmund Lazo
6646502bbb
syntax: syn_cluster_T.scl_list is int16_t*
2018-07-29 07:51:51 -04:00
Jan Edmund Lazo
8888a6ce80
syntax: refactor syn_current_attr()
...
Declare and initialize variables on same line if possible.
Add const to parameters and variables.
Use bool for any parameter,variable using TRUE/FALSE macros.
Replace 'short' type with 'int16_t'.
2018-07-29 07:51:51 -04:00