X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=util.c;h=3cdc1dbed6e875b8af1e715a652994ba6805e4c6;hb=84ad8ec37a6254d17ee1da84f0490c5b3ac73f0d;hp=b34460d97b63dd983d5e8e5b00161a31512583ec;hpb=6db2e69f9a9411f4d5cb6923b1ead3706d7fe195;p=xonotic%2Fgmqcc.git diff --git a/util.c b/util.c index b34460d..3cdc1db 100644 --- a/util.c +++ b/util.c @@ -425,7 +425,7 @@ static GMQCC_INLINE void mt_generate(void) { * Said loop has been unrolled for MT_SPACE (226 iterations), opposed * to [0, MT_SIZE) (634 iterations). */ - for (i = 0; i < MT_SPACE; ++i) { + for (i = 0; i < MT_SPACE-1; ++i) { y = (0x80000000 & mt_state[i]) | (0x7FFFFFF & mt_state[i + 1]); mt_state[i] = mt_state[i + MT_PERIOD] ^ (y >> 1) ^ matrix[y & 1]; @@ -440,7 +440,7 @@ static GMQCC_INLINE void mt_generate(void) { * = 2*2*3*3*11]) */ i = MT_SPACE; - while (i < MT_SIZE - 1) { + while (i < MT_SIZE-2) { /* * We expand this 11 times .. manually, no macros are required * here. This all fits in the CPU cache.