Commit Graph

8197 Commits

Author SHA1 Message Date
ZyX
7cf4b0ac06 screen: Silence “buffer underflow” warning 2017-04-16 21:18:00 +03:00
ZyX
a65867542d screen: Remove unneeded check 2017-04-16 21:17:08 +03:00
ZyX
b396a3f72e quicfix: Avoid possible NULL dereference 2017-04-16 21:13:49 +03:00
ZyX
4e7150ee94 quicfix: Remove duplicate condition 2017-04-16 21:13:25 +03:00
ZyX
be9d98cb45 quickfix: Remove unneeded condition
fmt_ptr was checked for being NULL in if() condition earlier.
2017-04-16 21:13:24 +03:00
ZyX
aa3b1f695f normal: Add figure braces so that code is clearer 2017-04-16 21:13:24 +03:00
ZyX
b5db7cde36 normal: Clarify the code
Current variant works only because of PUT_FIXINDENT being equal to true.
2017-04-16 21:13:24 +03:00
ZyX
54bd78b8a8 normal: Remove unneeded assignment 2017-04-16 21:06:22 +03:00
ZyX
cdbfff077b ops: Silence “counter not used in loop” false positive 2017-04-16 21:05:50 +03:00
ZyX
84aa457ccd os/env: Fix “invalid pointer to local” false positive 2017-04-16 21:02:43 +03:00
ZyX
dc523eed8e fileio: Silence “!= identical subexpressions” warning 2017-04-16 20:59:58 +03:00
ZyX
0718d0e6d4 message: Some more has_mbyte/enc_utf8 removal 2017-04-16 20:58:19 +03:00
ZyX
083792e137 message: Remove some enc_utf8/… checks 2017-04-16 20:56:30 +03:00
ZyX
10ce00efa8 memline: Fix “NULL pointer dereference” warning
It was actually a false positive indicating always-true condition, not real 
dereference.
2017-04-16 20:55:29 +03:00
ZyX
2394c9f2b7 memline: Silence “buffer underflow” warning, looks like false positive 2017-04-16 20:47:06 +03:00
ZyX
0f7c260cd8 fileio: Simlify help files encoding detection
Most of code is dead when enc_utf8 is always true. Given that `c` is being 
reused for other purposes I left it set to 1 just in case.
2017-04-16 20:39:57 +03:00
ZyX
e3de83a829 hardcopy: Remove unneeded prt_do_conv assignment 2017-04-16 20:32:10 +03:00
ZyX
d88ae748b5 getchar: Fix if block indentation 2017-04-16 20:29:19 +03:00
ZyX
fe01e9c947 ex_docmd: Remove unneeded if() 2017-04-16 20:27:47 +03:00
ZyX
87e107d921 ex_docmd: Remove :Ni! easter egg 2017-04-16 20:27:20 +03:00
ZyX
a894c82def ex_docmd: Remove excessive assignment 2017-04-16 20:25:00 +03:00
ZyX
d766607dc9 farsi: Simplify condition 2017-04-16 20:24:30 +03:00
ZyX
c5010c98ae eval: Fix position of buf declaration 2017-04-16 20:22:58 +03:00
ZyX
1bc0800787 eval: Remove unneeded !eap->skip check
Already checked in the outer if().
2017-04-16 20:22:12 +03:00
ZyX
9dd1926df0 eval: Remove unneeded varp check 2017-04-16 20:20:53 +03:00
ZyX
9b1dd08425 eval: Remove unneeded varp check 2017-04-16 20:20:38 +03:00
ZyX
787d71a3af eval: Fix condition in f_serverstop 2017-04-16 20:19:10 +03:00
ZyX
fbdef2e6f2 eval: Refactor nr2char()
Adds error messages, checks type and ignores the second argument.

Currently utf_char2bytes is able to handle any 31-bit character, not
limited by a unicode range. So checking for INT_MAX and not for
something else: function yet uses `int`.
2017-04-16 20:16:55 +03:00
ZyX
3c5f4b382f eval: Silence octal constant warning 2017-04-16 20:08:56 +03:00
ZyX
31190879cc eval: Fix useless NULL check
partial_name() as it is written now really cannot return NULL
2017-04-16 20:07:54 +03:00
ZyX
7c9e3d6cad eval: Refactor f_char2nr
With has_mbyte equal to 1 and &encoding always UTF-8 second argument is no 
longer useful: utf_ptr2char is the same as mb_ptr2char.

Also changes function behaviour a bit: now if second argument is not a number it 
immediately returns with error, without bothering to get a character.
2017-04-16 20:02:06 +03:00
ZyX
97a1ccf8e7 eval: Fix V547: d == NULL was already checked at line 2986 2017-04-16 19:56:55 +03:00
ZyX
05c1829a8c eval: Silence eap->skip false positives
`lnum` starts at `eap->line2` in case of skipping, so cycle is always run at 
least once.
2017-04-16 19:55:49 +03:00
ZyX
d70a0f6895 eval/typval_encode: Silence then/else equivalence warning 2017-04-16 19:51:35 +03:00
ZyX
dd5b0cc17a edit: Copy assert to before the warning 2017-04-16 19:50:23 +03:00
ZyX
fb4754104b macros: Fix excessive check 2017-04-16 19:39:55 +03:00
ZyX
9e9ba14e0e edit: Fix strange code
Based on the flow it looks like ptr could not be NULL here: if ptr_arg is NULL 
ptr is compl_leader, if compl_leader is NULL function exits. This also applies 
to Vim as far as I see.
2017-04-16 19:38:16 +03:00
ZyX
4f0fc1f06a digraph: Fix errors due to has_mbyte and friends being fixed 2017-04-16 19:32:38 +03:00
ZyX
2901921a1b digraph: Ignore false positive
Reversed order is intentional, digraphs allow swapping characters.
2017-04-16 19:30:18 +03:00
ZyX
a096766ee3 diff: Silence -V519
Not exactly a false positive, but previous assignment is a part of the pattern 
“change global, run code which uses it, change global back”.
2017-04-16 19:27:17 +03:00
ZyX
33952a7661 *: Silence some false positives 2017-04-16 19:18:54 +03:00
Justin M. Keyes
77a4f8f235 Merge #6219 from jbradaric/vim-7.4.2170
vim-patch:7.4.{2170,2180,2240,2241,2242}
2017-04-16 16:49:14 +02:00
Nikolai Aleksandrovich Pavlov
d4c7f74ed1 Merge pull request #6493 from ZyX-I/pvs-script
[RFC] scripts: Create script which checks Neovim with PVS-studio
2017-04-16 03:03:38 +03:00
Justin M. Keyes
5c805f4566 Merge #6528 from ZyX-I/revise-malloc-attr
Revise places where FUNC_ATTR_MALLOC is present

Closes #6521
2017-04-15 22:12:31 +02:00
Jurica Bradaric
ec0fabd4d5 eval.c: Code style fixes 2017-04-15 18:48:06 +02:00
ZyX
d76a13bb65 os/shell: Remove FUNC_ATTR_MALLOC from shell_build_argv
Returns an array of allocated strings.
2017-04-15 19:39:53 +03:00
ZyX
ac47e64eca ops: Remove FUNC_ATTR_MALLOC from copy_register
Returned storage has a pointer to a newly allocated array.
2017-04-15 19:25:00 +03:00
ZyX
d191ba1db3 option: Remove FUNC_ATTR_MALLOC from get_winbuf_options
Same as tv_dict_alloc() and additionally it saves some strings inside 
a dictionary.
2017-04-15 19:23:00 +03:00
ZyX
82ba2891ae eval/typval: Remove FUNC_ATTR_MALLOC from tv_list_alloc_ret
Same as tv_list_alloc, but additionally ret_tv receives pointer to the newly 
allocated list.
2017-04-15 19:19:22 +03:00
ZyX
af3579d5f7 eval/typval: Remove FUNC_ATTR_MALLOC from tv_dict_alloc
Allocated dict points to previously allocated dict.
Queue in allocated dict points to itself.
Hashtab in allocated dict points to inside itself.
Allocated dict is saved to gc_first_dict.
2017-04-15 19:18:25 +03:00