diff options
author | Pavel Platto <hinidu@gmail.com> | 2014-07-13 10:03:07 +0300 |
---|---|---|
committer | Nicolas Hillegeer <nicolas@hillegeer.com> | 2014-07-14 20:28:40 +0200 |
commit | 47084ea7657121837536d409b9137fd38426aeef (patch) | |
tree | 1bf014cf8e25a6875bc49328deafbfc9f5e0ef88 /src/nvim/os/event.c | |
parent | 2dc69700ec9a01b3b7cd4823e8cd3ad5431b9410 (diff) | |
download | rneovim-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/os/event.c')
-rw-r--r-- | src/nvim/os/event.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/os/event.c b/src/nvim/os/event.c index a9e97c9190..4e091716b2 100644 --- a/src/nvim/os/event.c +++ b/src/nvim/os/event.c @@ -33,7 +33,7 @@ typedef struct { #endif static klist_t(Event) *deferred_events, *immediate_events; -void event_init() +void event_init(void) { // Initialize the event queues deferred_events = kl_init(Event); @@ -52,7 +52,7 @@ void event_init() server_init(); } -void event_teardown() +void event_teardown(void) { channel_teardown(); job_teardown(); @@ -122,7 +122,7 @@ bool event_poll(int32_t ms) return !timer_data.timed_out && (events_processed || event_has_deferred()); } -bool event_has_deferred() +bool event_has_deferred(void) { return !kl_empty(get_queue(true)); } |