mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Use portable format specifiers: Case %ld - plain - EMSGN.
Fix uses of plain "%ld" within EMSGN(): - Replace "%ld" with "%" PRId64. - No argument cast needed. EMSGN() will take care of that.
This commit is contained in:
parent
5b0aa1cb57
commit
bf3b9d0ecb
@ -11660,7 +11660,7 @@ static void f_matchadd(typval_T *argvars, typval_T *rettv)
|
||||
if (error == TRUE)
|
||||
return;
|
||||
if (id >= 1 && id <= 3) {
|
||||
EMSGN("E798: ID is reserved for \":match\": %ld", id);
|
||||
EMSGN("E798: ID is reserved for \":match\": %" PRId64, id);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1156,7 +1156,7 @@ static int nfa_regatom(void)
|
||||
rc_did_emsg = TRUE;
|
||||
return FAIL;
|
||||
}
|
||||
EMSGN("INTERNAL: Unknown character class char: %ld", c);
|
||||
EMSGN("INTERNAL: Unknown character class char: %" PRId64, c);
|
||||
return FAIL;
|
||||
}
|
||||
/* When '.' is followed by a composing char ignore the dot, so that
|
||||
@ -5823,7 +5823,7 @@ static int nfa_regmatch(nfa_regprog_T *prog, nfa_state_T *start, regsubs_T *subm
|
||||
|
||||
#ifdef REGEXP_DEBUG
|
||||
if (c < 0)
|
||||
EMSGN("INTERNAL: Negative state char: %ld", c);
|
||||
EMSGN("INTERNAL: Negative state char: %" PRId64, c);
|
||||
#endif
|
||||
result = (c == curc);
|
||||
|
||||
@ -6272,7 +6272,8 @@ static regprog_T *nfa_regcomp(char_u *expr, int re_flags)
|
||||
if (postfix == NULL) {
|
||||
/* TODO: only give this error for debugging? */
|
||||
if (post_ptr >= post_end)
|
||||
EMSGN("Internal error: estimated max number of states insufficient: %ld",
|
||||
EMSGN("Internal error: estimated max number "
|
||||
"of states insufficient: %" PRId64,
|
||||
post_end - post_start);
|
||||
goto fail; /* Cascaded (syntax?) error */
|
||||
}
|
||||
|
@ -1291,8 +1291,8 @@ void u_write_undo(char_u *name, int forceit, buf_T *buf, char_u *hash)
|
||||
write_ok = TRUE;
|
||||
#ifdef U_DEBUG
|
||||
if (headers_written != buf->b_u_numhead) {
|
||||
EMSGN("Written %ld headers, ...", headers_written);
|
||||
EMSGN("... but numhead is %ld", buf->b_u_numhead);
|
||||
EMSGN("Written %" PRId64 " headers, ...", headers_written);
|
||||
EMSGN("... but numhead is %" PRId64, buf->b_u_numhead);
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -1593,7 +1593,7 @@ void u_read_undo(char_u *name, char_u *hash, char_u *orig_name)
|
||||
#ifdef U_DEBUG
|
||||
for (i = 0; i < num_head; ++i)
|
||||
if (uhp_table_used[i] == 0)
|
||||
EMSGN("uhp_table entry %ld not used, leaking memory", i);
|
||||
EMSGN("uhp_table entry %" PRId64 " not used, leaking memory", i);
|
||||
vim_free(uhp_table_used);
|
||||
u_check(TRUE);
|
||||
#endif
|
||||
|
11
src/window.c
11
src/window.c
@ -5263,14 +5263,16 @@ int match_add(win_T *wp, char_u *grp, char_u *pat, int prio, int id)
|
||||
if (*grp == NUL || *pat == NUL)
|
||||
return -1;
|
||||
if (id < -1 || id == 0) {
|
||||
EMSGN("E799: Invalid ID: %ld (must be greater than or equal to 1)", id);
|
||||
EMSGN("E799: Invalid ID: %" PRId64
|
||||
" (must be greater than or equal to 1)",
|
||||
id);
|
||||
return -1;
|
||||
}
|
||||
if (id != -1) {
|
||||
cur = wp->w_match_head;
|
||||
while (cur != NULL) {
|
||||
if (cur->id == id) {
|
||||
EMSGN("E801: ID already taken: %ld", id);
|
||||
EMSGN("E801: ID already taken: %" PRId64, id);
|
||||
return -1;
|
||||
}
|
||||
cur = cur->next;
|
||||
@ -5334,7 +5336,8 @@ int match_delete(win_T *wp, int id, int perr)
|
||||
|
||||
if (id < 1) {
|
||||
if (perr == TRUE)
|
||||
EMSGN("E802: Invalid ID: %ld (must be greater than or equal to 1)",
|
||||
EMSGN("E802: Invalid ID: %" PRId64
|
||||
" (must be greater than or equal to 1)",
|
||||
id);
|
||||
return -1;
|
||||
}
|
||||
@ -5344,7 +5347,7 @@ int match_delete(win_T *wp, int id, int perr)
|
||||
}
|
||||
if (cur == NULL) {
|
||||
if (perr == TRUE)
|
||||
EMSGN("E803: ID not found: %ld", id);
|
||||
EMSGN("E803: ID not found: %" PRId64, id);
|
||||
return -1;
|
||||
}
|
||||
if (cur == prev)
|
||||
|
Loading…
Reference in New Issue
Block a user