Commit b7cbbd6f authored by Paul Eggert's avatar Paul Eggert

* xdisp.c (pint2hrstr): Simplify and tune code slightly.

This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
parent 19ab8a18
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
This is less likely to overflow, and avoids undefined behavior if This is less likely to overflow, and avoids undefined behavior if
overflow does occur. All callers changed. Use strtoul to scan overflow does occur. All callers changed. Use strtoul to scan
for the unsigned long integer. for the unsigned long integer.
(pint2hrstr): Simplify and tune code slightly.
This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
* scroll.c (do_scrolling): Work around GCC bug 48228. * scroll.c (do_scrolling): Work around GCC bug 48228.
See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>. See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
...@@ -19006,7 +19006,7 @@ pint2str (register char *buf, register int width, register EMACS_INT d) ...@@ -19006,7 +19006,7 @@ pint2str (register char *buf, register int width, register EMACS_INT d)
static const char power_letter[] = static const char power_letter[] =
{ {
0, /* not used */ 0, /* no letter */
'k', /* kilo */ 'k', /* kilo */
'M', /* mega */ 'M', /* mega */
'G', /* giga */ 'G', /* giga */
...@@ -19088,8 +19088,7 @@ pint2hrstr (char *buf, int width, int d) ...@@ -19088,8 +19088,7 @@ pint2hrstr (char *buf, int width, int d)
p = psuffix = buf + max (width, length); p = psuffix = buf + max (width, length);
/* Print EXPONENT. */ /* Print EXPONENT. */
if (exponent) *psuffix++ = power_letter[exponent];
*psuffix++ = power_letter[exponent];
*psuffix = '\0'; *psuffix = '\0';
/* Print TENTHS. */ /* Print TENTHS. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment