Use portable format specifiers: Case %ld - localized - vim_snprintf_add.

Fix uses of localized "%ld" within vim_snprintf_add():
- Replace "%ld" with "%" PRId64.
- Cast corresponding argument to (int64_t).
This commit is contained in:
Eliseo Martínez
2014-04-20 18:27:12 +02:00
committed by Thiago de Arruda
parent 22dd4f62d3
commit f4b81576cc
2 changed files with 8 additions and 6 deletions

View File

@@ -2578,9 +2578,9 @@ fileinfo (
(int64_t)curbuf->b_ml.ml_line_count, n); (int64_t)curbuf->b_ml.ml_line_count, n);
} else { } else {
vim_snprintf_add((char *)buffer, IOSIZE, vim_snprintf_add((char *)buffer, IOSIZE,
_("line %ld of %ld --%d%%-- col "), _("line %" PRId64 " of %" PRId64 " --%d%%-- col "),
(long)curwin->w_cursor.lnum, (int64_t)curwin->w_cursor.lnum,
(long)curbuf->b_ml.ml_line_count, (int64_t)curbuf->b_ml.ml_line_count,
n); n);
validate_virtcol(); validate_virtcol();
len = STRLEN(buffer); len = STRLEN(buffer);

View File

@@ -4488,14 +4488,16 @@ do_sub_msg (
"%s", count_only ? _("1 match") : _("1 substitution")); "%s", count_only ? _("1 match") : _("1 substitution"));
else else
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
count_only ? _("%ld matches") : _("%ld substitutions"), count_only ?
sub_nsubs); _("%" PRId64 " matches") :
_("%" PRId64 " substitutions"),
(int64_t)sub_nsubs);
if (sub_nlines == 1) if (sub_nlines == 1)
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
"%s", _(" on 1 line")); "%s", _(" on 1 line"));
else else
vim_snprintf_add((char *)msg_buf, sizeof(msg_buf), vim_snprintf_add((char *)msg_buf, sizeof(msg_buf),
_(" on %ld lines"), (long)sub_nlines); _(" on %" PRId64 " lines"), (int64_t)sub_nlines);
if (msg(msg_buf)) if (msg(msg_buf))
/* save message to display it after redraw */ /* save message to display it after redraw */
set_keep_msg(msg_buf, 0); set_keep_msg(msg_buf, 0);