aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/os
diff options
context:
space:
mode:
authordundargoc <33953936+dundargoc@users.noreply.github.com>2021-09-29 19:48:50 +0200
committerGitHub <noreply@github.com>2021-09-29 19:48:50 +0200
commitd90fb1c0bfc1e64c783c385a79e7de87013dadba (patch)
tree5a27261e9aed7ebdb95122fc888811ea5f903cc8 /src/nvim/os
parentec4731d982031e363a59efd4566fc72234bb43c8 (diff)
downloadrneovim-d90fb1c0bfc1e64c783c385a79e7de87013dadba.tar.gz
rneovim-d90fb1c0bfc1e64c783c385a79e7de87013dadba.tar.bz2
rneovim-d90fb1c0bfc1e64c783c385a79e7de87013dadba.zip
Refactor/uncrustify (#15790)
* refactor: format with uncrustify * fixup(dundar): fix functions comments * fixup(dundar): remove space between variable and ++/-- * fixup(dundar): better workaround for macro attributes This is done to be able to better use uncrustify rules for macros * fixup(justin): make preprocessors follow neovim style guide
Diffstat (limited to 'src/nvim/os')
-rw-r--r--src/nvim/os/env.c8
-rw-r--r--src/nvim/os/fs.c8
-rw-r--r--src/nvim/os/pty_process_unix.c2
-rw-r--r--src/nvim/os/users.c10
4 files changed, 14 insertions, 14 deletions
diff --git a/src/nvim/os/env.c b/src/nvim/os/env.c
index f239c9e1ec..0f363ecfc3 100644
--- a/src/nvim/os/env.c
+++ b/src/nvim/os/env.c
@@ -22,15 +22,15 @@
#include "nvim/vim.h"
#ifdef WIN32
-#include "nvim/mbyte.h" // for utf8_to_utf16, utf16_to_utf8
+# include "nvim/mbyte.h" // for utf8_to_utf16, utf16_to_utf8
#endif
#ifdef HAVE__NSGETENVIRON
-#include <crt_externs.h>
+# include <crt_externs.h>
#endif
#ifdef HAVE_SYS_UTSNAME_H
-#include <sys/utsname.h>
+# include <sys/utsname.h>
#endif
// Because `uv_os_getenv` requires allocating, we must manage a map to maintain
@@ -1161,7 +1161,7 @@ char_u *home_replace_save(buf_T *buf, char_u *src) FUNC_ATTR_NONNULL_RET
/// Function given to ExpandGeneric() to obtain an environment variable name.
char_u *get_env_name(expand_T *xp, int idx)
{
-# define ENVNAMELEN 100
+#define ENVNAMELEN 100
// this static buffer is needed to avoid a memory leak in ExpandGeneric
static char_u name[ENVNAMELEN];
assert(idx >= 0);
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index d50d68c99e..bbf70a4830 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -29,7 +29,7 @@
#include "nvim/strings.h"
#ifdef WIN32
-#include "nvim/mbyte.h" // for utf8_to_utf16, utf16_to_utf8
+# include "nvim/mbyte.h" // for utf8_to_utf16, utf16_to_utf8
#endif
#ifdef INCLUDE_GENERATED_DECLARATIONS
@@ -1226,12 +1226,12 @@ char *os_resolve_shortcut(const char *fname)
goto shortcut_errorw;
}
-# if 0 // This makes Vim wait a long time if the target does not exist.
+# if 0 // This makes Vim wait a long time if the target does not exist.
hr = pslw->lpVtbl->Resolve(pslw, NULL, SLR_NO_UI);
if (hr != S_OK) {
goto shortcut_errorw;
}
-# endif
+# endif
// Get the path to the link target.
ZeroMemory(wsz, MAX_PATH * sizeof(wchar_t));
@@ -1262,7 +1262,7 @@ shortcut_end:
return rfname;
}
-#define is_path_sep(c) ((c) == L'\\' || (c) == L'/')
+# define is_path_sep(c) ((c) == L'\\' || (c) == L'/')
/// Returns true if the path contains a reparse point (junction or symbolic
/// link). Otherwise false in returned.
bool os_is_reparse_point_include(const char *path)
diff --git a/src/nvim/os/pty_process_unix.c b/src/nvim/os/pty_process_unix.c
index d94de2e397..24ecf5c24f 100644
--- a/src/nvim/os/pty_process_unix.c
+++ b/src/nvim/os/pty_process_unix.c
@@ -157,7 +157,7 @@ static void init_child(PtyProcess *ptyproc)
FUNC_ATTR_NONNULL_ALL
{
#if defined(HAVE__NSGETENVIRON)
-#define environ (*_NSGetEnviron())
+# define environ (*_NSGetEnviron())
#else
extern char **environ;
#endif
diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c
index 2687c66f24..fd7ead68da 100644
--- a/src/nvim/os/users.c
+++ b/src/nvim/os/users.c
@@ -43,7 +43,7 @@ int os_get_usernames(garray_T *users)
}
ga_init(users, sizeof(char *), 20);
-# if defined(HAVE_GETPWENT) && defined(HAVE_PWD_H)
+#if defined(HAVE_GETPWENT) && defined(HAVE_PWD_H)
{
struct passwd *pw;
@@ -53,7 +53,7 @@ int os_get_usernames(garray_T *users)
}
endpwent();
}
-# elif defined(WIN32)
+#elif defined(WIN32)
{
DWORD nusers = 0, ntotal = 0, i;
PUSER_INFO_0 uinfo;
@@ -73,8 +73,8 @@ int os_get_usernames(garray_T *users)
NetApiBufferFree(uinfo);
}
}
-# endif
-# if defined(HAVE_GETPWNAM)
+#endif
+#if defined(HAVE_GETPWNAM)
{
const char *user_env = os_getenv("USER");
@@ -104,7 +104,7 @@ int os_get_usernames(garray_T *users)
}
}
}
-# endif
+#endif
return OK;
}