aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2023-04-26 23:23:44 +0200
committerGitHub <noreply@github.com>2023-04-26 23:23:44 +0200
commit3b0df1780e2c8526bda5dead18ee7cc45925caba (patch)
treec8415dc986f1cd3ddf6044b4ec0318a089db3ed7 /src/nvim/os
parent7d0479c55810af9bf9f115ba69d1419ea81ec41e (diff)
downloadrneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.tar.gz
rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.tar.bz2
rneovim-3b0df1780e2c8526bda5dead18ee7cc45925caba.zip
refactor: uncrustify
Notable changes: replace all infinite loops to `while(true)` and remove `int` from `unsigned int`.
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/env.c2
-rw-r--r--src/nvim/os/fs.c2
-rw-r--r--src/nvim/os/input.c4
-rw-r--r--src/nvim/os/process.c2
-rw-r--r--src/nvim/os/shell.c2
5 files changed, 6 insertions, 6 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index ad98a5b97e..f931e00916 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -1084,7 +1084,7 @@ size_t home_replace(const buf_T *const buf, const char *src, char *const dst, si
// er's home directory)).
char *p = homedir;
size_t len = dirlen;
- for (;;) {
+ while (true) {
if (len
&& path_fnamencmp(src, p, len) == 0
&& (vim_ispathsep(src[len])
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index b13afba727..d270f8767e 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -339,7 +339,7 @@ static bool is_executable_in_path(const char *name, char **abspath)
// is an executable file.
char *p = path;
bool rv = false;
- for (;;) {
+ while (true) {
char *e = xstrchrnul(p, ENV_SEPCHAR);
// Combine the $PATH segment with `name`.
diff --git a/src/nvim/os/input.c b/src/nvim/os/input.c
index e9f23eba40..fa9ff6e9b1 100644
--- a/src/nvim/os/input.c
+++ b/src/nvim/os/input.c
@@ -253,7 +253,7 @@ size_t input_enqueue(String keys)
// K_SPECIAL(0x80).
uint8_t buf[19] = { 0 };
// Do not simplify the keys here. Simplification will be done later.
- unsigned int new_size
+ unsigned new_size
= trans_special((const char **)&ptr, (size_t)(end - ptr), (char *)buf, FSK_KEYCODE, true,
NULL);
@@ -346,7 +346,7 @@ static uint8_t check_multiclick(int code, int grid, int row, int col)
// Mouse event handling code(Extract row/col if available and detect multiple
// clicks)
-static unsigned int handle_mouse_event(char **ptr, uint8_t *buf, unsigned int bufsize)
+static unsigned handle_mouse_event(char **ptr, uint8_t *buf, unsigned bufsize)
{
int mouse_code = 0;
int type = 0;
diff --git a/src/nvim/os/process.c b/src/nvim/os/process.c
index f4d95e141b..2a248a1e32 100644
--- a/src/nvim/os/process.c
+++ b/src/nvim/os/process.c
@@ -72,7 +72,7 @@ static bool os_proc_tree_kill_rec(HANDLE process, int sig)
}
theend:
- return (bool)TerminateProcess(process, (unsigned int)sig);
+ return (bool)TerminateProcess(process, (unsigned)sig);
}
/// Kills process `pid` and its descendants recursively.
bool os_proc_tree_kill(int pid, int sig)
diff --git a/src/nvim/os/shell.c b/src/nvim/os/shell.c
index 52cab63989..979c6153aa 100644
--- a/src/nvim/os/shell.c
+++ b/src/nvim/os/shell.c
@@ -1225,7 +1225,7 @@ static void read_input(DynamicBuffer *buf)
linenr_T lnum = curbuf->b_op_start.lnum;
char *lp = ml_get(lnum);
- for (;;) {
+ while (true) {
l = strlen(lp + written);
if (l == 0) {
len = 0;