aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/msgpack_rpc/server.c
diff options
context:
space:
mode:
authorZyX <kp-pav@yandex.ru>2016-05-30 20:55:29 +0300
committerZyX <kp-pav@yandex.ru>2016-05-30 20:58:15 +0300
commit77540a04582927e842c7d5522bb862756da2cbba (patch)
treeaa9f9ef561e5b2a165cb3e1c092b39be87973925 /src/nvim/msgpack_rpc/server.c
parent748898b4dd992c5a5d15a0e1f9f047fc42ba4fd3 (diff)
downloadrneovim-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/msgpack_rpc/server.c')
-rw-r--r--src/nvim/msgpack_rpc/server.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nvim/msgpack_rpc/server.c b/src/nvim/msgpack_rpc/server.c
index 6cc56ba3dd..abbd3e8aff 100644
--- a/src/nvim/msgpack_rpc/server.c
+++ b/src/nvim/msgpack_rpc/server.c
@@ -12,6 +12,7 @@
#include "nvim/eval.h"
#include "nvim/garray.h"
#include "nvim/vim.h"
+#include "nvim/main.h"
#include "nvim/memory.h"
#include "nvim/log.h"
#include "nvim/fileio.h"
@@ -108,7 +109,7 @@ int server_start(const char *endpoint)
}
SocketWatcher *watcher = xmalloc(sizeof(SocketWatcher));
- socket_watcher_init(&loop, watcher, endpoint, NULL);
+ socket_watcher_init(&main_loop, watcher, endpoint, NULL);
// Check if a watcher for the endpoint already exists
for (int i = 0; i < watchers.ga_len; i++) {