From efa2682e3b513c4a33d987dc651db5913feff21a Mon Sep 17 00:00:00 2001 From: ZyX Date: Fri, 29 Jul 2016 21:41:45 +0300 Subject: *: 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`. --- src/nvim/quickfix.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/nvim/quickfix.c') 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 -- cgit From 095e6cc2e098db110981e5f9ea4bbc0ce316cecb Mon Sep 17 00:00:00 2001 From: ZyX Date: Wed, 15 Feb 2017 03:15:47 +0300 Subject: *: Fix linter errors --- src/nvim/quickfix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/nvim/quickfix.c') diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 3b86662f05..0da98713df 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2078,7 +2078,7 @@ void qf_list(exarg_T *eap) msg_puts_attr((const char *)IObuff, hl_attr(HLF_N)); if (qfp->qf_pattern != NULL) { qf_fmt_text(qfp->qf_pattern, IObuff, IOSIZE); - STRNCAT(IObuff, ":", IOSIZE); + xstrlcat((char *)IObuff, ":", IOSIZE); msg_puts((const char *)IObuff); } msg_puts(" "); -- cgit