<html>
    <head>
      <base href="http://bugzilla.gdcproject.org/" />
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - >>>= broken with short integers"
   href="http://bugzilla.gdcproject.org/show_bug.cgi?id=171#c1">Comment # 1</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - >>>= broken with short integers"
   href="http://bugzilla.gdcproject.org/show_bug.cgi?id=171">bug 171</a>
              from <span class="vcard"><a class="email" href="mailto:ibuclaw@gdcproject.org" title="Iain Buclaw <ibuclaw@gdcproject.org>"> <span class="fn">Iain Buclaw</span></a>
</span></b>
        <pre>Problem is that in the operation:

a = a >> 1;

'a' is promoted to an unsigned integer for normal operations before the final
result being downcasted back.

So we get the following sequence.

a           => -1
cast(uint)  => 4294967295
a >> 1      => 2147483647
cast(short) => -1</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>