Fix compiler warning on Windows 64-bit: explicit cast size_t to unsigned long

This commit is contained in:
Victor Stinner 2013-11-15 23:16:15 +01:00
parent aa32779632
commit 1109b54e03
1 changed files with 2 additions and 2 deletions

View File

@ -179,7 +179,7 @@ init_by_array(RandomObject *self, unsigned long init_key[], size_t key_length)
k = (N>key_length ? N : key_length);
for (; k; k--) {
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL))
+ init_key[j] + j; /* non linear */
+ init_key[j] + (unsigned long)j; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++; j++;
if (i>=N) { mt[0] = mt[N-1]; i=1; }
@ -187,7 +187,7 @@ init_by_array(RandomObject *self, unsigned long init_key[], size_t key_length)
}
for (k=N-1; k; k--) {
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL))
- i; /* non linear */
- (unsigned long)i; /* non linear */
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
i++;
if (i>=N) { mt[0] = mt[N-1]; i=1; }