Repository navigation
MAINT: Push down declarations in _convert_from_* - #15288
Conversation
This makes it easier to reason about which variables contain mutable state. C99 makes some of this possible, while other parts were already possible.
This makes it easier to reason about which variables contain mutable state. C99 makes some of this possible, while other parts were already possible.
This makes it easier to reason about which variables contain mutable state. C99 makes some of this possible, while other parts were already possible.
Note that in order to not reference a declaration after `goto`ing past it, one DECREF moved out of `fail` and inline.
seberg
left a comment
There was a problem hiding this comment.
Clear enough some small comment. Only real issue is the fail labels doing XDECREF on some of these, so they need to be NULL initialized, and thus remain at the top.
| goto fail; | ||
| } | ||
| offset = PyArray_PyIntAsInt(off); | ||
| long offset = PyArray_PyIntAsInt(off); |
There was a problem hiding this comment.
| long offset = PyArray_PyIntAsInt(off); | |
| int offset = PyArray_PyIntAsInt(off); |
There was a problem hiding this comment.
Would rather not fix that type of thing in this patch - offset was declared long before I moved the declaration, so I'd like this commit to not change its type.
There was a problem hiding this comment.
Fine, I had missed that it was long, because I remembered that the top of the function everything was int.
There was a problem hiding this comment.
... which is exactly the type of mistake I'm trying to avoid making myself by moving the types down to where they're used :)
|
OK, sorry for the noise. Let me put this in as is then and leave that weird |
No description provided.