diff options
author | ZyX <kp-pav@yandex.ru> | 2016-05-30 20:55:29 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2016-05-30 20:58:15 +0300 |
commit | 77540a04582927e842c7d5522bb862756da2cbba (patch) | |
tree | aa9f9ef561e5b2a165cb3e1c092b39be87973925 /src/nvim/main.c | |
parent | 748898b4dd992c5a5d15a0e1f9f047fc42ba4fd3 (diff) | |
download | rneovim-77540a04582927e842c7d5522bb862756da2cbba.tar.gz rneovim-77540a04582927e842c7d5522bb862756da2cbba.tar.bz2 rneovim-77540a04582927e842c7d5522bb862756da2cbba.zip |
*: Rename main loop variable from loop to main_loop
Current name is inappropriate for the following reasons:
1. It is often masked by local `loop` variables.
2. It cannot be searched for. There are many `loop` variables where `loop` is
some local variable. There are many cases when “loop” word is used in
a comment.
3. It is in any case bad idea to use a generic name as a name of the global
variable. Best if global has module prefix: this is why it is in `main.h`:
`main_loop` both stands for “a main loop” and “a loop defined in `main.*`”.
Since I have no idea how to list every occurrence of this variable method used
to rename it is “remove it from globals.h, try to compile, fix errors”. Thus if
some occurrence was hidden under false `#if` branch it was not replaced.
Diffstat (limited to 'src/nvim/main.c')
-rw-r--r-- | src/nvim/main.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/main.c b/src/nvim/main.c index 71a972e8f6..2b14e6a777 100644 --- a/src/nvim/main.c +++ b/src/nvim/main.c @@ -120,6 +120,8 @@ typedef struct { # include "main.c.generated.h" #endif +Loop main_loop; + static char *argv0; // Error messages @@ -133,7 +135,7 @@ static const char *err_extra_cmd = void event_init(void) { - loop_init(&loop, NULL); + loop_init(&main_loop, NULL); // early msgpack-rpc initialization msgpack_rpc_init_method_table(); msgpack_rpc_helpers_init(); @@ -151,19 +153,19 @@ void event_init(void) void event_teardown(void) { - if (!loop.events) { + if (!main_loop.events) { return; } - queue_process_events(loop.events); + queue_process_events(main_loop.events); input_stop(); channel_teardown(); - process_teardown(&loop); + process_teardown(&main_loop); server_teardown(); signal_teardown(); terminal_teardown(); - loop_close(&loop); + loop_close(&main_loop); } /// Performs early initialization. |