diff options
-rw-r--r-- | src/nvim/ex_cmds.c | 1 | ||||
-rw-r--r-- | src/nvim/memory.c | 1 | ||||
-rw-r--r-- | src/nvim/message.c | 39 | ||||
-rw-r--r-- | src/nvim/misc2.c | 36 | ||||
-rw-r--r-- | src/nvim/option.c | 1 | ||||
-rw-r--r-- | src/nvim/undo.c | 1 |
6 files changed, 33 insertions, 46 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index c4b6b701d9..12a634416b 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -42,7 +42,6 @@ #include "nvim/memline.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/garray.h" #include "nvim/memory.h" #include "nvim/move.h" diff --git a/src/nvim/memory.c b/src/nvim/memory.c index cb9ad97749..2223b65a93 100644 --- a/src/nvim/memory.c +++ b/src/nvim/memory.c @@ -7,7 +7,6 @@ #include <stdbool.h> #include "nvim/vim.h" -#include "nvim/misc2.h" #include "nvim/eval.h" #include "nvim/memfile.h" #include "nvim/memory.h" diff --git a/src/nvim/message.c b/src/nvim/message.c index 91c7d05ff4..b2e9488388 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -325,7 +325,6 @@ void trunc_string(char_u *s, char_u *buf, int room, int buflen) } /* - * Automatic prototype generation does not understand this function. * Note: Caller of smgs() and smsg_attr() must check the resulting string is * shorter than IOSIZE!!! */ @@ -581,13 +580,44 @@ int emsg2(char_u *s, char_u *a1) return emsg3(s, a1, NULL); } -/* emsg3() and emsgn() are in misc2.c to avoid warnings for the prototypes. */ - void emsg_invreg(int name) { EMSG2(_("E354: Invalid register name: '%s'"), transchar(name)); } +/// Print an error message with one or two "%s" and one or two string arguments. +int emsg3(char_u *s, char_u *a1, char_u *a2) +{ + if (emsg_not_now()) { + return TRUE; // no error messages at the moment + } + + vim_snprintf((char *)IObuff, IOSIZE, (char *)s, a1, a2); + return emsg(IObuff); +} + +/// Print an error message with one "%" PRId64 and one (int64_t) argument. +int emsgn(char_u *s, int64_t n) +{ + if (emsg_not_now()) { + return TRUE; // no error messages at the moment + } + + vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n); + return emsg(IObuff); +} + +/// Print an error message with one "%" PRIu64 and one (uint64_t) argument. +int emsgu(char_u *s, uint64_t n) +{ + if (emsg_not_now()) { + return TRUE; // no error messages at the moment + } + + vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n); + return emsg(IObuff); +} + /* * Like msg(), but truncate to a single line if p_shm contains 't', or when * "force" is TRUE. This truncates in another way as for normal messages. @@ -3051,9 +3081,6 @@ static double tv_float(typval_T *tvs, int *idxp) * "typval_T". When the latter is not used it must be NULL. */ -/* When generating prototypes all of this is skipped, cproto doesn't - * understand this. */ - /* Like vim_vsnprintf() but append to the string. */ int vim_snprintf_add(char *str, size_t str_m, char *fmt, ...) { diff --git a/src/nvim/misc2.c b/src/nvim/misc2.c index 06196b32af..fafce66c5f 100644 --- a/src/nvim/misc2.c +++ b/src/nvim/misc2.c @@ -389,42 +389,6 @@ int vim_chdir(char_u *new_dir) return r; } - -/* - * Print an error message with one or two "%s" and one or two string arguments. - * This is not in message.c to avoid a warning for prototypes. - */ -int emsg3(char_u *s, char_u *a1, char_u *a2) -{ - if (emsg_not_now()) - return TRUE; /* no error messages at the moment */ - vim_snprintf((char *)IObuff, IOSIZE, (char *)s, a1, a2); - return emsg(IObuff); -} - -/* - * Print an error message with one "%" PRId64 and one (int64_t) argument. - * This is not in message.c to avoid a warning for prototypes. - */ -int emsgn(char_u *s, int64_t n) -{ - if (emsg_not_now()) - return TRUE; /* no error messages at the moment */ - vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n); - return emsg(IObuff); -} - -/* - * Print an error message with one "%" PRIu64 and one (uint64_t) argument. - */ -int emsgu(char_u *s, uint64_t n) -{ - if (emsg_not_now()) - return TRUE; /* no error messages at the moment */ - vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n); - return emsg(IObuff); -} - /* * Read 2 bytes from "fd" and turn them into an int, MSB first. */ diff --git a/src/nvim/option.c b/src/nvim/option.c index 2998f89edb..98584d1567 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -64,7 +64,6 @@ #include "nvim/memory.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/keymap.h" #include "nvim/garray.h" #include "nvim/cursor_shape.h" diff --git a/src/nvim/undo.c b/src/nvim/undo.c index 2c287e0fdf..06dc325fea 100644 --- a/src/nvim/undo.c +++ b/src/nvim/undo.c @@ -99,7 +99,6 @@ #include "nvim/memline.h" #include "nvim/message.h" #include "nvim/misc1.h" -#include "nvim/misc2.h" #include "nvim/memory.h" #include "nvim/garray.h" #include "nvim/option.h" |