summaryrefslogtreecommitdiff
path: root/numpy/random
diff options
context:
space:
mode:
authorGuillaume Horel <guillaume.horel@gmail.com>2019-06-27 14:54:35 -0400
committerGuillaume Horel <guillaume.horel@gmail.com>2019-07-11 10:00:03 -0400
commit2657d4992346265dae116278526023d848693224 (patch)
tree3378beb37343fe4b851fe356678168de305afe70 /numpy/random
parentff390dcd55e8b6d828e27a83404a3891c9899838 (diff)
downloadnumpy-2657d4992346265dae116278526023d848693224.tar.gz
prevent warnings
Diffstat (limited to 'numpy/random')
-rw-r--r--numpy/random/generator.pyx8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/random/generator.pyx b/numpy/random/generator.pyx
index 45daf7d7e..3af0f32bf 100644
--- a/numpy/random/generator.pyx
+++ b/numpy/random/generator.pyx
@@ -706,19 +706,19 @@ cdef class Generator:
set_size = <uint64_t>(1.2 * size_i)
mask = _gen_mask(set_size)
set_size = 1 + mask
- hash_set = np.full(set_size, -1, np.uint64)
+ hash_set = np.full(set_size, <uint64_t>-1, np.uint64)
with self.lock, cython.wraparound(False):
for j in range(pop_size_i - size_i, pop_size_i):
val = random_bounded_uint64(&self._bitgen, 0, j, 0, 0)
loc = val & mask
- while hash_set[loc] != -1 and hash_set[loc] != val:
+ while hash_set[loc] != <uint64_t>-1 and hash_set[loc] != <uint64_t>val:
loc = (loc + 1) & mask
- if hash_set[loc] == -1: # then val not in hash_set
+ if hash_set[loc] == <uint64_t>-1: # then val not in hash_set
hash_set[loc] = val
idx_data[j - pop_size_i + size_i] = val
else: # we need to insert j instead
loc = j & mask
- while hash_set[loc] != -1:
+ while hash_set[loc] != <uint64_t>-1:
loc = (loc + 1) & mask
hash_set[loc] = j
idx_data[j - pop_size_i + size_i] = j