mirror of
https://github.com/neovim/neovim.git
synced 2025-09-27 21:48:35 +00:00
Use portable format specifiers: Clint advice & other.
- Modify Clint advice to reflect preference for fixed sized macros. - Cleanup comment to eliminate referecen to "%ld".
This commit is contained in:

committed by
Thiago de Arruda

parent
12c8094dae
commit
557e41b119
4
clint.py
4
clint.py
@@ -1428,7 +1428,7 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum,
|
|||||||
not standard C++. Warning about these in lint is one way to ease the
|
not standard C++. Warning about these in lint is one way to ease the
|
||||||
transition to new compilers.
|
transition to new compilers.
|
||||||
- put storage class first (e.g. "static const" instead of "const static").
|
- put storage class first (e.g. "static const" instead of "const static").
|
||||||
- "%lld" instead of %qd" in printf-type functions.
|
- "%" PRId64 instead of %qd" in printf-type functions.
|
||||||
- "%1$d" is non-standard in printf-type functions.
|
- "%1$d" is non-standard in printf-type functions.
|
||||||
- "\%" is an undefined character escape sequence.
|
- "\%" is an undefined character escape sequence.
|
||||||
- text after #endif is not allowed.
|
- text after #endif is not allowed.
|
||||||
@@ -1454,7 +1454,7 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum,
|
|||||||
|
|
||||||
if Search(r'printf\s*\(.*".*%[-+ ]?\d*q', line):
|
if Search(r'printf\s*\(.*".*%[-+ ]?\d*q', line):
|
||||||
error(filename, linenum, 'runtime/printf_format', 3,
|
error(filename, linenum, 'runtime/printf_format', 3,
|
||||||
'%q in format strings is deprecated. Use %ll instead.')
|
'"%q" in format strings is deprecated. Use "%" PRId64 instead.')
|
||||||
|
|
||||||
if Search(r'printf\s*\(.*".*%\d+\$', line):
|
if Search(r'printf\s*\(.*".*%\d+\$', line):
|
||||||
error(filename, linenum, 'runtime/printf_format', 2,
|
error(filename, linenum, 'runtime/printf_format', 2,
|
||||||
|
@@ -2232,7 +2232,7 @@ win_line (
|
|||||||
int row; /* row in the window, excl w_winrow */
|
int row; /* row in the window, excl w_winrow */
|
||||||
int screen_row; /* row on the screen, incl w_winrow */
|
int screen_row; /* row on the screen, incl w_winrow */
|
||||||
|
|
||||||
char_u extra[18]; /* "%ld" and 'fdc' must fit in here */
|
char_u extra[18]; /* line number and 'fdc' must fit in here */
|
||||||
int n_extra = 0; /* number of extra chars */
|
int n_extra = 0; /* number of extra chars */
|
||||||
char_u *p_extra = NULL; /* string of extra chars, plus NUL */
|
char_u *p_extra = NULL; /* string of extra chars, plus NUL */
|
||||||
int c_extra = NUL; /* extra chars, all the same */
|
int c_extra = NUL; /* extra chars, all the same */
|
||||||
|
Reference in New Issue
Block a user