pyapi internal api code: check for == -1 rather then < 0, for known error returns.
This commit is contained in:
@@ -388,7 +388,7 @@ static void bpy_prop_boolean_array_get_cb(struct PointerRNA *ptr, struct Propert
|
||||
values[i] = false;
|
||||
}
|
||||
else {
|
||||
if (PyC_AsArray(values, ret, len, &PyBool_Type, false, "BoolVectorProperty get") < 0) {
|
||||
if (PyC_AsArray(values, ret, len, &PyBool_Type, false, "BoolVectorProperty get") == -1) {
|
||||
printf_func_error(py_func);
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
@@ -622,7 +622,7 @@ static void bpy_prop_int_array_get_cb(struct PointerRNA *ptr, struct PropertyRNA
|
||||
values[i] = 0;
|
||||
}
|
||||
else {
|
||||
if (PyC_AsArray(values, ret, len, &PyLong_Type, false, "IntVectorProperty get") < 0) {
|
||||
if (PyC_AsArray(values, ret, len, &PyLong_Type, false, "IntVectorProperty get") == -1) {
|
||||
printf_func_error(py_func);
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
@@ -856,7 +856,7 @@ static void bpy_prop_float_array_get_cb(struct PointerRNA *ptr, struct PropertyR
|
||||
values[i] = 0.0f;
|
||||
}
|
||||
else {
|
||||
if (PyC_AsArray(values, ret, len, &PyFloat_Type, false, "FloatVectorProperty get") < 0) {
|
||||
if (PyC_AsArray(values, ret, len, &PyFloat_Type, false, "FloatVectorProperty get") == -1) {
|
||||
printf_func_error(py_func);
|
||||
|
||||
for (i = 0; i < len; ++i)
|
||||
@@ -1941,7 +1941,7 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pydef && PyC_AsArray(def, pydef, size, &PyBool_Type, false, "BoolVectorProperty(default=sequence)") < 0)
|
||||
if (pydef && PyC_AsArray(def, pydef, size, &PyBool_Type, false, "BoolVectorProperty(default=sequence)") == -1)
|
||||
return NULL;
|
||||
|
||||
if (bpy_prop_callback_check(update_cb, "update", 2) == -1) {
|
||||
@@ -2136,7 +2136,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pydef && PyC_AsArray(def, pydef, size, &PyLong_Type, false, "IntVectorProperty(default=sequence)") < 0)
|
||||
if (pydef && PyC_AsArray(def, pydef, size, &PyLong_Type, false, "IntVectorProperty(default=sequence)") == -1)
|
||||
return NULL;
|
||||
|
||||
if (bpy_prop_callback_check(update_cb, "update", 2) == -1) {
|
||||
@@ -2356,7 +2356,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (pydef && PyC_AsArray(def, pydef, size, &PyFloat_Type, false, "FloatVectorProperty(default=sequence)") < 0)
|
||||
if (pydef && PyC_AsArray(def, pydef, size, &PyFloat_Type, false, "FloatVectorProperty(default=sequence)") == -1)
|
||||
return NULL;
|
||||
|
||||
if (bpy_prop_callback_check(update_cb, "update", 2) == -1) {
|
||||
|
Reference in New Issue
Block a user