From: Paul Eggert Date: Tue, 24 May 2011 01:20:04 +0000 (-0700) Subject: * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT. X-Git-Tag: emacs-pretest-24.0.90~104^2~618^2~139^2~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c8a9ca5a6456e7d0ec9577493d5110b692b818bf;p=emacs.git * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT. --- 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; }