From: Paul Eggert Date: Wed, 27 Apr 2011 22:29:33 +0000 (-0700) Subject: Merge from mainline. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~193^2~2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=54b8e3f7753cdd63ba6dac998d56fcd34dd59d8e;p=emacs.git Merge from mainline. --- 54b8e3f7753cdd63ba6dac998d56fcd34dd59d8e diff --cc src/ChangeLog index b23904a3575,f67e27f4e5e..939e11ed61c --- a/src/ChangeLog +++ b/src/ChangeLog @@@ -1,7 -1,16 +1,20 @@@ +2011-04-27 Paul Eggert + + * doprnt.c (doprnt): Support "ll" length modifier, for long long. + + 2011-04-27 Eli Zaretskii + + 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 (tiny change) * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing diff --cc src/doprnt.c index 229ad06e057,92e2d627432..cc4e5daebf3 --- a/src/doprnt.c +++ b/src/doprnt.c @@@ -65,24 -64,26 +64,28 @@@ along with GNU Emacs. If not, see character + %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 @@@ -206,15 -208,9 +210,9 @@@ doprnt (char *buffer, register size_t b ; 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;