diff options
author | ZyX <kp-pav@yandex.ru> | 2016-07-29 21:41:45 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2017-02-15 02:48:33 +0300 |
commit | efa2682e3b513c4a33d987dc651db5913feff21a (patch) | |
tree | 46736cfd53da15a607a332afc79f8359f50bd455 /src/nvim/ex_getln.c | |
parent | 2a50ff7e2fa724fc748068ba19012239886b74dd (diff) | |
download | rneovim-efa2682e3b513c4a33d987dc651db5913feff21a.tar.gz rneovim-efa2682e3b513c4a33d987dc651db5913feff21a.tar.bz2 rneovim-efa2682e3b513c4a33d987dc651db5913feff21a.zip |
*: Partial string handling refactoring
Main points:
- Replace `char_u` with `char` in some cases.
- Remove `str[len] = NUL` hack in some cases when `str` may be considered
`const`.
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r-- | src/nvim/ex_getln.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 2555b64dfd..9eea721463 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -1879,7 +1879,7 @@ getexmodeline ( vcol = indent; while (indent >= 8) { ga_append(&line_ga, TAB); - msg_puts((char_u *)" "); + msg_puts(" "); indent -= 8; } while (indent-- > 0) { @@ -2608,7 +2608,7 @@ static void redrawcmdprompt(void) if (ccline.cmdfirstc != NUL) msg_putchar(ccline.cmdfirstc); if (ccline.cmdprompt != NULL) { - msg_puts_attr(ccline.cmdprompt, ccline.cmdattr); + msg_puts_attr((const char *)ccline.cmdprompt, ccline.cmdattr); ccline.cmdindent = msg_col + (msg_row - cmdline_row) * Columns; /* do the reverse of set_cmdspos() */ if (ccline.cmdfirstc != NUL) @@ -3317,7 +3317,7 @@ static int showmatches(expand_T *xp, int wildmenu) msg_outtrans_attr(files_found[k], hl_attr(HLF_D)); p = files_found[k] + STRLEN(files_found[k]) + 1; msg_advance(maxlen + 1); - msg_puts(p); + msg_puts((const char *)p); msg_advance(maxlen + 3); msg_puts_long_attr(p + 2, hl_attr(HLF_D)); break; @@ -3759,6 +3759,8 @@ static void cleanup_help_tags(int num_file, char_u **file) } } +typedef char_u *(*ExpandFunc)(expand_T *, int); + /* * Do the expansion based on xp->xp_context and "pat". */ @@ -3898,7 +3900,7 @@ ExpandFromContext ( else { static struct expgen { int context; - char_u *((*func)(expand_T *, int)); + ExpandFunc func; int ic; int escaped; } tab[] = @@ -3919,7 +3921,7 @@ ExpandFromContext ( {EXPAND_MENUNAMES, get_menu_names, FALSE, TRUE}, {EXPAND_SYNTAX, get_syntax_name, TRUE, TRUE}, {EXPAND_SYNTIME, get_syntime_arg, TRUE, TRUE}, - {EXPAND_HIGHLIGHT, get_highlight_name, TRUE, TRUE}, + {EXPAND_HIGHLIGHT, (ExpandFunc)get_highlight_name, TRUE, TRUE}, {EXPAND_EVENTS, get_event_name, TRUE, TRUE}, {EXPAND_AUGROUP, get_augroup_name, TRUE, TRUE}, {EXPAND_CSCOPE, get_cscope_name, TRUE, TRUE}, |