mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Use portable format specifiers: Remove branching with LONG_LONG_OFF_T.
After previous commits, branching code by using macro LONG_LONG_OFF_T becomes unneccesary. Remove it.
This commit is contained in:
parent
e4a1ea9e02
commit
f916cf067d
@ -4147,12 +4147,7 @@ void msg_add_lines(int insert_space, long lnum, off_t nchars)
|
||||
if (insert_space)
|
||||
*p++ = ' ';
|
||||
if (shortmess(SHM_LINES)) {
|
||||
#ifdef LONG_LONG_OFF_T
|
||||
sprintf((char *)p, "%ldL, %" PRId64 "C", lnum, (int64_t)nchars);
|
||||
#else
|
||||
/* Explicit typecast avoids warning on Mac OS X 10.6 */
|
||||
sprintf((char *)p, "%ldL, %ldC", lnum, (long)nchars);
|
||||
#endif
|
||||
}
|
||||
else {
|
||||
if (lnum == 1)
|
||||
@ -4163,11 +4158,7 @@ void msg_add_lines(int insert_space, long lnum, off_t nchars)
|
||||
if (nchars == 1)
|
||||
STRCPY(p, _("1 character"));
|
||||
else {
|
||||
#ifdef LONG_LONG_OFF_T
|
||||
sprintf((char *)p, _("%" PRId64 " characters"), nchars);
|
||||
#else
|
||||
sprintf((char *)p, _("%ld characters"), (long)nchars);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
10
src/vim.h
10
src/vim.h
@ -93,16 +93,6 @@ typedef long __w64 long_i;
|
||||
# define PRINTF_HEX_LONG_U "0x%lx"
|
||||
#define PRINTF_DECIMAL_LONG_U SCANF_DECIMAL_LONG_U
|
||||
|
||||
/*
|
||||
* Only systems which use configure will have SIZEOF_OFF_T and SIZEOF_LONG
|
||||
* defined, which is ok since those are the same systems which can have
|
||||
* varying sizes for off_t. The other systems will continue to use "%ld" to
|
||||
* print off_t since off_t is simply a typedef to long for them.
|
||||
*/
|
||||
#if defined(SIZEOF_OFF_T) && (SIZEOF_OFF_T > SIZEOF_LONG)
|
||||
# define LONG_LONG_OFF_T
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The characters and attributes cached for the screen.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user