Array range check warning workaround in random.h
authorBalazs Dezso <deba@inf.elte.hu>
Fri, 25 Jan 2008 15:23:28 +0100
changeset 624790635473ef
parent 60 6ec5dbed8f18
child 63 1113f6d12c0c
Array range check warning workaround in random.h

The g++-4.2.1 preferred by OpenSUSE has a bug with array range cheking
lemon/random.h
     1.1 --- a/lemon/random.h	Wed Jan 23 16:26:41 2008 +0100
     1.2 +++ b/lemon/random.h	Fri Jan 25 15:23:28 2008 +0100
     1.3 @@ -254,7 +254,7 @@
     1.4              curr[length - shift] ^ mask[curr[-1] & 1ul];
     1.5            --curr;
     1.6          }
     1.7 -        curr[0] = (((curr[0] & hiMask) | (curr[length - 1] & loMask)) >> 1) ^
     1.8 +        state[0] = (((state[0] & hiMask) | (curr[length - 1] & loMask)) >> 1) ^
     1.9            curr[length - shift] ^ mask[curr[length - 1] & 1ul];
    1.10  
    1.11        }