gnash-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_fi


From: Richard Wilbur
Subject: Re: [Gnash-commit] [SCM] Gnash branch, master, updated. release_0_8_9_final-1673-g75671d1
Date: Tue, 23 Jul 2013 11:58:28 -0600

On Wed, Jul 17, 2013 at 4:24 PM, Bastiaan Jacques <address@hidden> wrote:
> diff --git a/libcore/vm/ASHandlers.cpp b/libcore/vm/ASHandlers.cpp
> +inline boost::uint32_t
> +saneShiftParam(boost::int32_t value)
> +{
> +    // NOTE: ISO-IEC 14882:2003 5.8.1: "The behavior is undefined if the 
> right
> +    // operand is negative, or greater than or equal to the length in bits of
> +    // the promoted left operand."
> +    boost::uint32_t rv = value;
> +    return rv % 32;
> +}

Regarding efficiency, I would recommend in this case considering the
alternative (with identical results):
return rv & (32 - 1);
which can be rephrased
return rv & 31;
or, if you prefer hexadecimal
return rv & 0x1f;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]