To: vim_dev@googlegroups.com Subject: Patch 8.1.0744 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.1.0744 (after 8.1.0743) Problem: Compiler warnings for signed/unsigned strings. Solution: A few more type cast fixes. Files: src/option.c, src/if_perl.xs, src/if_py_both.h, src/integration.c *** ../vim-8.1.0743/src/option.c 2019-01-13 23:38:33.403773217 +0100 --- src/option.c 2019-01-13 23:43:01.405729009 +0100 *************** *** 6965,6973 **** else if (varp == &p_guifontset) { if (STRCMP(p_guifontset, "*") == 0) ! errmsg = (char_u *)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"); redraw_gui_only = TRUE; } # endif --- 6965,6973 ---- else if (varp == &p_guifontset) { if (STRCMP(p_guifontset, "*") == 0) ! errmsg = N_("E597: can't select fontset"); else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK) ! errmsg = N_("E598: Invalid fontset"); redraw_gui_only = TRUE; } # endif *************** *** 7687,7693 **** p = (char_u *)MOUSE_ALL; #else if (*p_mouse != NUL) ! errmsg = (char_u *)N_("E538: No mouse support"); #endif } #if defined(FEAT_GUI) --- 7687,7693 ---- p = (char_u *)MOUSE_ALL; #else if (*p_mouse != NUL) ! errmsg = N_("E538: No mouse support"); #endif } #if defined(FEAT_GUI) *** ../vim-8.1.0743/src/if_perl.xs 2019-01-13 23:38:33.395773275 +0100 --- src/if_perl.xs 2019-01-13 23:44:00.353278430 +0100 *************** *** 1562,1572 **** SV* Blob(SV* sv) PREINIT: ! STRLEN len; ! char *s; ! int i; ! char buf[3]; ! SV* newsv; CODE: s = SvPVbyte(sv, len); --- 1562,1572 ---- SV* Blob(SV* sv) PREINIT: ! STRLEN len; ! char *s; ! unsigned i; ! char buf[3]; ! SV* newsv; CODE: s = SvPVbyte(sv, len); *** ../vim-8.1.0743/src/if_py_both.h 2019-01-13 23:38:33.395773275 +0100 --- src/if_py_both.h 2019-01-13 23:46:14.648261783 +0100 *************** *** 410,415 **** --- 410,421 ---- } 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,427 **** Py_BEGIN_ALLOW_THREADS Python_Lock_Vim(); ! writer((writefn)(error ? emsg : msg), (char_u *)str, len); Python_Release_Vim(); Py_END_ALLOW_THREADS PyMem_Free(str); --- 427,433 ---- Py_BEGIN_ALLOW_THREADS Python_Lock_Vim(); ! writer((writefn)(error ? emsg : msg_wrapper), (char_u *)str, len); Python_Release_Vim(); Py_END_ALLOW_THREADS PyMem_Free(str); *************** *** 634,640 **** else if (msg_list != NULL && *msg_list != NULL) { int should_free; ! char_u *msg; msg = get_exception_string(*msg_list, ET_ERROR, NULL, &should_free); --- 640,646 ---- else if (msg_list != NULL && *msg_list != NULL) { int should_free; ! char *msg; msg = get_exception_string(*msg_list, ET_ERROR, NULL, &should_free); *************** *** 644,650 **** return -1; } ! PyErr_SetVim((char *) msg); free_global_msglist(); --- 650,656 ---- return -1; } ! PyErr_SetVim(msg); free_global_msglist(); *************** *** 3483,3495 **** static int set_option_value_err(char_u *key, int numval, char_u *stringval, int opt_flags) { ! char_u *errmsg; if ((errmsg = set_option_value(key, numval, stringval, opt_flags))) { if (VimTryEnd()) return FAIL; ! PyErr_SetVim((char *)errmsg); return FAIL; } return OK; --- 3489,3501 ---- static int set_option_value_err(char_u *key, int numval, char_u *stringval, int opt_flags) { ! char *errmsg; if ((errmsg = set_option_value(key, numval, stringval, opt_flags))) { if (VimTryEnd()) return FAIL; ! PyErr_SetVim(errmsg); return FAIL; } return OK; *** ../vim-8.1.0743/src/integration.c 2018-09-30 21:43:17.195693290 +0200 --- src/integration.c 2019-01-13 23:47:24.371738521 +0100 *************** *** 303,309 **** char buffer[2*MAXPATHLEN]; vim_snprintf(buffer, sizeof(buffer), NOCATGETS("currentFile %d %s"), ! f ? strlen(f) : 0, f ? f : ""); workshop_send_message(buffer); } else if (strcmp(cmd, NOCATGETS("getCursorRow")) == 0) { int row = workshop_test_getcursorrow(); --- 303,309 ---- char buffer[2*MAXPATHLEN]; vim_snprintf(buffer, sizeof(buffer), NOCATGETS("currentFile %d %s"), ! f ? (int)strlen(f) : 0, f ? f : ""); workshop_send_message(buffer); } else if (strcmp(cmd, NOCATGETS("getCursorRow")) == 0) { int row = workshop_test_getcursorrow(); *************** *** 322,335 **** char buffer[2*MAXPATHLEN]; vim_snprintf(buffer, sizeof(buffer), NOCATGETS("cursorRowText %d %s"), ! t ? 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 : ""); workshop_send_message(buffer); #endif } --- 322,335 ---- char buffer[2*MAXPATHLEN]; vim_snprintf(buffer, sizeof(buffer), NOCATGETS("cursorRowText %d %s"), ! 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 ? (int)strlen(t) : 0, t ? t : ""); workshop_send_message(buffer); #endif } *** ../vim-8.1.0743/src/version.c 2019-01-13 23:50:42.810262435 +0100 --- src/version.c 2019-01-13 23:49:19.134882757 +0100 *************** *** 797,798 **** --- 797,800 ---- { /* Add new patch number below this line */ + /**/ + 744, /**/ -- Press any key to continue, press any other key to quit. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///