Fix invalid function signatures for PySequenceMethods callbacks
Function casts hid casting between potentially incompatible type signatures (using int instead of Py_ssize_t). As it happens this seems not to have caused any bugs on supported platforms so this change is mainly for correctness and to avoid problems in the future.
This commit is contained in:
@@ -3118,7 +3118,7 @@ static Py_ssize_t bpy_bmelemseq_length(BPy_BMElemSeq *self)
|
||||
}
|
||||
}
|
||||
|
||||
static PyObject *bpy_bmelemseq_subscript_int(BPy_BMElemSeq *self, int keynum)
|
||||
static PyObject *bpy_bmelemseq_subscript_int(BPy_BMElemSeq *self, Py_ssize_t keynum)
|
||||
{
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
|
||||
|
||||
@@ -740,7 +740,8 @@ static PyObject *bpy_bmlayercollection_subscript_str(BPy_BMLayerCollection *self
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static PyObject *bpy_bmlayercollection_subscript_int(BPy_BMLayerCollection *self, int keynum)
|
||||
static PyObject *bpy_bmlayercollection_subscript_int(BPy_BMLayerCollection *self,
|
||||
Py_ssize_t keynum)
|
||||
{
|
||||
Py_ssize_t len;
|
||||
BPY_BM_CHECK_OBJ(self);
|
||||
|
||||
@@ -391,7 +391,7 @@ typedef struct BPy_BMDeformVert {
|
||||
/* Mapping Protocols
|
||||
* ================= */
|
||||
|
||||
static int bpy_bmdeformvert_len(BPy_BMDeformVert *self)
|
||||
static Py_ssize_t bpy_bmdeformvert_len(BPy_BMDeformVert *self)
|
||||
{
|
||||
return self->data->totweight;
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ static Py_ssize_t bpy_bmeditselseq_length(BPy_BMEditSelSeq *self)
|
||||
return BLI_listbase_count(&self->bm->selected);
|
||||
}
|
||||
|
||||
static PyObject *bpy_bmeditselseq_subscript_int(BPy_BMEditSelSeq *self, int keynum)
|
||||
static PyObject *bpy_bmeditselseq_subscript_int(BPy_BMEditSelSeq *self, Py_ssize_t keynum)
|
||||
{
|
||||
BMEditSelection *ese;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user