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/quickfix.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/quickfix.c')
-rw-r--r-- | src/nvim/quickfix.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index c40403e3f6..3b86662f05 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2068,21 +2068,20 @@ void qf_list(exarg_T *eap) if (qfp->qf_lnum == 0) { IObuff[0] = NUL; } else if (qfp->qf_col == 0) { - vim_snprintf((char *)IObuff, IOSIZE, ":%" PRId64, - (int64_t)qfp->qf_lnum); + vim_snprintf((char *)IObuff, IOSIZE, ":%" PRIdLINENR, qfp->qf_lnum); } else { - vim_snprintf((char *)IObuff, IOSIZE, ":%" PRId64 " col %d", - (int64_t)qfp->qf_lnum, qfp->qf_col); + vim_snprintf((char *)IObuff, IOSIZE, ":%" PRIdLINENR " col %d", + qfp->qf_lnum, qfp->qf_col); } vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE, "%s:", (char *)qf_types(qfp->qf_type, qfp->qf_nr)); - msg_puts_attr(IObuff, hl_attr(HLF_N)); + msg_puts_attr((const char *)IObuff, hl_attr(HLF_N)); if (qfp->qf_pattern != NULL) { qf_fmt_text(qfp->qf_pattern, IObuff, IOSIZE); - STRCAT(IObuff, ":"); - msg_puts(IObuff); + STRNCAT(IObuff, ":", IOSIZE); + msg_puts((const char *)IObuff); } - msg_puts((char_u *)" "); + msg_puts(" "); /* Remove newlines and leading whitespace from the text. For an * unrecognized line keep the indent, the compiler may mark a word |