From c8a9ca5a6456e7d0ec9577493d5110b692b818bf Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Mon, 23 May 2011 18:20:04 -0700 Subject: [PATCH] * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT. --- src/ChangeLog | 4 ++++ src/data.c | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 9f9cf401e96..96e489bd731 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2011-05-24 Paul Eggert + + * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT. + 2011-05-23 Paul Eggert * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'. diff --git a/src/data.c b/src/data.c index 073fb0d4926..ce0e8e40f51 100644 --- a/src/data.c +++ b/src/data.c @@ -2494,8 +2494,9 @@ arith_driver (enum arithop code, size_t nargs, register Lisp_Object *args) case Amult: if (INT_MULTIPLY_OVERFLOW (accum, next)) { + EMACS_UINT a = accum, b = next, ab = a * b; overflow = 1; - accum = (EMACS_UINT) accum * (EMACS_UINT) next & INTMASK; + accum = ab & INTMASK; } else accum *= next; @@ -2792,11 +2793,11 @@ In this case, zeros are shifted in on the left. */) if (XINT (count) >= BITS_PER_EMACS_INT) XSETINT (val, 0); else if (XINT (count) > 0) - XSETINT (val, (EMACS_UINT) XUINT (value) << XFASTINT (count)); + XSETINT (val, XUINT (value) << XFASTINT (count)); else if (XINT (count) <= -BITS_PER_EMACS_INT) XSETINT (val, 0); else - XSETINT (val, (EMACS_UINT) XUINT (value) >> -XINT (count)); + XSETINT (val, XUINT (value) >> -XINT (count)); return val; } -- 2.39.2