aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <[email protected]>2011-03-22 01:15:43 -0700
committerPaul Eggert <[email protected]>2011-03-22 01:15:43 -0700
commitb7cbbd6f018241962b432c1a608067614d223a6d (patch)
treef7b514f73a97261c15ef38959c9c11eca2d44df9 /src
parent19ab8a188aed3904edb0cfa026503c4d63c57c5a (diff)
* xdisp.c (pint2hrstr): Simplify and tune code slightly.
This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog2
-rw-r--r--src/xdisp.c5
2 files changed, 4 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a9f3e3a5b7..fd135de123 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -4,6 +4,8 @@
This is less likely to overflow, and avoids undefined behavior if
overflow does occur. All callers changed. Use strtoul to scan
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.
See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
diff --git a/src/xdisp.c b/src/xdisp.c
index 93bc8c9479..457a5e3e11 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -19006,7 +19006,7 @@ pint2str (register char *buf, register int width, register EMACS_INT d)
static const char power_letter[] =
{
- 0, /* not used */
+ 0, /* no letter */
'k', /* kilo */
'M', /* mega */
'G', /* giga */
@@ -19088,8 +19088,7 @@ pint2hrstr (char *buf, int width, int d)
p = psuffix = buf + max (width, length);
/* Print EXPONENT. */
- if (exponent)
- *psuffix++ = power_letter[exponent];
+ *psuffix++ = power_letter[exponent];
*psuffix = '\0';
/* Print TENTHS. */