diff options
| author | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2021-02-17 11:05:42 +0000 |
|---|---|---|
| committer | Kevin Sheppard <kevin.k.sheppard@gmail.com> | 2021-02-18 16:39:36 +0000 |
| commit | e2467e463d7f0c7fe01ef33311d007f7182a0cf7 (patch) | |
| tree | b3d6be604934701d68c86729525a09134ab2c0ae | |
| parent | 0eb9f54e5e466c8d7a76ae116712b368d045c7e0 (diff) | |
| download | numpy-e2467e463d7f0c7fe01ef33311d007f7182a0cf7.tar.gz | |
MAINT: Correct code producing warnings
Cast to avoid warnings
Correct function
| -rw-r--r-- | numpy/core/src/multiarray/ctors.c | 2 | ||||
| -rw-r--r-- | numpy/core/src/umath/fast_loop_macros.h | 2 | ||||
| -rw-r--r-- | numpy/random/src/distributions/distributions.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/numpy/core/src/multiarray/ctors.c b/numpy/core/src/multiarray/ctors.c index ef105ff2d..fc1152d51 100644 --- a/numpy/core/src/multiarray/ctors.c +++ b/numpy/core/src/multiarray/ctors.c @@ -2907,7 +2907,7 @@ _arange_safe_ceil_to_intp(double value) "arange: cannot compute length"); return -1; } - if (!(NPY_MIN_INTP <= ivalue && ivalue <= NPY_MAX_INTP)) { + if (!(NPY_MIN_INTP <= ivalue && ivalue <= (double)NPY_MAX_INTP)) { PyErr_SetString(PyExc_OverflowError, "arange: overflow while computing length"); return -1; diff --git a/numpy/core/src/umath/fast_loop_macros.h b/numpy/core/src/umath/fast_loop_macros.h index b81795b96..4a36c9721 100644 --- a/numpy/core/src/umath/fast_loop_macros.h +++ b/numpy/core/src/umath/fast_loop_macros.h @@ -305,7 +305,7 @@ abs_ptrdiff(char *a, char *b) */ #define IS_OUTPUT_BLOCKABLE_UNARY(esizein, esizeout, vsize) \ ((steps[0] & (esizein-1)) == 0 && \ - steps[1] == (esizeout) && labs(steps[0]) < MAX_STEP_SIZE && \ + steps[1] == (esizeout) && llabs(steps[0]) < MAX_STEP_SIZE && \ (nomemoverlap(args[1], steps[1] * dimensions[0], args[0], steps[0] * dimensions[0]))) #define IS_BLOCKABLE_REDUCE(esize, vsize) \ diff --git a/numpy/random/src/distributions/distributions.c b/numpy/random/src/distributions/distributions.c index 93e0bdc5f..4494f860e 100644 --- a/numpy/random/src/distributions/distributions.c +++ b/numpy/random/src/distributions/distributions.c @@ -971,7 +971,7 @@ RAND_INT_TYPE random_zipf(bitgen_t *bitgen_state, double a) { * just reject this value. This function then models a Zipf * distribution truncated to sys.maxint. */ - if (X > RAND_INT_MAX || X < 1.0) { + if (X > (double)RAND_INT_MAX || X < 1.0) { continue; } |
