aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-08-14 09:48:21 +0200
committerJustin M. Keyes <justinkz@gmail.com>2019-08-15 00:28:41 +0200
commit975be7e5dcf6a2ee59a6fc236e75b434b6ce4423 (patch)
tree61db44375632313a444117d342b9232463b69c24
parentc9a0875ea8ecae670b3dc7abfa2103b0719888a4 (diff)
downloadrneovim-975be7e5dcf6a2ee59a6fc236e75b434b6ce4423.tar.gz
rneovim-975be7e5dcf6a2ee59a6fc236e75b434b6ce4423.tar.bz2
rneovim-975be7e5dcf6a2ee59a6fc236e75b434b6ce4423.zip
build/win: fix warnings
../src/nvim/os/fs.c: In function 'os_can_exe': ../src/nvim/os/fs.c:247:27: warning: passing argument 1 of 'is_executable_ext' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] 247 | if (is_executable_ext(name, abspath)) { | ^~~~ In file included from ../src/nvim/os/fs.c:36: src/nvim/auto/os/fs.c.generated.h:7:38: note: expected 'char *' but argument is of type 'const char *' 7 | static _Bool is_executable_ext(char *name, char **abspath) FUNC_ATTR_NONNULL_ARG(1); | ~~~~~~^~~~ ../src/nvim/os/fs.c: In function 'os_resolve_shortcut': ../src/nvim/os/fs.c:1183:56: warning: conversion from 'size_t' {aka 'const long long unsigned int'} to 'int' may change value [-Wconversion] 1183 | const int conversion_result = utf8_to_utf16(fname, len, &p); | ^~~ ../src/nvim/os/fs.c:1211:19: warning: declaration of 'conversion_result' shadows a previous local [-Wshadow] 1211 | const int conversion_result = utf16_to_utf8(wsz, -1, &rfname); | ^~~~~~~~~~~~~~~~~ ../src/nvim/os/fs.c:1183:15: note: shadowed declaration is here 1183 | const int conversion_result = utf8_to_utf16(fname, len, &p); | ^~~~~~~~~~~~~~~~~
-rw-r--r--src/nvim/os/fs.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/nvim/os/fs.c b/src/nvim/os/fs.c
index ad14fc2d5e..ae922e4040 100644
--- a/src/nvim/os/fs.c
+++ b/src/nvim/os/fs.c
@@ -293,7 +293,7 @@ static bool is_executable(const char *name, char **abspath)
/// Checks if file `name` is executable under any of these conditions:
/// - extension is in $PATHEXT and `name` is executable
/// - result of any $PATHEXT extension appended to `name` is executable
-static bool is_executable_ext(char *name, char **abspath)
+static bool is_executable_ext(const char *name, char **abspath)
FUNC_ATTR_NONNULL_ARG(1)
{
const bool is_unix_shell = strstr((char *)path_tail(p_sh), "sh") != NULL;
@@ -1180,9 +1180,9 @@ char *os_resolve_shortcut(const char *fname)
&IID_IShellLinkW, (void **)&pslw);
if (hr == S_OK) {
wchar_t *p;
- const int conversion_result = utf8_to_utf16(fname, len, &p);
- if (conversion_result != 0) {
- EMSG2("utf8_to_utf16 failed: %d", conversion_result);
+ const int r = utf8_to_utf16(fname, -1, &p);
+ if (r != 0) {
+ EMSG2("utf8_to_utf16 failed: %d", r);
} else if (p != NULL) {
// Get a pointer to the IPersistFile interface.
hr = pslw->lpVtbl->QueryInterface(
@@ -1208,9 +1208,9 @@ char *os_resolve_shortcut(const char *fname)
ZeroMemory(wsz, MAX_PATH * sizeof(wchar_t));
hr = pslw->lpVtbl->GetPath(pslw, wsz, MAX_PATH, &ffdw, 0);
if (hr == S_OK && wsz[0] != NUL) {
- const int conversion_result = utf16_to_utf8(wsz, -1, &rfname);
- if (conversion_result != 0) {
- EMSG2("utf16_to_utf8 failed: %d", conversion_result);
+ const int r2 = utf16_to_utf8(wsz, -1, &rfname);
+ if (r2 != 0) {
+ EMSG2("utf16_to_utf8 failed: %d", r2);
}
}