bug-gnubg
[Top][All Lists]
Advanced

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

Re: [Bug-gnubg] Bug in PositionBearoff() and PositionIndex()


From: Michael Petch
Subject: Re: [Bug-gnubg] Bug in PositionBearoff() and PositionIndex()
Date: Sun, 29 Apr 2012 17:05:44 -0600
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120420 Thunderbird/12.0

On 29/04/2012 4:00 PM, Philippe Michel wrote:
> In PositionBearoff() for instance :
> 
>      for( j = nPoints - 1, i = 0; i < nPoints; i++ )
>          j += anBoard[ i ];
> 
>      fBits = 1u << j;
> 
>      for( i = 0; i < nPoints; i++ ) {
>          j -= anBoard[ i ] + 1;
>          fBits |= ( 1u << j );
>      }

Ewww, you are right. I don't know this code at all to tell you what the
"proper" fix is without breaking anything, but it is clear there is an
issue there - we've sorta been lucky about it in how the compiler
handles the negative case.

-- 
Michael Petch
CApp::Sysware Consulting Ltd.
OpenPGP FingerPrint=D81C 6A0D 987E 7DA5 3219 6715 466A 2ACE 5CAE 3304



reply via email to

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