aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/globals.h
diff options
context:
space:
mode:
authorerw7 <erw7.github@gmail.com>2022-07-04 19:28:59 +0900
committerGitHub <noreply@github.com>2022-07-04 03:28:59 -0700
commit436747752bf1016d93101de24e39e192a0b721b4 (patch)
treee7e469ec692af661eb1f0e050f9ec9d3775e9b22 /src/nvim/globals.h
parentf075feee3258d15f6549e33c185f6165f9c7fbfc (diff)
downloadrneovim-436747752bf1016d93101de24e39e192a0b721b4.tar.gz
rneovim-436747752bf1016d93101de24e39e192a0b721b4.tar.bz2
rneovim-436747752bf1016d93101de24e39e192a0b721b4.zip
refactor: remove unnecessary volatile #19210
libuv does not call callback functions(uv_signal_cb) directly from signal handlers. Therefore, there is no need to use volatile. Ref. https://github.com/libuv/libuv/blob/1a91b51976a1adc6972081faa78b6b70022254d3/src/unix/signal.c#L183
Diffstat (limited to 'src/nvim/globals.h')
-rw-r--r--src/nvim/globals.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index b539d50784..f3f60ebfb7 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -503,8 +503,7 @@ EXTERN int stdout_isatty INIT(= true);
EXTERN int stdin_fd INIT(= -1);
// true when doing full-screen output, otherwise only writing some messages.
-// volatile because it is used in a signal handler.
-EXTERN volatile int full_screen INIT(= false);
+EXTERN int full_screen INIT(= false);
/// Non-zero when only "safe" commands are allowed, e.g. when sourcing .exrc or
/// .vimrc in current directory.
@@ -724,7 +723,8 @@ EXTERN bool need_highlight_changed INIT(= true);
EXTERN FILE *scriptout INIT(= NULL); ///< Stream to write script to.
-// volatile because it is used in a signal handler.
+// Note that even when handling SIGINT, volatile is not necessary because the
+// callback is not called directly from the signal handlers.
EXTERN bool got_int INIT(= false); // set to true when interrupt signal occurred
EXTERN bool bangredo INIT(= false); // set to true with ! command
EXTERN int searchcmdlen; // length of previous search cmd