From 73a970ccd982cba90dbe9f536a0ba3bca6cbe5b0 Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Thu, 20 Nov 2014 17:38:51 +0100 Subject: Linting: Fix header guards, add whitespace. --- src/nvim/os/fs_defs.h | 2 +- src/nvim/os/os_defs.h | 2 +- src/nvim/os/unix_defs.h | 6 +++--- src/nvim/os/win_defs.h | 6 +++--- src/nvim/os_unix_defs.h | 6 +++--- 5 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/nvim/os/fs_defs.h b/src/nvim/os/fs_defs.h index ab4c05b965..e4d79aab66 100644 --- a/src/nvim/os/fs_defs.h +++ b/src/nvim/os/fs_defs.h @@ -14,6 +14,6 @@ typedef struct { uint64_t device_id; ///< @private The id of the device containing the file } FileID; -#define FILE_ID_EMPTY (FileID){.inode = 0, .device_id = 0} +#define FILE_ID_EMPTY (FileID) {.inode = 0, .device_id = 0} #endif // NVIM_OS_FS_DEFS_H diff --git a/src/nvim/os/os_defs.h b/src/nvim/os/os_defs.h index aa6c5bccc3..ec94324df4 100644 --- a/src/nvim/os/os_defs.h +++ b/src/nvim/os/os_defs.h @@ -7,4 +7,4 @@ # include "nvim/os/unix_defs.h" #endif -#endif // NVIM_OS_DEFS_H +#endif // NVIM_OS_OS_DEFS_H diff --git a/src/nvim/os/unix_defs.h b/src/nvim/os/unix_defs.h index 197a87bcc5..e518ac67e5 100644 --- a/src/nvim/os/unix_defs.h +++ b/src/nvim/os/unix_defs.h @@ -1,7 +1,7 @@ -#ifndef NEOVIM_OS_UNIX_DEFS_H -#define NEOVIM_OS_UNIX_DEFS_H +#ifndef NVIM_OS_UNIX_DEFS_H +#define NVIM_OS_UNIX_DEFS_H #define TEMP_DIR_NAMES {"$TMPDIR", "/tmp", ".", "$HOME"} #define TEMP_FILE_PATH_MAXLEN 256 -#endif // NEOVIM_OS_UNIX_DEFS_H +#endif // NVIM_OS_UNIX_DEFS_H diff --git a/src/nvim/os/win_defs.h b/src/nvim/os/win_defs.h index 49fcb64777..bea147ad2d 100644 --- a/src/nvim/os/win_defs.h +++ b/src/nvim/os/win_defs.h @@ -1,9 +1,9 @@ -#ifndef NEOVIM_OS_WIN_DEFS_H -#define NEOVIM_OS_WIN_DEFS_H +#ifndef NVIM_OS_WIN_DEFS_H +#define NVIM_OS_WIN_DEFS_H #include #define TEMP_DIR_NAMES {"$TMP", "$TEMP", "$USERPROFILE", ""} #define TEMP_FILE_PATH_MAXLEN _MAX_PATH -#endif // NEOVIM_OS_WIN_DEFS_H +#endif // NVIM_OS_WIN_DEFS_H diff --git a/src/nvim/os_unix_defs.h b/src/nvim/os_unix_defs.h index ebea86ebcf..adea2ad22f 100644 --- a/src/nvim/os_unix_defs.h +++ b/src/nvim/os_unix_defs.h @@ -1,5 +1,5 @@ -#ifndef NVIM_OS_UNIX_DEFS_H -#define NVIM_OS_UNIX_DEFS_H +#ifndef NVIM_OS_UNIX_DEFS_LEGACY_H +#define NVIM_OS_UNIX_DEFS_LEGACY_H /* * VIM - Vi IMproved by Bram Moolenaar @@ -253,4 +253,4 @@ /* We have three kinds of ACL support. */ #define HAVE_ACL (HAVE_POSIX_ACL || HAVE_SOLARIS_ACL || HAVE_AIX_ACL) -#endif // NVIM_OS_UNIX_DEFS_H +#endif // NVIM_OS_UNIX_DEFS_LEGACY_H -- cgit From 0f258e44530aa4c7b8266a548806159584fc3197 Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Wed, 26 Nov 2014 00:19:58 +0100 Subject: Linting: Fix strcpy warning. --- src/nvim/os/fs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c index bdaf9ecdda..242f8fb461 100644 --- a/src/nvim/os/fs.c +++ b/src/nvim/os/fs.c @@ -4,6 +4,7 @@ #include #include "nvim/os/os.h" +#include "nvim/os/os_defs.h" #include "nvim/ascii.h" #include "nvim/memory.h" #include "nvim/message.h" @@ -331,7 +332,7 @@ int os_mkdtemp(const char *template, char *path) uv_fs_t request; int result = uv_fs_mkdtemp(uv_default_loop(), &request, template, NULL); if (result == kLibuvSuccess) { - strcpy(path, request.path); + STRNCPY(path, request.path, TEMP_FILE_PATH_MAXLEN); } uv_fs_req_cleanup(&request); return result; -- cgit From ed9828140a343145e247a76e175912dcd785899d Mon Sep 17 00:00:00 2001 From: Florian Walch Date: Wed, 26 Nov 2014 15:04:33 +0100 Subject: Linting: Suppress warnings in os/users.c. --- src/nvim/os/users.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/os/users.c b/src/nvim/os/users.c index 99479b0bae..a57ba41af1 100644 --- a/src/nvim/os/users.c +++ b/src/nvim/os/users.c @@ -52,7 +52,7 @@ int os_get_uname(uid_t uid, char *s, size_t len) #if defined(HAVE_PWD_H) && defined(HAVE_GETPWUID) struct passwd *pw; - if ((pw = getpwuid(uid)) != NULL + if ((pw = getpwuid(uid)) != NULL // NOLINT(runtime/threadsafe_fn) && pw->pw_name != NULL && *(pw->pw_name) != NUL) { STRLCPY(s, pw->pw_name, len); return OK; @@ -72,7 +72,7 @@ char *os_get_user_directory(const char *name) if (name == NULL) { return NULL; } - pw = getpwnam(name); + pw = getpwnam(name); // NOLINT(runtime/threadsafe_fn) if (pw != NULL) { // save the string from the static passwd entry into malloced memory return xstrdup(pw->pw_dir); -- cgit