Use portable format specifiers: Adapt/fix EMSGU/emsgu to use (uint64_t).

Problem

EMSGU macro was defined as the unsigned counterpart of EMSGN. This is,
invoking emsgu instead of emsgn and having a long_u argument instead of
a long.
But, surprisingly, emsgu was not defined anywhere, which didn't result
in an error because in fact EMSGU was not used (the only point in code
printing a %lu erroneously using EMSGN instead).

Solution

- Define emsgu.
- Adapt EMSGU macro to use uint64_t instead of long_u.
This commit is contained in:
Eliseo Martínez
2014-05-02 21:23:17 +02:00
committed by Justin M. Keyes
parent d84fe0a1b0
commit a9e6098637
3 changed files with 13 additions and 1 deletions

View File

@@ -899,6 +899,17 @@ int emsgn(char_u *s, int64_t n)
return emsg(IObuff);
}
/*
* Print an error message with one "%" PRIu64 and one (uint64_t) argument.
*/
int emsgu(char_u *s, uint64_t n)
{
if (emsg_not_now())
return TRUE; /* no error messages at the moment */
vim_snprintf((char *)IObuff, IOSIZE, (char *)s, n);
return emsg(IObuff);
}
/*
* Read 2 bytes from "fd" and turn them into an int, MSB first.
*/