mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
Use portable format specifiers: Case %ld - localized - smsg.
Fix uses of localized "%ld" within smsg(): - Replace "%ld" with "%" PRId64. - Cast corresponding argument to (int64_t).
This commit is contained in:

committed by
Thiago de Arruda

parent
182b84e1c3
commit
c049cb2b51
@@ -18819,8 +18819,8 @@ call_user_func (
|
|||||||
if (aborting())
|
if (aborting())
|
||||||
smsg((char_u *)_("%s aborted"), sourcing_name);
|
smsg((char_u *)_("%s aborted"), sourcing_name);
|
||||||
else if (fc->rettv->v_type == VAR_NUMBER)
|
else if (fc->rettv->v_type == VAR_NUMBER)
|
||||||
smsg((char_u *)_("%s returning #%ld"), sourcing_name,
|
smsg((char_u *)_("%s returning #%" PRId64 ""),
|
||||||
(long)fc->rettv->vval.v_number);
|
sourcing_name, (int64_t)fc->rettv->vval.v_number);
|
||||||
else {
|
else {
|
||||||
char_u buf[MSG_BUF_LEN];
|
char_u buf[MSG_BUF_LEN];
|
||||||
char_u numbuf2[NUMBUFLEN];
|
char_u numbuf2[NUMBUFLEN];
|
||||||
|
@@ -756,7 +756,7 @@ int do_move(linenr_T line1, linenr_T line2, linenr_T dest)
|
|||||||
if (num_lines == 1)
|
if (num_lines == 1)
|
||||||
MSG(_("1 line moved"));
|
MSG(_("1 line moved"));
|
||||||
else
|
else
|
||||||
smsg((char_u *)_("%ld lines moved"), num_lines);
|
smsg((char_u *)_("%" PRId64 " lines moved"), (int64_t)num_lines);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -141,7 +141,7 @@ void do_debug(char_u *cmd)
|
|||||||
if (sourcing_name != NULL)
|
if (sourcing_name != NULL)
|
||||||
msg(sourcing_name);
|
msg(sourcing_name);
|
||||||
if (sourcing_lnum != 0)
|
if (sourcing_lnum != 0)
|
||||||
smsg((char_u *)_("line %ld: %s"), (long)sourcing_lnum, cmd);
|
smsg((char_u *)_("line %" PRId64 ": %s"), (int64_t)sourcing_lnum, cmd);
|
||||||
else
|
else
|
||||||
smsg((char_u *)_("cmd: %s"), cmd);
|
smsg((char_u *)_("cmd: %s"), cmd);
|
||||||
|
|
||||||
@@ -320,10 +320,10 @@ void dbg_check_breakpoint(exarg_T *eap)
|
|||||||
p = (char_u *)"<SNR>";
|
p = (char_u *)"<SNR>";
|
||||||
else
|
else
|
||||||
p = (char_u *)"";
|
p = (char_u *)"";
|
||||||
smsg((char_u *)_("Breakpoint in \"%s%s\" line %ld"),
|
smsg((char_u *)_("Breakpoint in \"%s%s\" line %" PRId64),
|
||||||
p,
|
p,
|
||||||
debug_breakpoint_name + (*p == NUL ? 0 : 3),
|
debug_breakpoint_name + (*p == NUL ? 0 : 3),
|
||||||
(long)debug_breakpoint_lnum);
|
(int64_t)debug_breakpoint_lnum);
|
||||||
debug_breakpoint_name = NULL;
|
debug_breakpoint_name = NULL;
|
||||||
do_debug(eap->cmd);
|
do_debug(eap->cmd);
|
||||||
} else {
|
} else {
|
||||||
@@ -615,11 +615,11 @@ void ex_breaklist(exarg_T *eap)
|
|||||||
bp = &BREAKP(i);
|
bp = &BREAKP(i);
|
||||||
if (bp->dbg_type == DBG_FILE)
|
if (bp->dbg_type == DBG_FILE)
|
||||||
home_replace(NULL, bp->dbg_name, NameBuff, MAXPATHL, TRUE);
|
home_replace(NULL, bp->dbg_name, NameBuff, MAXPATHL, TRUE);
|
||||||
smsg((char_u *)_("%3d %s %s line %ld"),
|
smsg((char_u *)_("%3d %s %s line %" PRId64),
|
||||||
bp->dbg_nr,
|
bp->dbg_nr,
|
||||||
bp->dbg_type == DBG_FUNC ? "func" : "file",
|
bp->dbg_type == DBG_FUNC ? "func" : "file",
|
||||||
bp->dbg_type == DBG_FUNC ? bp->dbg_name : NameBuff,
|
bp->dbg_type == DBG_FUNC ? bp->dbg_name : NameBuff,
|
||||||
(long)bp->dbg_lnum);
|
(int64_t)bp->dbg_lnum);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2532,8 +2532,8 @@ do_source (
|
|||||||
if (sourcing_name == NULL)
|
if (sourcing_name == NULL)
|
||||||
smsg((char_u *)_("could not source \"%s\""), fname);
|
smsg((char_u *)_("could not source \"%s\""), fname);
|
||||||
else
|
else
|
||||||
smsg((char_u *)_("line %ld: could not source \"%s\""),
|
smsg((char_u *)_("line %" PRId64 ": could not source \"%s\""),
|
||||||
sourcing_lnum, fname);
|
(int64_t)sourcing_lnum, fname);
|
||||||
verbose_leave();
|
verbose_leave();
|
||||||
}
|
}
|
||||||
goto theend;
|
goto theend;
|
||||||
@@ -2549,8 +2549,8 @@ do_source (
|
|||||||
if (sourcing_name == NULL)
|
if (sourcing_name == NULL)
|
||||||
smsg((char_u *)_("sourcing \"%s\""), fname);
|
smsg((char_u *)_("sourcing \"%s\""), fname);
|
||||||
else
|
else
|
||||||
smsg((char_u *)_("line %ld: sourcing \"%s\""),
|
smsg((char_u *)_("line %" PRId64 ": sourcing \"%s\""),
|
||||||
sourcing_lnum, fname);
|
(int64_t)sourcing_lnum, fname);
|
||||||
verbose_leave();
|
verbose_leave();
|
||||||
}
|
}
|
||||||
if (is_vimrc == DOSO_VIMRC)
|
if (is_vimrc == DOSO_VIMRC)
|
||||||
|
@@ -763,8 +763,8 @@ int flags;
|
|||||||
++no_wait_return;
|
++no_wait_return;
|
||||||
verbose_enter_scroll();
|
verbose_enter_scroll();
|
||||||
|
|
||||||
smsg((char_u *)_("line %ld: %s"),
|
smsg((char_u *)_("line %" PRId64 ": %s"),
|
||||||
(long)sourcing_lnum, cmdline_copy);
|
(int64_t)sourcing_lnum, cmdline_copy);
|
||||||
if (msg_silent == 0)
|
if (msg_silent == 0)
|
||||||
msg_puts((char_u *)"\n"); /* don't overwrite this */
|
msg_puts((char_u *)"\n"); /* don't overwrite this */
|
||||||
|
|
||||||
|
11
src/ops.c
11
src/ops.c
@@ -594,7 +594,7 @@ int (*how)(void);
|
|||||||
if (i > 1
|
if (i > 1
|
||||||
&& (i % 50 == 0 || i == oap->line_count - 1)
|
&& (i % 50 == 0 || i == oap->line_count - 1)
|
||||||
&& oap->line_count > p_report)
|
&& oap->line_count > p_report)
|
||||||
smsg((char_u *)_("%ld lines to indent... "), i);
|
smsg((char_u *)_("%" PRId64 " lines to indent... "), (int64_t)i);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Be vi-compatible: For lisp indenting the first line is not
|
* Be vi-compatible: For lisp indenting the first line is not
|
||||||
@@ -638,7 +638,7 @@ int (*how)(void);
|
|||||||
if (i == 1)
|
if (i == 1)
|
||||||
MSG(_("1 line indented "));
|
MSG(_("1 line indented "));
|
||||||
else
|
else
|
||||||
smsg((char_u *)_("%ld lines indented "), i);
|
smsg((char_u *)_("%" PRId64 " lines indented "), (int64_t)i);
|
||||||
}
|
}
|
||||||
/* set '[ and '] marks */
|
/* set '[ and '] marks */
|
||||||
curbuf->b_op_start = oap->start;
|
curbuf->b_op_start = oap->start;
|
||||||
@@ -1953,7 +1953,7 @@ void op_tilde(oparg_T *oap)
|
|||||||
if (oap->line_count == 1)
|
if (oap->line_count == 1)
|
||||||
MSG(_("1 line changed"));
|
MSG(_("1 line changed"));
|
||||||
else
|
else
|
||||||
smsg((char_u *)_("%ld lines changed"), oap->line_count);
|
smsg((char_u *)_("%" PRId64 " lines changed"), (int64_t)oap->line_count);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2556,9 +2556,10 @@ int op_yank(oparg_T *oap, int deleting, int mess)
|
|||||||
else
|
else
|
||||||
MSG(_("1 line yanked"));
|
MSG(_("1 line yanked"));
|
||||||
} else if (oap->block_mode)
|
} else if (oap->block_mode)
|
||||||
smsg((char_u *)_("block of %ld lines yanked"), yanklines);
|
smsg((char_u *)_("block of %" PRId64 " lines yanked"),
|
||||||
|
(int64_t)yanklines);
|
||||||
else
|
else
|
||||||
smsg((char_u *)_("%ld lines yanked"), yanklines);
|
smsg((char_u *)_("%" PRId64 " lines yanked"), (int64_t)yanklines);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7680,8 +7680,8 @@ static void spell_make_sugfile(spellinfo_T *spin, char_u *wfname)
|
|||||||
if (sug_maketable(spin) == FAIL)
|
if (sug_maketable(spin) == FAIL)
|
||||||
goto theend;
|
goto theend;
|
||||||
|
|
||||||
smsg((char_u *)_("Number of words after soundfolding: %ld"),
|
smsg((char_u *)_("Number of words after soundfolding: %" PRId64),
|
||||||
(long)spin->si_spellbuf->b_ml.ml_line_count);
|
(int64_t)spin->si_spellbuf->b_ml.ml_line_count);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compress the soundfold trie.
|
* Compress the soundfold trie.
|
||||||
@@ -9084,8 +9084,8 @@ void spell_suggest(int count)
|
|||||||
MSG(_("Sorry, no suggestions"));
|
MSG(_("Sorry, no suggestions"));
|
||||||
else if (count > 0) {
|
else if (count > 0) {
|
||||||
if (count > sug.su_ga.ga_len)
|
if (count > sug.su_ga.ga_len)
|
||||||
smsg((char_u *)_("Sorry, only %ld suggestions"),
|
smsg((char_u *)_("Sorry, only %" PRId64 " suggestions"),
|
||||||
(long)sug.su_ga.ga_len);
|
(int64_t)sug.su_ga.ga_len);
|
||||||
} else {
|
} else {
|
||||||
vim_free(repl_from);
|
vim_free(repl_from);
|
||||||
repl_from = NULL;
|
repl_from = NULL;
|
||||||
|
@@ -2330,11 +2330,11 @@ u_undo_end (
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
smsg((char_u *)_("%ld %s; %s #%ld %s"),
|
smsg((char_u *)_("%" PRId64 " %s; %s #%" PRId64 " %s"),
|
||||||
u_oldcount < 0 ? -u_oldcount : u_oldcount,
|
u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount,
|
||||||
_(msgstr),
|
_(msgstr),
|
||||||
did_undo ? _("before") : _("after"),
|
did_undo ? _("before") : _("after"),
|
||||||
uhp == NULL ? 0L : uhp->uh_seq,
|
uhp == NULL ? (int64_t)0L : (int64_t)uhp->uh_seq,
|
||||||
msgbuf);
|
msgbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user