+2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
+
+ * doprnt.c (doprnt): Support "ll" length modifier, for long long.
+
+ 2011-04-27 Eli Zaretskii <eliz@gnu.org>
+
+ Improve `doprnt' and its usage. (Bug#8545)
+ * doprnt.c (doprnt): Make sure `format' is never accessed beyond
+ `format_end'. Remove support for %l as a conversion specifier.
+ Don't use xrealloc. Improve diagnostics when the %l size modifier
+ is used. Update the commentary.
+
+ * eval.c (verror): Simplify calculation of size_t.
+
+ * coding.c (Ffind_operation_coding_system): Fix diagnostic error
+ messages.
+
2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
* buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
%c means print a `signed int' argument as a single character.
%% means produce a literal % character.
- A %-sequence may contain optional flag, width, and precision specifiers, as
- follows:
+ A %-sequence may contain optional flag, width, and precision specifiers, and
+ a length modifier, as follows:
- %<flags><width><precision>character
+ %<flags><width><precision><length>character
- where flags is [+ -0], width is [0-9]+, precision is .[0-9]+, and length
- modifier is l.
+ where flags is [+ -0l], width is [0-9]+, and precision is .[0-9]+
The + flag character inserts a + before any positive number, while a space
- inserts a space before any positive number; these flags only affect %d, %l,
- %o, %x, %e, %f, and %g sequences. The - and 0 flags affect the width
- specifier, as described below.
-
- The l (lower-case letter ell) flag is a `long' data type modifier: it is
- supported for %d, %o, and %x conversions of integral arguments, and means
- that the respective argument is to be treated as `long int' or `unsigned
- long int'. ll means to use 'long long'. EMACS_INT arguments
- should use the pI macro, which expands to whatever length modifier
- is needed for the target host, e.g., "", "l", "ll".
+ inserts a space before any positive number; these flags only affect %d, %o,
+ %x, %e, %f, and %g sequences. The - and 0 flags affect the width specifier,
+ as described below. For signed numerical arguments only, the ` ' (space)
+ flag causes the result to be prefixed with a space character if it does not
+ start with a sign (+ or -).
+
+ The l (lower-case letter ell) length modifier is a `long' data type
+ modifier: it is supported for %d, %o, and %x conversions of integral
- arguments, must immediately preced the conversion specifier, and means that
++ arguments, must immediately precede the conversion specifier, and means that
+ the respective argument is to be treated as `long int' or `unsigned long
- int'. The EMACS_INT data type should use this modifier.
++ int'. Similarly, ll (two letter ells) means to use `long long int' or
++ `unsigned long long int'. The empty length modifier means to use `int' or
++ `unsigned int'. EMACS_INT arguments should use the pI macro, which
++ expands to whatever length modifier is needed for the target host.
The width specifier supplies a lower limit for the length of the printed
representation. The padding, if any, normally goes on the left, but it goes
;
else if (*fmt == 'l')
{
-- long_flag = 1;
- if (fmt[1] == 'l')
- {
- long_flag = 2;
- fmt++;
- }
- if (!strchr ("dox", fmt[1]))
- /* %l as conversion specifier, not as modifier. */
- break;
- fmt++;
++ long_flag = 1 + (fmt + 1 < fmt_end && fmt[1] == 'l');
++ fmt += long_flag;
+ break;
}
else
break;