Showing 1 of 1 files from the diff.

@@ -28,6 +28,30 @@
Loading
28 28
 * PyInt -> PyLong
29 29
 */
30 30
31 +
32 +
/*
33 +
 * This is a renamed copy of the Python non-limited API function _PyLong_AsInt. It is
34 +
 * included here because it is missing from the PyPy API. It completes the PyLong_As*
35 +
 * group of functions and can be useful in replacing PyInt_Check.
36 +
 */
37 +
static NPY_INLINE int
38 +
Npy__PyLong_AsInt(PyObject *obj)
39 +
{
40 +
    int overflow;
41 +
    long result = PyLong_AsLongAndOverflow(obj, &overflow);
42 +
43 +
    /* INT_MAX and INT_MIN are defined in Python.h */
44 +
    if (overflow || result > INT_MAX || result < INT_MIN) {
45 +
        /* XXX: could be cute and give a different
46 +
           message for overflow == -1 */
47 +
        PyErr_SetString(PyExc_OverflowError,
48 +
                        "Python int too large to convert to C int");
49 +
        return -1;
50 +
    }
51 +
    return (int)result;
52 +
}
53 +
54 +
31 55
#if defined(NPY_PY3K)
32 56
/* Return True only if the long fits in a C long */
33 57
static NPY_INLINE int PyInt_Check(PyObject *op) {
@@ -39,6 +63,7 @@
Loading
39 63
    return (overflow == 0);
40 64
}
41 65
66 +
42 67
#define PyInt_FromLong PyLong_FromLong
43 68
#define PyInt_AsLong PyLong_AsLong
44 69
#define PyInt_AS_LONG PyLong_AsLong
Files Coverage
numpy 84.01%
Project Totals (128 files) 84.01%
33752.9
3.7=-X.7
TRAVIS_OS_NAME=linux
1
codecov:
2
  notify:
3
    require_ci_to_pass: no
4
    after_n_builds: 1
5
coverage:
6
  status:
7
    project:
8
      default:
9
        # Require 1% coverage, i.e., always succeed
10
        target: 1
11
    patch: true
12
    changes: false
13
comment: off
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading