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

Fix uses of localized "%ld" within EMSGN():
- Replace "%ld" with "%" PRId64.
- No argument cast needed. EMSGN() will take care of that.
This commit is contained in:
Eliseo Martínez
2014-04-20 15:20:22 +02:00
committed by Thiago de Arruda
parent bf3b9d0ecb
commit b8f3ff2a69
10 changed files with 19 additions and 19 deletions

View File

@@ -916,7 +916,7 @@ do_buffer (
if (start == DOBUF_FIRST) { if (start == DOBUF_FIRST) {
/* don't warn when deleting */ /* don't warn when deleting */
if (!unload) if (!unload)
EMSGN(_("E86: Buffer %ld does not exist"), count); EMSGN(_("E86: Buffer %" PRId64 " does not exist"), count);
} else if (dir == FORWARD) } else if (dir == FORWARD)
EMSG(_("E87: Cannot go beyond last buffer")); EMSG(_("E87: Cannot go beyond last buffer"));
else else
@@ -948,9 +948,9 @@ do_buffer (
if (bufIsChanged(buf)) if (bufIsChanged(buf))
return FAIL; return FAIL;
} else { } else {
EMSGN(_( EMSGN(_("E89: No write since last change for buffer %" PRId64
"E89: No write since last change for buffer %ld (add ! to override)"), " (add ! to override)"),
buf->b_fnum); buf->b_fnum);
return FAIL; return FAIL;
} }
} }
@@ -1575,7 +1575,7 @@ int buflist_getfile(int n, linenr_T lnum, int options, int forceit)
if ((options & GETF_ALT) && n == 0) if ((options & GETF_ALT) && n == 0)
EMSG(_(e_noalt)); EMSG(_(e_noalt));
else else
EMSGN(_("E92: Buffer %ld not found"), n); EMSGN(_("E92: Buffer %" PRId64 " not found"), n);
return FAIL; return FAIL;
} }

View File

@@ -142,7 +142,7 @@ void diff_buf_add(buf_T *buf)
} }
} }
EMSGN(_("E96: Can not diff more than %ld buffers"), DB_COUNT); EMSGN(_("E96: Can not diff more than %" PRId64 " buffers"), DB_COUNT);
} }
/// Find buffer "buf" in the list of diff buffers for the current tab page. /// Find buffer "buf" in the list of diff buffers for the current tab page.

View File

@@ -2460,7 +2460,7 @@ void do_wqall(exarg_T *eap)
break; break;
} }
if (buf->b_ffname == NULL) { if (buf->b_ffname == NULL) {
EMSGN(_("E141: No file name for buffer %ld"), (long)buf->b_fnum); EMSGN(_("E141: No file name for buffer %" PRId64), buf->b_fnum);
++error; ++error;
} else if (check_readonly(&eap->forceit, buf) } else if (check_readonly(&eap->forceit, buf)
|| check_overwrite(eap, buf, buf->b_fname, buf->b_ffname, || check_overwrite(eap, buf, buf->b_fname, buf->b_ffname,
@@ -6123,7 +6123,7 @@ void ex_sign(exarg_T *eap)
foldOpenCursor(); foldOpenCursor();
} }
else else
EMSGN(_("E157: Invalid sign ID: %ld"), id); EMSGN(_("E157: Invalid sign ID: %" PRId64), id);
} }
else if (idx == SIGNCMD_UNPLACE) else if (idx == SIGNCMD_UNPLACE)
{ {

View File

@@ -4267,7 +4267,7 @@ check_more (
if (n == 1) if (n == 1)
EMSG(_("E173: 1 more file to edit")); EMSG(_("E173: 1 more file to edit"));
else else
EMSGN(_("E173: %ld more files to edit"), n); EMSGN(_("E173: %" PRId64 " more files to edit"), n);
quitmore = 2; /* next try to quit is allowed */ quitmore = 2; /* next try to quit is allowed */
} }
return FAIL; return FAIL;

View File

@@ -623,7 +623,7 @@ cs_reading_emsg (
int idx /* connection index */ int idx /* connection index */
) )
{ {
EMSGN(_("E262: error reading cscope connection %ld"), idx); EMSGN(_("E262: error reading cscope connection %" PRId64), idx);
} }
#define CSREAD_BUFSIZE 2048 #define CSREAD_BUFSIZE 2048

View File

@@ -2085,7 +2085,7 @@ ml_get_buf (
/* Avoid giving this message for a recursive call, may happen when /* Avoid giving this message for a recursive call, may happen when
* the GUI redraws part of the text. */ * the GUI redraws part of the text. */
++recursive; ++recursive;
EMSGN(_("E315: ml_get: invalid lnum: %ld"), lnum); EMSGN(_("E315: ml_get: invalid lnum: %" PRId64), lnum);
--recursive; --recursive;
} }
errorret: errorret:
@@ -2117,7 +2117,7 @@ errorret:
/* Avoid giving this message for a recursive call, may happen /* Avoid giving this message for a recursive call, may happen
* when the GUI redraws part of the text. */ * when the GUI redraws part of the text. */
++recursive; ++recursive;
EMSGN(_("E316: ml_get: cannot find line %ld"), lnum); EMSGN(_("E316: ml_get: cannot find line %" PRId64), lnum);
--recursive; --recursive;
} }
goto errorret; goto errorret;
@@ -2977,7 +2977,7 @@ static void ml_flush_line(buf_T *buf)
hp = ml_find_line(buf, lnum, ML_FIND); hp = ml_find_line(buf, lnum, ML_FIND);
if (hp == NULL) if (hp == NULL)
EMSGN(_("E320: Cannot find line %ld"), lnum); EMSGN(_("E320: Cannot find line %" PRId64), lnum);
else { else {
dp = (DATA_BL *)(hp->bh_data); dp = (DATA_BL *)(hp->bh_data);
idx = lnum - buf->b_ml.ml_locked_low; idx = lnum - buf->b_ml.ml_locked_low;
@@ -3237,11 +3237,11 @@ static bhdr_T *ml_find_line(buf_T *buf, linenr_T lnum, int action)
} }
if (idx >= (int)pp->pb_count) { /* past the end: something wrong! */ if (idx >= (int)pp->pb_count) { /* past the end: something wrong! */
if (lnum > buf->b_ml.ml_line_count) if (lnum > buf->b_ml.ml_line_count)
EMSGN(_("E322: line number out of range: %ld past the end"), EMSGN(_("E322: line number out of range: %" PRId64 " past the end"),
lnum - buf->b_ml.ml_line_count); lnum - buf->b_ml.ml_line_count);
else else
EMSGN(_("E323: line count wrong in block %ld"), bnum); EMSGN(_("E323: line count wrong in block %" PRId64), bnum);
goto error_block; goto error_block;
} }
if (action == ML_DELETE) { if (action == ML_DELETE) {

View File

@@ -3386,7 +3386,7 @@ int set_errorlist(win_T *wp, list_T *list, int action, char_u *title)
if (bufnum != 0 && (buflist_findnr(bufnum) == NULL)) { if (bufnum != 0 && (buflist_findnr(bufnum) == NULL)) {
if (!did_bufnr_emsg) { if (!did_bufnr_emsg) {
did_bufnr_emsg = TRUE; did_bufnr_emsg = TRUE;
EMSGN(_("E92: Buffer %ld not found"), bufnum); EMSGN(_("E92: Buffer %" PRId64 " not found"), bufnum);
} }
valid = FALSE; valid = FALSE;
bufnum = 0; bufnum = 0;

View File

@@ -8401,7 +8401,7 @@ spell_add_word (
if (i == idx) if (i == idx)
break; break;
if (*spf == NUL) { if (*spf == NUL) {
EMSGN(_("E765: 'spellfile' does not have %ld entries"), idx); EMSGN(_("E765: 'spellfile' does not have %" PRId64 " entries"), idx);
vim_free(fnamebuf); vim_free(fnamebuf);
return; return;
} }

View File

@@ -1933,7 +1933,7 @@ parse_line:
if (line_error) { if (line_error) {
EMSG2(_("E431: Format error in tags file \"%s\""), tag_fname); EMSG2(_("E431: Format error in tags file \"%s\""), tag_fname);
if (!use_cscope) if (!use_cscope)
EMSGN(_("Before byte %ld"), (long)ftell(fp)); EMSGN(_("Before byte %" PRId64), ftell(fp));
stop_searching = TRUE; stop_searching = TRUE;
line_error = FALSE; line_error = FALSE;
} }

View File

@@ -1910,7 +1910,7 @@ void undo_time(long step, int sec, int file, int absolute)
break; break;
if (absolute) { if (absolute) {
EMSGN(_("E830: Undo number %ld not found"), step); EMSGN(_("E830: Undo number %" PRId64 " not found"), step);
return; return;
} }