Mercurial > vim
diff src/if_py_both.h @ 15472:0fcc1315c061 v8.1.0744
patch 8.1.0744: compiler warnings for signed/unsigned strings
commit https://github.com/vim/vim/commit/b1443b480fe9965a6eaa9211657d299e88964084
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Jan 13 23:51:14 2019 +0100
patch 8.1.0744: compiler warnings for signed/unsigned strings
Problem: Compiler warnings for signed/unsigned strings.
Solution: A few more type cast fixes.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 14 Jan 2019 00:00:04 +0100 |
parents | 55ccc2d353bd |
children | dd725a8ab112 |
line wrap: on
line diff
--- 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, PyObjec 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;