diff options
author | Paul Eggert <[email protected]> | 2011-07-06 19:14:52 -0700 |
---|---|---|
committer | Paul Eggert <[email protected]> | 2011-07-06 19:14:52 -0700 |
commit | c2d1e36da89642b8916965a967b000aff7d59099 (patch) | |
tree | 6cb72d08c40607a35d1b7a70ee2c31b030c37737 /src/lisp.h | |
parent | 0e926e561c259468174b16407dd7271c2c8fe904 (diff) |
* doprnt.c: Prefer signed to unsigned when either works.
* eval.c (verror):
* doprnt.c (doprnt):
* lisp.h (doprnt):
* xdisp.c (vmessage):
Use ptrdiff_t, not size_t, when using or implementing doprnt,
since the sizes cannot exceed ptrdiff_t bounds anyway, and we
prefer signed arithmetic to avoid comparison confusion.
* doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
but is a bit tricky.
Diffstat (limited to 'src/lisp.h')
-rw-r--r-- | src/lisp.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lisp.h b/src/lisp.h index cd3cfd316a..f16a32e633 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -2868,7 +2868,8 @@ extern void float_to_string (char *, double); extern void syms_of_print (void); /* Defined in doprnt.c */ -extern size_t doprnt (char *, size_t, const char *, const char *, va_list); +extern ptrdiff_t doprnt (char *, ptrdiff_t, const char *, const char *, + va_list); /* Defined in lread.c. */ extern Lisp_Object Qvariable_documentation, Qstandard_input; |