mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 03:05:11 -07:00
Merge pull request #19939 from zeertzjq/vim-8.2.4289
vim-patch: compiler warnings
This commit is contained in:
commit
170617c7a2
@ -320,22 +320,22 @@ int arabic_shape(int c, int *ccp, int *c1p, int prev_c, int prev_c1, int next_c)
|
||||
int backward_combine = !prev_laa && can_join(prev_c, c);
|
||||
int forward_combine = can_join(c, next_c);
|
||||
|
||||
if (backward_combine && forward_combine) {
|
||||
curr_c = (int)curr_a->medial;
|
||||
}
|
||||
if (backward_combine && !forward_combine) {
|
||||
curr_c = (int)curr_a->final;
|
||||
}
|
||||
if (!backward_combine && forward_combine) {
|
||||
curr_c = (int)curr_a->initial;
|
||||
}
|
||||
if (!backward_combine && !forward_combine) {
|
||||
curr_c = (int)curr_a->isolated;
|
||||
if (backward_combine) {
|
||||
if (forward_combine) {
|
||||
curr_c = (int)curr_a->medial;
|
||||
} else {
|
||||
curr_c = (int)curr_a->final;
|
||||
}
|
||||
} else {
|
||||
if (forward_combine) {
|
||||
curr_c = (int)curr_a->initial;
|
||||
} else {
|
||||
curr_c = (int)curr_a->isolated;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Sanity check -- curr_c should, in the future, never be 0.
|
||||
// We should, in the future, insert a fatal error here.
|
||||
// Character missing from the table means using original character.
|
||||
if (curr_c == NUL) {
|
||||
curr_c = c;
|
||||
}
|
||||
|
@ -1939,13 +1939,12 @@ static int ExpandFromContext(expand_T *xp, char_u *pat, int *num_file, char ***f
|
||||
|| xp->xp_context == EXPAND_FILES_IN_PATH) {
|
||||
// Expand file or directory names.
|
||||
bool free_pat = false;
|
||||
int i;
|
||||
|
||||
// for ":set path=" and ":set tags=" halve backslashes for escaped space
|
||||
if (xp->xp_backslash != XP_BS_NONE) {
|
||||
free_pat = true;
|
||||
pat = vim_strsave(pat);
|
||||
for (i = 0; pat[i]; i++) {
|
||||
for (int i = 0; pat[i]; i++) {
|
||||
if (pat[i] == '\\') {
|
||||
if (xp->xp_backslash == XP_BS_THREE
|
||||
&& pat[i + 1] == '\\'
|
||||
@ -1979,8 +1978,8 @@ static int ExpandFromContext(expand_T *xp, char_u *pat, int *num_file, char ***f
|
||||
}
|
||||
#ifdef BACKSLASH_IN_FILENAME
|
||||
if (p_csl[0] != NUL && (options & WILD_IGNORE_COMPLETESLASH) == 0) {
|
||||
for (int i = 0; i < *num_file; i++) {
|
||||
char_u *ptr = (*file)[i];
|
||||
for (int j = 0; j < *num_file; j++) {
|
||||
char_u *ptr = (*file)[j];
|
||||
while (*ptr != NUL) {
|
||||
if (p_csl[0] == 's' && *ptr == '\\') {
|
||||
*ptr = '/';
|
||||
|
@ -5714,7 +5714,7 @@ static void f_rand(typval_T *argvars, typval_T *rettv, EvalFuncData fptr)
|
||||
// When no argument is given use the global seed list.
|
||||
if (!initialized) {
|
||||
// Initialize the global seed list.
|
||||
uint32_t x;
|
||||
uint32_t x = 0;
|
||||
init_srand(&x);
|
||||
|
||||
gx = splitmix32(&x);
|
||||
|
@ -5140,6 +5140,7 @@ static bool vgr_match_buflines(qf_list_T *qfl, char *fname, buf_T *buf, char *sp
|
||||
FUNC_ATTR_NONNULL_ARG(1, 3, 4, 5, 6)
|
||||
{
|
||||
bool found_match = false;
|
||||
const size_t pat_len = STRLEN(spat);
|
||||
|
||||
for (linenr_T lnum = 1; lnum <= buf->b_ml.ml_line_count && *tomatch > 0; lnum++) {
|
||||
colnr_T col = 0;
|
||||
@ -5181,7 +5182,6 @@ static bool vgr_match_buflines(qf_list_T *qfl, char *fname, buf_T *buf, char *sp
|
||||
}
|
||||
}
|
||||
} else {
|
||||
const size_t pat_len = STRLEN(spat);
|
||||
char *const str = (char *)ml_get_buf(buf, lnum, false);
|
||||
int score;
|
||||
uint32_t matches[MAX_FUZZY_MATCHES];
|
||||
|
@ -4868,7 +4868,7 @@ static int fuzzy_match_compute_score(const char_u *const str, const int strSz,
|
||||
if (currIdx > 0) {
|
||||
// Camel case
|
||||
const char_u *p = str;
|
||||
int neighbor;
|
||||
int neighbor = ' ';
|
||||
|
||||
for (uint32_t sidx = 0; sidx < currIdx; sidx++) {
|
||||
neighbor = utf_ptr2char((char *)p);
|
||||
|
Loading…
Reference in New Issue
Block a user