Minor improvements to make_formatted_string.
* alloc.c (make_formatted_string): Prefer int to ptrdiff_t where int is good enough, as vsprintf returns an int. * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
This commit is contained in:
parent
52331d2c41
commit
26bccfaebf
3 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
|
||||
|
||||
Minor improvements to make_formatted_string.
|
||||
* alloc.c (make_formatted_string): Prefer int to ptrdiff_t
|
||||
where int is good enough, as vsprintf returns an int.
|
||||
* lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
|
||||
|
||||
2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
|
||||
|
||||
Use make_formatted_string to avoid double length calculation.
|
||||
|
|
|
@ -2524,7 +2524,7 @@ Lisp_Object
|
|||
make_formatted_string (char *buf, const char *format, ...)
|
||||
{
|
||||
va_list ap;
|
||||
ptrdiff_t length;
|
||||
int length;
|
||||
|
||||
va_start (ap, format);
|
||||
length = vsprintf (buf, format, ap);
|
||||
|
|
|
@ -2611,7 +2611,8 @@ extern Lisp_Object list5 (Lisp_Object, Lisp_Object, Lisp_Object, Lisp_Object,
|
|||
extern Lisp_Object allocate_misc (void);
|
||||
extern _Noreturn void string_overflow (void);
|
||||
extern Lisp_Object make_string (const char *, ptrdiff_t);
|
||||
extern Lisp_Object make_formatted_string (char *, const char *, ...);
|
||||
extern Lisp_Object make_formatted_string (char *, const char *, ...)
|
||||
ATTRIBUTE_FORMAT_PRINTF (2, 3);
|
||||
extern Lisp_Object make_unibyte_string (const char *, ptrdiff_t);
|
||||
extern Lisp_Object make_multibyte_string (const char *, ptrdiff_t, ptrdiff_t);
|
||||
extern Lisp_Object make_event_array (int, Lisp_Object *);
|
||||
|
|
Loading…
Add table
Reference in a new issue