summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-08-24 23:01:30 (GMT)
committerGitHub <noreply@github.com>2023-08-24 23:01:30 (GMT)
commitb32d4cad15f537f25063bcd56377e16df59d98db (patch)
tree0a71372347d58e79575f9dfae35407c694fcb611 /Python
parent4e5a7284eef4308dce252ca1115d4a5a5b7e6ae8 (diff)
downloadcpython-b32d4cad15f537f25063bcd56377e16df59d98db.zip
cpython-b32d4cad15f537f25063bcd56377e16df59d98db.tar.gz
cpython-b32d4cad15f537f25063bcd56377e16df59d98db.tar.bz2
gh-108444: Replace _PyLong_AsInt() with PyLong_AsInt() (#108459)
Change generated by the command: sed -i -e 's!_PyLong_AsInt!PyLong_AsInt!g' \ $(find -name "*.c" -o -name "*.h")
Diffstat (limited to 'Python')
-rw-r--r--Python/assemble.c6
-rw-r--r--Python/ceval.c2
-rw-r--r--Python/flowgraph.c4
-rw-r--r--Python/initconfig.c2
-rw-r--r--Python/legacy_tracing.c6
5 files changed, 10 insertions, 10 deletions
diff --git a/Python/assemble.c b/Python/assemble.c
index c770fd1..b6fb432 100644
--- a/Python/assemble.c
+++ b/Python/assemble.c
@@ -476,7 +476,7 @@ compute_localsplus_info(_PyCompile_CodeUnitMetadata *umd, int nlocalsplus,
PyObject *k, *v;
Py_ssize_t pos = 0;
while (PyDict_Next(umd->u_varnames, &pos, &k, &v)) {
- int offset = _PyLong_AsInt(v);
+ int offset = PyLong_AsInt(v);
if (offset == -1 && PyErr_Occurred()) {
return ERROR;
}
@@ -513,7 +513,7 @@ compute_localsplus_info(_PyCompile_CodeUnitMetadata *umd, int nlocalsplus,
continue;
}
- int offset = _PyLong_AsInt(v);
+ int offset = PyLong_AsInt(v);
if (offset == -1 && PyErr_Occurred()) {
return ERROR;
}
@@ -525,7 +525,7 @@ compute_localsplus_info(_PyCompile_CodeUnitMetadata *umd, int nlocalsplus,
pos = 0;
while (PyDict_Next(umd->u_freevars, &pos, &k, &v)) {
- int offset = _PyLong_AsInt(v);
+ int offset = PyLong_AsInt(v);
if (offset == -1 && PyErr_Occurred()) {
return ERROR;
}
diff --git a/Python/ceval.c b/Python/ceval.c
index 55dfe6b..a56d31e 100644
--- a/Python/ceval.c
+++ b/Python/ceval.c
@@ -2416,7 +2416,7 @@ import_name(PyThreadState *tstate, _PyInterpreterFrame *frame,
/* Fast path for not overloaded __import__. */
if (_PyImport_IsDefaultImportFunc(tstate->interp, import_func)) {
- int ilevel = _PyLong_AsInt(level);
+ int ilevel = PyLong_AsInt(level);
if (ilevel == -1 && _PyErr_Occurred(tstate)) {
return NULL;
}
diff --git a/Python/flowgraph.c b/Python/flowgraph.c
index e620e7c..55b871d 100644
--- a/Python/flowgraph.c
+++ b/Python/flowgraph.c
@@ -2412,13 +2412,13 @@ build_cellfixedoffsets(_PyCompile_CodeUnitMetadata *umd)
continue;
}
- int argoffset = _PyLong_AsInt(varindex);
+ int argoffset = PyLong_AsInt(varindex);
Py_DECREF(varindex);
if (argoffset == -1 && PyErr_Occurred()) {
goto error;
}
- int oldindex = _PyLong_AsInt(cellindex);
+ int oldindex = PyLong_AsInt(cellindex);
if (oldindex == -1 && PyErr_Occurred()) {
goto error;
}
diff --git a/Python/initconfig.c b/Python/initconfig.c
index 39d21ad..3281b3c 100644
--- a/Python/initconfig.c
+++ b/Python/initconfig.c
@@ -1097,7 +1097,7 @@ config_dict_get_int(PyObject *dict, const char *name, int *result)
if (item == NULL) {
return -1;
}
- int value = _PyLong_AsInt(item);
+ int value = PyLong_AsInt(item);
Py_DECREF(item);
if (value == -1 && PyErr_Occurred()) {
if (PyErr_ExceptionMatches(PyExc_TypeError)) {
diff --git a/Python/legacy_tracing.c b/Python/legacy_tracing.c
index 7774d10..17a13b1 100644
--- a/Python/legacy_tracing.c
+++ b/Python/legacy_tracing.c
@@ -256,7 +256,7 @@ sys_trace_line_func(
Py_RETURN_NONE;
}
assert(PyVectorcall_NARGS(nargsf) == 2);
- int line = _PyLong_AsInt(args[1]);
+ int line = PyLong_AsInt(args[1]);
assert(line >= 0);
PyFrameObject *frame = PyEval_GetFrame();
if (frame == NULL) {
@@ -282,9 +282,9 @@ sys_trace_jump_func(
Py_RETURN_NONE;
}
assert(PyVectorcall_NARGS(nargsf) == 3);
- int from = _PyLong_AsInt(args[1])/sizeof(_Py_CODEUNIT);
+ int from = PyLong_AsInt(args[1])/sizeof(_Py_CODEUNIT);
assert(from >= 0);
- int to = _PyLong_AsInt(args[2])/sizeof(_Py_CODEUNIT);
+ int to = PyLong_AsInt(args[2])/sizeof(_Py_CODEUNIT);
assert(to >= 0);
if (to > from) {
/* Forward jump */