diff src/if_tcl.c @ 15470:55ccc2d353bd v8.1.0743

patch 8.1.0743: giving error messages is not flexible commit https://github.com/vim/vim/commit/f9e3e09fdc93be9f0d47afbc6c7df1188c2a5a0d Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jan 13 23:38:42 2019 +0100 patch 8.1.0743: giving error messages is not flexible Problem: Giving error messages is not flexible. Solution: Add semsg(). Change argument from "char_u *" to "char *", also for msg() and get rid of most MSG macros. (Ozaki Kiichi, closes #3302) Also make emsg() accept a "char *" argument. Get rid of an enormous number of type casts.
author Bram Moolenaar <Bram@vim.org>
date Sun, 13 Jan 2019 23:45:08 +0100
parents 6e4e0d43b20b
children dd725a8ab112
line wrap: on
line diff
--- a/src/if_tcl.c
+++ b/src/if_tcl.c
@@ -213,7 +213,7 @@ tcl_runtime_link_init(char *libname, int
     if (!(hTclLib = load_dll(libname)))
     {
 	if (verbose)
-	    EMSG2(_(e_loadlib), libname);
+	    semsg(_(e_loadlib), libname);
 	return FAIL;
     }
     for (i = 0; tcl_funcname_table[i].ptr; ++i)
@@ -224,7 +224,7 @@ tcl_runtime_link_init(char *libname, int
 	    close_dll(hTclLib);
 	    hTclLib = NULL;
 	    if (verbose)
-		EMSG2(_(e_loadfunc), tcl_funcname_table[i].name);
+		semsg(_(e_loadfunc), tcl_funcname_table[i].name);
 	    return FAIL;
 	}
     }
@@ -1539,7 +1539,7 @@ tclsetdelcmd(
 	reflist = reflist->next;
     }
     /* This should never happen.  Famous last word? */
-    EMSG(_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"));
+    emsg(_("E280: TCL FATAL ERROR: reflist corrupt!? Please report this to vim-dev@vim.org"));
     Tcl_SetResult(interp, _("cannot register callback command: buffer/window reference not found"), TCL_STATIC);
     return TCL_ERROR;
 }
@@ -1709,7 +1709,7 @@ tclinit(exarg_T *eap)
 #ifdef DYNAMIC_TCL
     if (!tcl_enabled(TRUE))
     {
-	EMSG(_("E571: Sorry, this command is disabled: the Tcl library could not be loaded."));
+	emsg(_("E571: Sorry, this command is disabled: the Tcl library could not be loaded."));
 	return FAIL;
     }
 #endif
@@ -1817,11 +1817,11 @@ tclerrmsg(char *text)
     while ((next=strchr(text, '\n')))
     {
 	*next++ = '\0';
-	EMSG(text);
+	emsg(text);
 	text = next;
     }
     if (*text)
-	EMSG(text);
+	emsg(text);
 }
 
     static void