aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/mbyte.c
diff options
context:
space:
mode:
authorPavel Platto <hinidu@gmail.com>2014-07-13 10:03:07 +0300
committerNicolas Hillegeer <nicolas@hillegeer.com>2014-07-14 20:28:40 +0200
commit47084ea7657121837536d409b9137fd38426aeef (patch)
tree1bf014cf8e25a6875bc49328deafbfc9f5e0ef88 /src/nvim/mbyte.c
parent2dc69700ec9a01b3b7cd4823e8cd3ad5431b9410 (diff)
downloadrneovim-47084ea7657121837536d409b9137fd38426aeef.tar.gz
rneovim-47084ea7657121837536d409b9137fd38426aeef.tar.bz2
rneovim-47084ea7657121837536d409b9137fd38426aeef.zip
Use strict function prototypes #945
`-Wstrict-prototypes` warn if a function is declared or defined without specifying the argument types. This warning disallow function prototypes with empty parameter list. In C, a function declared with an empty parameter list accepts an arbitrary number of arguments when being called. This is for historic reasons; originally, C functions didn't have prototypes, as C evolved from B, a typeless language. When prototypes were added, the original typeless declarations were left in the language for backwards compatibility. Instead we should provide `void` in argument list to state that function doesn't have arguments. Also this warning disallow declaring type of the parameters after the parentheses because Neovim header generator produce no declarations for old-stlyle prototypes: it expects to find `{` after prototype.
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r--src/nvim/mbyte.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c
index cb2291ee28..10e2ad5aaa 100644
--- a/src/nvim/mbyte.c
+++ b/src/nvim/mbyte.c
@@ -416,7 +416,7 @@ int enc_canon_props(char_u *name)
* When there is something wrong: Returns an error message and doesn't change
* anything.
*/
-char_u * mb_init()
+char_u * mb_init(void)
{
int i;
int idx;
@@ -620,7 +620,7 @@ char_u * mb_init()
* 4 - UCS-4 BOM
* 3 - UTF-8 BOM
*/
-int bomb_size()
+int bomb_size(void)
{
int n = 0;
@@ -2850,7 +2850,7 @@ int mb_strnicmp(char_u *s1, char_u *s2, size_t nn)
* "g8": show bytes of the UTF-8 char under the cursor. Doesn't matter what
* 'encoding' has been set to.
*/
-void show_utf8()
+void show_utf8(void)
{
int len;
int rlen = 0;
@@ -3080,7 +3080,7 @@ int mb_tail_off(char_u *base, char_u *p)
/*
* Find the next illegal byte sequence.
*/
-void utf_find_illegal()
+void utf_find_illegal(void)
{
pos_T pos = curwin->w_cursor;
char_u *p;
@@ -3147,7 +3147,7 @@ theend:
* If the cursor moves on an trail byte, set the cursor on the lead byte.
* Thus it moves left if necessary.
*/
-void mb_adjust_cursor()
+void mb_adjust_cursor(void)
{
mb_adjustpos(curbuf, &curwin->w_cursor);
}
@@ -3401,7 +3401,7 @@ static int enc_alias_search(char_u *name)
* Get the canonicalized encoding of the current locale.
* Returns an allocated string when successful, NULL when not.
*/
-char_u * enc_locale()
+char_u * enc_locale(void)
{
char *s;
char *p;
@@ -3696,7 +3696,7 @@ bool iconv_enabled(bool verbose)
return true;
}
-void iconv_end()
+void iconv_end(void)
{
/* Don't use iconv() when inputting or outputting characters. */
if (input_conv.vc_type == CONV_ICONV)