aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/search.c
diff options
context:
space:
mode:
authorEliseo Martínez <eliseomarmol@gmail.com>2015-02-12 13:49:02 +0100
committerJustin M. Keyes <justinkz@gmail.com>2015-02-18 20:54:13 -0500
commit7dd48d7af08613255bc95b63f5b6b0f096a98d22 (patch)
treefb85ab05a011eb6bc23b771569e152410d966811 /src/nvim/search.c
parent690e43b461491507094da8eeb48a92cf2f38b282 (diff)
downloadrneovim-7dd48d7af08613255bc95b63f5b6b0f096a98d22.tar.gz
rneovim-7dd48d7af08613255bc95b63f5b6b0f096a98d22.tar.bz2
rneovim-7dd48d7af08613255bc95b63f5b6b0f096a98d22.zip
Enable -Wconversion: mark.c.
Refactoring summary: - MB_STRNICMP: Inlined. - MB_STRNCMP: Inlined.
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r--src/nvim/search.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c
index 055d2db445..095d7484a5 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -9,6 +9,7 @@
* search.c: code for normal mode searching commands
*/
+#include <assert.h>
#include <errno.h>
#include <inttypes.h>
#include <stdbool.h>
@@ -1258,11 +1259,12 @@ int search_for_exact_line(buf_T *buf, pos_T *pos, int dir, char_u *pat)
* ignored because we are interested in the next line -- Acevedo */
if ((compl_cont_status & CONT_ADDING)
&& !(compl_cont_status & CONT_SOL)) {
- if ((p_ic ? MB_STRICMP(p, pat) : STRCMP(p, pat)) == 0)
+ if ((p_ic ? mb_stricmp(p, pat) : STRCMP(p, pat)) == 0)
return OK;
} else if (*p != NUL) { /* ignore empty lines */
/* expanding lines or words */
- if ((p_ic ? MB_STRNICMP(p, pat, compl_length)
+ assert(compl_length >= 0);
+ if ((p_ic ? mb_strnicmp(p, pat, (size_t)compl_length)
: STRNCMP(p, pat, compl_length)) == 0)
return OK;
}
@@ -4234,8 +4236,10 @@ search_line:
) {
/* compare the first "len" chars from "ptr" */
startp = skipwhite(p);
- if (p_ic)
- matched = !MB_STRNICMP(startp, ptr, len);
+ if (p_ic) {
+ assert(len >= 0);
+ matched = !mb_strnicmp(startp, ptr, (size_t)len);
+ }
else
matched = !STRNCMP(startp, ptr, len);
if (matched && define_matched && whole