summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-01-13 23:51:14 +0100
committerBram Moolenaar <Bram@vim.org>2019-01-13 23:51:14 +0100
commitb1443b480fe9965a6eaa9211657d299e88964084 (patch)
tree90f624e14617d31e6d32bdd4d6cb6e8633523252
parentf9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d (diff)
patch 8.1.0744: compiler warnings for signed/unsigned stringsv8.1.0744
Problem: Compiler warnings for signed/unsigned strings. Solution: A few more type cast fixes.
-rw-r--r--src/if_perl.xs10
-rw-r--r--src/if_py_both.h16
-rw-r--r--src/integration.c6
-rw-r--r--src/option.c6
-rw-r--r--src/version.c2
5 files changed, 23 insertions, 17 deletions
diff --git a/src/if_perl.xs b/src/if_perl.xs
index 09a7fba4c0..356108598b 100644
--- a/src/if_perl.xs
+++ b/src/if_perl.xs
@@ -1562,11 +1562,11 @@ Eval(str)
SV*
Blob(SV* sv)
PREINIT:
- STRLEN len;
- char *s;
- int i;
- char buf[3];
- SV* newsv;
+ STRLEN len;
+ char *s;
+ unsigned i;
+ char buf[3];
+ SV* newsv;
CODE:
s = SvPVbyte(sv, len);
diff --git a/src/if_py_both.h b/src/if_py_both.h
index 165c847283..85141e11a0 100644
--- a/src/if_py_both.h
+++ b/src/if_py_both.h
@@ -410,6 +410,12 @@ writer(writefn fn, char_u *str, PyInt n)
}
static int
+msg_wrapper(char *text)
+{
+ return msg((char_u *)text);
+}
+
+ static int
write_output(OutputObject *self, PyObject *string)
{
Py_ssize_t len = 0;
@@ -421,7 +427,7 @@ write_output(OutputObject *self, PyObject *string)
Py_BEGIN_ALLOW_THREADS
Python_Lock_Vim();
- writer((writefn)(error ? emsg : msg), (char_u *)str, len);
+ writer((writefn)(error ? emsg : msg_wrapper), (char_u *)str, len);
Python_Release_Vim();
Py_END_ALLOW_THREADS
PyMem_Free(str);
@@ -634,7 +640,7 @@ VimTryEnd(void)
else if (msg_list != NULL && *msg_list != NULL)
{
int should_free;
- char_u *msg;
+ char *msg;
msg = get_exception_string(*msg_list, ET_ERROR, NULL, &should_free);
@@ -644,7 +650,7 @@ VimTryEnd(void)
return -1;
}
- PyErr_SetVim((char *) msg);
+ PyErr_SetVim(msg);
free_global_msglist();
@@ -3483,13 +3489,13 @@ OptionsIter(OptionsObject *self)
static int
set_option_value_err(char_u *key, int numval, char_u *stringval, int opt_flags)
{
- char_u *errmsg;
+ char *errmsg;
if ((errmsg = set_option_value(key, numval, stringval, opt_flags)))
{
if (VimTryEnd())
return FAIL;
- PyErr_SetVim((char *)errmsg);
+ PyErr_SetVim(errmsg);
return FAIL;
}
return OK;
diff --git a/src/integration.c b/src/integration.c
index a94581586d..eb6ccda0a9 100644
--- a/src/integration.c
+++ b/src/integration.c
@@ -303,7 +303,7 @@ messageFromEserve(XtPointer clientData UNUSED,
char buffer[2*MAXPATHLEN];
vim_snprintf(buffer, sizeof(buffer),
NOCATGETS("currentFile %d %s"),
- f ? strlen(f) : 0, f ? f : "");
+ f ? (int)strlen(f) : 0, f ? f : "");
workshop_send_message(buffer);
} else if (strcmp(cmd, NOCATGETS("getCursorRow")) == 0) {
int row = workshop_test_getcursorrow();
@@ -322,14 +322,14 @@ messageFromEserve(XtPointer clientData UNUSED,
char buffer[2*MAXPATHLEN];
vim_snprintf(buffer, sizeof(buffer),
NOCATGETS("cursorRowText %d %s"),
- t ? strlen(t) : 0, t ? t : "");
+ t ? (int)strlen(t) : 0, t ? t : "");
workshop_send_message(buffer);
} else if (strcmp(cmd, NOCATGETS("getSelectedText")) == 0) {
char *t = workshop_test_getselectedtext();
char buffer[2*MAXPATHLEN];
vim_snprintf(buffer, sizeof(buffer),
NOCATGETS("selectedText %d %s"),
- t ? strlen(t) : 0, t ? t : "");
+ t ? (int)strlen(t) : 0, t ? t : "");
workshop_send_message(buffer);
#endif
}
diff --git a/src/option.c b/src/option.c
index 2d5eb32692..414e65a1f1 100644
--- a/src/option.c
+++ b/src/option.c
@@ -6965,9 +6965,9 @@ did_set_string_option(
else if (varp == &p_guifontset)
{
if (STRCMP(p_guifontset, "*") == 0)
- errmsg = (char_u *)N_("E597: can't select fontset");
+ errmsg = N_("E597: can't select fontset");
else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK)
- errmsg = (char_u *)N_("E598: Invalid fontset");
+ errmsg = N_("E598: Invalid fontset");
redraw_gui_only = TRUE;
}
# endif
@@ -7687,7 +7687,7 @@ did_set_string_option(
p = (char_u *)MOUSE_ALL;
#else
if (*p_mouse != NUL)
- errmsg = (char_u *)N_("E538: No mouse support");
+ errmsg = N_("E538: No mouse support");
#endif
}
#if defined(FEAT_GUI)
diff --git a/src/version.c b/src/version.c
index d40380cce4..69bbcfc1f2 100644
--- a/src/version.c
+++ b/src/version.c
@@ -796,7 +796,7 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
- 743,
+ 744,
/**/
743,
/**/