diff options
Diffstat (limited to 'src/nvim/search.c')
-rw-r--r-- | src/nvim/search.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/nvim/search.c b/src/nvim/search.c index 525cec8b02..694c4cad52 100644 --- a/src/nvim/search.c +++ b/src/nvim/search.c @@ -1468,7 +1468,7 @@ int search_for_exact_line(buf_T *buf, pos_T *pos, Direction dir, char *pat) // when adding lines the matching line may be empty but it is not // ignored because we are interested in the next line -- Acevedo if (compl_status_adding() && !compl_status_sol()) { - if (mb_strcmp_ic((bool)p_ic, (const char *)p, (const char *)pat) == 0) { + if (mb_strcmp_ic((bool)p_ic, p, pat) == 0) { return OK; } } else if (*p != NUL) { // Ignore empty lines. @@ -2233,10 +2233,10 @@ int check_linecomment(const char *line) const char *p = line; // scan from start // skip Lispish one-line comments if (curbuf->b_p_lisp) { - if (vim_strchr((char *)p, ';') != NULL) { // there may be comments + if (vim_strchr(p, ';') != NULL) { // there may be comments bool in_str = false; // inside of string - while ((p = strpbrk((char *)p, "\";")) != NULL) { + while ((p = strpbrk(p, "\";")) != NULL) { if (*p == '"') { if (in_str) { if (*(p - 1) != '\\') { // skip escaped quote @@ -2258,7 +2258,7 @@ int check_linecomment(const char *line) p = NULL; } } else { - while ((p = vim_strchr((char *)p, '/')) != NULL) { + while ((p = vim_strchr(p, '/')) != NULL) { // Accept a double /, unless it's preceded with * and followed by *, // because * / / * is an end and start of a C comment. Only // accept the position if it is not inside a string. @@ -2777,21 +2777,21 @@ void f_searchcount(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) return; } dict = argvars[0].vval.v_dict; - di = tv_dict_find(dict, (const char *)"timeout", -1); + di = tv_dict_find(dict, "timeout", -1); if (di != NULL) { timeout = (long)tv_get_number_chk(&di->di_tv, &error); if (error) { return; } } - di = tv_dict_find(dict, (const char *)"maxcount", -1); + di = tv_dict_find(dict, "maxcount", -1); if (di != NULL) { maxcount = (int)tv_get_number_chk(&di->di_tv, &error); if (error) { return; } } - di = tv_dict_find(dict, (const char *)"recompute", -1); + di = tv_dict_find(dict, "recompute", -1); if (di != NULL) { recompute = tv_get_number_chk(&di->di_tv, &error); if (error) { @@ -2805,7 +2805,7 @@ void f_searchcount(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) return; } } - di = tv_dict_find(dict, (const char *)"pos", -1); + di = tv_dict_find(dict, "pos", -1); if (di != NULL) { if (di->di_tv.v_type != VAR_LIST) { semsg(_(e_invarg2), "pos"); @@ -3036,8 +3036,8 @@ static int fuzzy_match_recursive(const char *fuzpat, const char *str, uint32_t s // Loop through fuzpat and str looking for a match bool first_match = true; while (*fuzpat != NUL && *str != NUL) { - const int c1 = utf_ptr2char((char *)fuzpat); - const int c2 = utf_ptr2char((char *)str); + const int c1 = utf_ptr2char(fuzpat); + const int c2 = utf_ptr2char(str); // Found match if (mb_tolower(c1) == mb_tolower(c2)) { @@ -3055,7 +3055,7 @@ static int fuzzy_match_recursive(const char *fuzpat, const char *str, uint32_t s // Recursive call that "skips" this match uint32_t recursiveMatches[MAX_FUZZY_MATCHES]; int recursiveScore = 0; - const char *const next_char = (char *)str + utfc_ptr2len((char *)str); + const char *const next_char = str + utfc_ptr2len(str); if (fuzzy_match_recursive(fuzpat, next_char, strIdx + 1, &recursiveScore, strBegin, strLen, matches, recursiveMatches, sizeof(recursiveMatches) / sizeof(recursiveMatches[0]), nextMatch, @@ -3227,7 +3227,7 @@ static void fuzzy_match_in_list(list_T *const l, char *const str, const bool mat // For a dict, either use the specified key to lookup the string or // use the specified callback function to get the string. if (key != NULL) { - itemstr = tv_dict_get_string(tv->vval.v_dict, (const char *)key, false); + itemstr = tv_dict_get_string(tv->vval.v_dict, key, false); } else { typval_T argv[2]; @@ -3257,7 +3257,7 @@ static void fuzzy_match_in_list(list_T *const l, char *const str, const bool mat if (retmatchpos) { items[match_count].lmatchpos = tv_list_alloc(kListLenMayKnow); int j = 0; - const char *p = (char *)str; + const char *p = str; while (*p != NUL) { if (!ascii_iswhite(utf_ptr2char(p)) || matchseq) { tv_list_append_number(items[match_count].lmatchpos, matches[j]); @@ -4015,7 +4015,7 @@ search_line: curwin->w_cursor.lnum = lnum; check_cursor(); } else { - if (!GETFILE_SUCCESS(getfile(0, (char *)files[depth].name, NULL, true, + if (!GETFILE_SUCCESS(getfile(0, files[depth].name, NULL, true, files[depth].lnum, false))) { break; // failed to jump to file } |