Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Modules/_ctypes/_ctypes.c
Original file line number Diff line number Diff line change
Expand Up @@ -5558,14 +5558,12 @@
copy_pointer_to_list_lock_held(PyObject *myself, PyObject *np, Py_ssize_t len,
Py_ssize_t start, Py_ssize_t step)
{
Py_ssize_t i;
size_t cur;
for (cur = start, i = 0; i < len; cur += step, i++) {
for (size_t cur = start, Py_ssize_t i = 0; i < len; cur += step, i++) {

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘i’

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04)

‘i’ undeclared (first use in this function)

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘i’

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-24.04)

‘i’ undeclared (first use in this function)

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘i’

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

‘i’ undeclared (first use in this function)

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘i’

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04)

‘i’ undeclared (first use in this function)

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Cross build Linux

expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘i’

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Cross build Linux

‘i’ undeclared (first use in this function)

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘i’

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-24.04-arm)

‘i’ undeclared (first use in this function)

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘i’

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-24.04-arm)

‘i’ undeclared (first use in this function)

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

syntax error: missing ';' before identifier 'i' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'<': result of expression not used [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

syntax error: missing ')' before ';' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'cur': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'+=': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

syntax error: ')' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

syntax error: missing ';' before identifier 'i' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'<': result of expression not used [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

syntax error: missing ')' before ';' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'cur': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'+=': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

syntax error: ')' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

syntax error: missing ';' before identifier 'i' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'<': result of expression not used [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

syntax error: missing ')' before ';' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'cur': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'+=': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

syntax error: ')' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

syntax error: missing ';' before identifier 'i' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'<': result of expression not used [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

syntax error: missing ')' before ';' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'cur': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check warning on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'+=': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

syntax error: ')' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

syntax error: missing ';' before '{' [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘i’

Check failure on line 5561 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Address sanitizer (ubuntu-24.04)

‘i’ undeclared (first use in this function)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very sorry, my suggestion was not valid C code :-(

You should write it differently, example:

    size_t cur = start;
    for (Py_ssize_t i = 0; i < len; cur += step, i++) { 

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No worries, I didn't catch it either. I'll just revert it and leave the formatting as-is.

PyObject *v = Pointer_item_lock_held(myself, cur);

Check failure on line 5562 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'cur': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5562 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'cur': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5562 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'cur': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5562 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'cur': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]
if (!v) {
return -1;
}
PyList_SET_ITEM(np, i, v);

Check failure on line 5566 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build and test (x64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5566 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build and test (x64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5566 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows / build (arm64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]

Check failure on line 5566 in Modules/_ctypes/_ctypes.c

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / build (arm64)

'i': undeclared identifier [D:\a\cpython\cpython\PCbuild\_ctypes.vcxproj]
}

return 0;
Expand Down
Loading