Skip to content

Commit 194724f

Browse files
committed
CLN: Explicit cast to avoid warning
Use an explicit cast to avoid warning about mismatch
1 parent 2cd9df4 commit 194724f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

randomstate/bounded_integers.pxi.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ cdef object _rand_{{nptype}}(object low, object high, object size, aug_state *st
8383
high_ndim = np.PyArray_NDIM(<np.ndarray>high)
8484
if ((low_ndim == 0 or (low_ndim==1 and low.size==1 and size is not None)) and
8585
(high_ndim == 0 or (high_ndim==1 and high.size==1 and size is not None))):
86-
low = int(low) # TODO: Cast appropriately?
87-
high = int(high) # TODO: Cast appropriately?
86+
low = int(low)
87+
high = int(high)
8888

8989
if low < {{lb}}:
9090
raise ValueError("low is out of bounds for {{nptype}}")
@@ -205,8 +205,8 @@ cdef object _rand_{{nptype}}(object low, object high, object size, aug_state *st
205205
high_ndim = np.PyArray_NDIM(<np.ndarray>high)
206206
if ((low_ndim == 0 or (low_ndim==1 and low.size==1 and size is not None)) and
207207
(high_ndim == 0 or (high_ndim==1 and high.size==1 and size is not None))):
208-
low = int(low) # TODO: Cast appropriately?
209-
high = int(high) # TODO: Cast appropriately?
208+
low = int(low)
209+
high = int(high)
210210
high -= 1 # Use a closed interval
211211

212212
if low < {{lb}}:

randomstate/randomstate.pyx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,11 @@ cdef class RandomState:
360360
IF RS_SEED_ARRAY_BITS == 32:
361361
set_seed_by_array(&self.rng_state,
362362
<uint32_t *>np.PyArray_DATA(seed),
363-
np.PyArray_DIM(seed, 0))
363+
<int>np.PyArray_DIM(seed, 0))
364364
ELSE:
365365
set_seed_by_array(&self.rng_state,
366366
<uint64_t *>np.PyArray_DATA(seed),
367-
np.PyArray_DIM(seed, 0))
367+
<int>np.PyArray_DIM(seed, 0))
368368
self.__seed = seed
369369
self._reset_state_variables()
370370

0 commit comments

Comments
 (0)