diff options
| author | Paul Eggert <eggert@cs.ucla.edu> | 2019-07-07 12:29:27 -0700 |
|---|---|---|
| committer | Paul Eggert <eggert@cs.ucla.edu> | 2019-07-07 12:33:35 -0700 |
| commit | 8f522efe9a963cd3523ea6863f9bd44881cdf6b7 (patch) | |
| tree | 10ba28c937e142395bcc4d81580d24fa334e1227 /src/editfns.c | |
| parent | bda8a57141e6cb5455e1246c6ab394791fd6c582 (diff) | |
| download | emacs-8f522efe9a963cd3523ea6863f9bd44881cdf6b7.tar.gz | |
Remove printmax_t etc.
printmax_t etc. were needed only for platforms that lacked
support for printing intmax_t. These platforms are now so
obsolete that they are no longer practical porting targets.
* src/image.c (gs_load): Fix unlikely buffer overrun
discovered while making these changes. It was introduced in
2011-07-17T00:34:43!eggert@cs.ucla.edu.
* src/lisp.h (printmax_t, uprintmax_t, pMd, pMu, pMx):
Remove. All uses replaced by their standard counterparts
intmax_t, uintmax_t, PRIdMAX, PRIuMAX, PRIxMAX.
Diffstat (limited to 'src/editfns.c')
| -rw-r--r-- | src/editfns.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/editfns.c b/src/editfns.c index ee538e50e25..fd9fbaeaea2 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3477,8 +3477,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) error ("Format specifier doesn't match argument type"); else { - /* Length of pM (that is, of pMd without the trailing "d"). */ - enum { pMlen = sizeof pMd - 2 }; + /* Length of PRIdMAX without the trailing "d". */ + enum { pMlen = sizeof PRIdMAX - 2 }; /* Avoid undefined behavior in underlying sprintf. */ if (conversion == 'd' || conversion == 'i') @@ -3487,7 +3487,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) /* Create the copy of the conversion specification, with any width and precision removed, with ".*" inserted, with "L" possibly inserted for floating-point formats, - and with pM inserted for integer formats. + and with PRIdMAX (sans "d") inserted for integer formats. At most two flags F can be specified at once. */ char convspec[sizeof "%FF.*d" + max (sizeof "L" - 1, pMlen)]; char *f = convspec; @@ -3616,7 +3616,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) { if (FIXNUMP (arg)) { - printmax_t x = XFIXNUM (arg); + intmax_t x = XFIXNUM (arg); sprintf_bytes = sprintf (p, convspec, prec, x); } else @@ -3636,7 +3636,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) } else { - uprintmax_t x; + uintmax_t x; bool negative; if (FIXNUMP (arg)) { @@ -3655,8 +3655,8 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message) else { double d = XFLOAT_DATA (arg); - double uprintmax = TYPE_MAXIMUM (uprintmax_t); - if (! (0 <= d && d < uprintmax + 1)) + double uintmax = UINTMAX_MAX; + if (! (0 <= d && d < uintmax + 1)) xsignal1 (Qoverflow_error, arg); x = d; negative = false; |
