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:
Eliseo Martínez
2014-04-20 12:59:31 +02:00
committed by Thiago de Arruda
parent 182b84e1c3
commit c049cb2b51
7 changed files with 27 additions and 26 deletions

View File

@@ -18819,8 +18819,8 @@ call_user_func (
if (aborting())
smsg((char_u *)_("%s aborted"), sourcing_name);
else if (fc->rettv->v_type == VAR_NUMBER)
smsg((char_u *)_("%s returning #%ld"), sourcing_name,
(long)fc->rettv->vval.v_number);
smsg((char_u *)_("%s returning #%" PRId64 ""),
sourcing_name, (int64_t)fc->rettv->vval.v_number);
else {
char_u buf[MSG_BUF_LEN];
char_u numbuf2[NUMBUFLEN];

View File

@@ -756,7 +756,7 @@ int do_move(linenr_T line1, linenr_T line2, linenr_T dest)
if (num_lines == 1)
MSG(_("1 line moved"));
else
smsg((char_u *)_("%ld lines moved"), num_lines);
smsg((char_u *)_("%" PRId64 " lines moved"), (int64_t)num_lines);
}
/*

View File

@@ -141,7 +141,7 @@ void do_debug(char_u *cmd)
if (sourcing_name != NULL)
msg(sourcing_name);
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
smsg((char_u *)_("cmd: %s"), cmd);
@@ -320,10 +320,10 @@ void dbg_check_breakpoint(exarg_T *eap)
p = (char_u *)"<SNR>";
else
p = (char_u *)"";
smsg((char_u *)_("Breakpoint in \"%s%s\" line %ld"),
smsg((char_u *)_("Breakpoint in \"%s%s\" line %" PRId64),
p,
debug_breakpoint_name + (*p == NUL ? 0 : 3),
(long)debug_breakpoint_lnum);
(int64_t)debug_breakpoint_lnum);
debug_breakpoint_name = NULL;
do_debug(eap->cmd);
} else {
@@ -615,11 +615,11 @@ void ex_breaklist(exarg_T *eap)
bp = &BREAKP(i);
if (bp->dbg_type == DBG_FILE)
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_type == DBG_FUNC ? "func" : "file",
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)
smsg((char_u *)_("could not source \"%s\""), fname);
else
smsg((char_u *)_("line %ld: could not source \"%s\""),
sourcing_lnum, fname);
smsg((char_u *)_("line %" PRId64 ": could not source \"%s\""),
(int64_t)sourcing_lnum, fname);
verbose_leave();
}
goto theend;
@@ -2549,8 +2549,8 @@ do_source (
if (sourcing_name == NULL)
smsg((char_u *)_("sourcing \"%s\""), fname);
else
smsg((char_u *)_("line %ld: sourcing \"%s\""),
sourcing_lnum, fname);
smsg((char_u *)_("line %" PRId64 ": sourcing \"%s\""),
(int64_t)sourcing_lnum, fname);
verbose_leave();
}
if (is_vimrc == DOSO_VIMRC)

View File

@@ -763,8 +763,8 @@ int flags;
++no_wait_return;
verbose_enter_scroll();
smsg((char_u *)_("line %ld: %s"),
(long)sourcing_lnum, cmdline_copy);
smsg((char_u *)_("line %" PRId64 ": %s"),
(int64_t)sourcing_lnum, cmdline_copy);
if (msg_silent == 0)
msg_puts((char_u *)"\n"); /* don't overwrite this */

View File

@@ -594,7 +594,7 @@ int (*how)(void);
if (i > 1
&& (i % 50 == 0 || i == oap->line_count - 1)
&& 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
@@ -638,7 +638,7 @@ int (*how)(void);
if (i == 1)
MSG(_("1 line indented "));
else
smsg((char_u *)_("%ld lines indented "), i);
smsg((char_u *)_("%" PRId64 " lines indented "), (int64_t)i);
}
/* set '[ and '] marks */
curbuf->b_op_start = oap->start;
@@ -1953,7 +1953,7 @@ void op_tilde(oparg_T *oap)
if (oap->line_count == 1)
MSG(_("1 line changed"));
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
MSG(_("1 line yanked"));
} 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
smsg((char_u *)_("%ld lines yanked"), yanklines);
smsg((char_u *)_("%" PRId64 " lines yanked"), (int64_t)yanklines);
}
}

View File

@@ -7680,8 +7680,8 @@ static void spell_make_sugfile(spellinfo_T *spin, char_u *wfname)
if (sug_maketable(spin) == FAIL)
goto theend;
smsg((char_u *)_("Number of words after soundfolding: %ld"),
(long)spin->si_spellbuf->b_ml.ml_line_count);
smsg((char_u *)_("Number of words after soundfolding: %" PRId64),
(int64_t)spin->si_spellbuf->b_ml.ml_line_count);
/*
* Compress the soundfold trie.
@@ -9084,8 +9084,8 @@ void spell_suggest(int count)
MSG(_("Sorry, no suggestions"));
else if (count > 0) {
if (count > sug.su_ga.ga_len)
smsg((char_u *)_("Sorry, only %ld suggestions"),
(long)sug.su_ga.ga_len);
smsg((char_u *)_("Sorry, only %" PRId64 " suggestions"),
(int64_t)sug.su_ga.ga_len);
} else {
vim_free(repl_from);
repl_from = NULL;

View File

@@ -2330,11 +2330,11 @@ u_undo_end (
}
}
smsg((char_u *)_("%ld %s; %s #%ld %s"),
u_oldcount < 0 ? -u_oldcount : u_oldcount,
smsg((char_u *)_("%" PRId64 " %s; %s #%" PRId64 " %s"),
u_oldcount < 0 ? (int64_t)-u_oldcount : (int64_t)u_oldcount,
_(msgstr),
did_undo ? _("before") : _("after"),
uhp == NULL ? 0L : uhp->uh_seq,
uhp == NULL ? (int64_t)0L : (int64_t)uhp->uh_seq,
msgbuf);
}