Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1109b54

Browse files
committed
Fix compiler warning on Windows 64-bit: explicit cast size_t to unsigned long
1 parent aa32779 commit 1109b54

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Modules/_randommodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,15 @@ init_by_array(RandomObject *self, unsigned long init_key[], size_t key_length)
179179
k = (N>key_length ? N : key_length);
180180
for (; k; k--) {
181181
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1664525UL))
182-
+ init_key[j] + j; /* non linear */
182+
+ init_key[j] + (unsigned long)j; /* non linear */
183183
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
184184
i++; j++;
185185
if (i>=N) { mt[0] = mt[N-1]; i=1; }
186186
if (j>=key_length) j=0;
187187
}
188188
for (k=N-1; k; k--) {
189189
mt[i] = (mt[i] ^ ((mt[i-1] ^ (mt[i-1] >> 30)) * 1566083941UL))
190-
- i; /* non linear */
190+
- (unsigned long)i; /* non linear */
191191
mt[i] &= 0xffffffffUL; /* for WORDSIZE > 32 machines */
192192
i++;
193193
if (i>=N) { mt[0] = mt[N-1]; i=1; }

0 commit comments

Comments
 (0)