Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine")
This commit is contained in:
@@ -825,7 +825,8 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject
|
||||
pybuffer.format);
|
||||
}
|
||||
else if (ndimensions != pybuffer.ndim ||
|
||||
!compare_dimensions(ndimensions, dimensions, pybuffer.shape)) {
|
||||
!compare_dimensions(ndimensions, dimensions, pybuffer.shape))
|
||||
{
|
||||
PyErr_Format(PyExc_TypeError, "array size does not match");
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -123,8 +123,8 @@ static PyObject *py_blf_color(PyObject *UNUSED(self), PyObject *args)
|
||||
int fontid;
|
||||
float rgba[4];
|
||||
|
||||
if (!PyArg_ParseTuple(
|
||||
args, "iffff:blf.color", &fontid, &rgba[0], &rgba[1], &rgba[2], &rgba[3])) {
|
||||
if (!PyArg_ParseTuple(args, "iffff:blf.color", &fontid, &rgba[0], &rgba[1], &rgba[2], &rgba[3]))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -361,7 +361,8 @@ static PyObject *py_blf_shadow(PyObject *UNUSED(self), PyObject *args)
|
||||
float rgba[4];
|
||||
|
||||
if (!PyArg_ParseTuple(
|
||||
args, "iiffff:blf.shadow", &fontid, &level, &rgba[0], &rgba[1], &rgba[2], &rgba[3])) {
|
||||
args, "iiffff:blf.shadow", &fontid, &level, &rgba[0], &rgba[1], &rgba[2], &rgba[3]))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -608,7 +608,8 @@ static IDProperty *idp_from_PySequence(const char *name, PyObject *ob)
|
||||
else {
|
||||
const char format = PyC_StructFmt_type_from_str(buffer.format);
|
||||
if (PyC_StructFmt_type_is_float_any(format) ||
|
||||
(PyC_StructFmt_type_is_int_any(format) && buffer.itemsize == 4)) {
|
||||
(PyC_StructFmt_type_is_int_any(format) && buffer.itemsize == 4))
|
||||
{
|
||||
use_buffer = true;
|
||||
}
|
||||
else {
|
||||
@@ -737,7 +738,8 @@ bool BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty *group,
|
||||
* obviously this isn't a complete solution, but helps for common cases. */
|
||||
prop_exist = IDP_GetPropertyFromGroup(group, prop->name);
|
||||
if ((prop_exist != NULL) && (prop_exist->type == prop->type) &&
|
||||
(prop_exist->subtype == prop->subtype)) {
|
||||
(prop_exist->subtype == prop->subtype))
|
||||
{
|
||||
/* Preserve prev/next links!!! See #42593. */
|
||||
prop->prev = prop_exist->prev;
|
||||
prop->next = prop_exist->next;
|
||||
|
||||
@@ -58,7 +58,8 @@ static bool idprop_ui_data_update_base(IDPropertyUIData *ui_data,
|
||||
if (pyrna_enum_value_from_id(rna_enum_property_subtype_items,
|
||||
rna_subtype,
|
||||
&ui_data->rna_subtype,
|
||||
"IDPropertyUIManager.update") == -1) {
|
||||
"IDPropertyUIManager.update") == -1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -88,7 +89,8 @@ static bool idprop_ui_data_update_int_default(IDProperty *idprop,
|
||||
int *new_default_array = (int *)MEM_malloc_arrayN(len, sizeof(int), __func__);
|
||||
if (PyC_AsArray(
|
||||
new_default_array, sizeof(int), default_value, len, &PyLong_Type, "ui_data_update") ==
|
||||
-1) {
|
||||
-1)
|
||||
{
|
||||
MEM_freeN(new_default_array);
|
||||
return false;
|
||||
}
|
||||
@@ -130,7 +132,8 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje
|
||||
&step,
|
||||
&default_value,
|
||||
&rna_subtype,
|
||||
&description)) {
|
||||
&description))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -202,7 +205,8 @@ static bool idprop_ui_data_update_bool_default(IDProperty *idprop,
|
||||
default_value,
|
||||
len,
|
||||
&PyBool_Type,
|
||||
"ui_data_update") == -1) {
|
||||
"ui_data_update") == -1)
|
||||
{
|
||||
MEM_freeN(new_default_array);
|
||||
return false;
|
||||
}
|
||||
@@ -237,7 +241,8 @@ static bool idprop_ui_data_update_bool(IDProperty *idprop, PyObject *args, PyObj
|
||||
(char **)kwlist,
|
||||
&default_value,
|
||||
&rna_subtype,
|
||||
&description)) {
|
||||
&description))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -285,7 +290,8 @@ static bool idprop_ui_data_update_float_default(IDProperty *idprop,
|
||||
default_value,
|
||||
len,
|
||||
&PyFloat_Type,
|
||||
"ui_data_update") == -1) {
|
||||
"ui_data_update") == -1)
|
||||
{
|
||||
MEM_freeN(new_default_array);
|
||||
return false;
|
||||
}
|
||||
@@ -337,7 +343,8 @@ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyOb
|
||||
&precision,
|
||||
&default_value,
|
||||
&rna_subtype,
|
||||
&description)) {
|
||||
&description))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -406,7 +413,8 @@ static bool idprop_ui_data_update_string(IDProperty *idprop, PyObject *args, PyO
|
||||
(char **)kwlist,
|
||||
&default_value,
|
||||
&rna_subtype,
|
||||
&description)) {
|
||||
&description))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -438,7 +446,8 @@ static bool idprop_ui_data_update_id(IDProperty *idprop, PyObject *args, PyObjec
|
||||
const char *description = NULL;
|
||||
const char *kwlist[] = {"subtype", "description", NULL};
|
||||
if (!PyArg_ParseTupleAndKeywords(
|
||||
args, kwargs, "|$zz:update", (char **)kwlist, &rna_subtype, &description)) {
|
||||
args, kwargs, "|$zz:update", (char **)kwlist, &rna_subtype, &description))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,8 @@ static PyObject *py_imbuf_resize(Py_ImBuf *self, PyObject *args, PyObject *kw)
|
||||
0,
|
||||
};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser, &size[0], &size[1], PyC_ParseStringEnum, &method)) {
|
||||
args, kw, &_parser, &size[0], &size[1], PyC_ParseStringEnum, &method))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
if (size[0] <= 0 || size[1] <= 0) {
|
||||
@@ -145,7 +146,8 @@ static PyObject *py_imbuf_crop(Py_ImBuf *self, PyObject *args, PyObject *kw)
|
||||
0,
|
||||
};
|
||||
if (!_PyArg_ParseTupleAndKeywordsFast(
|
||||
args, kw, &_parser, &crop.xmin, &crop.ymin, &crop.xmax, &crop.ymax)) {
|
||||
args, kw, &_parser, &crop.xmin, &crop.ymin, &crop.xmax, &crop.ymax))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -156,7 +158,8 @@ static PyObject *py_imbuf_crop(Py_ImBuf *self, PyObject *args, PyObject *kw)
|
||||
/* X order. */
|
||||
!(crop.xmin <= crop.xmax) ||
|
||||
/* Y order. */
|
||||
!(crop.ymin <= crop.ymax)) {
|
||||
!(crop.ymin <= crop.ymax))
|
||||
{
|
||||
PyErr_SetString(PyExc_ValueError, "ImBuf crop min/max not in range");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -200,7 +200,8 @@ int pyrna_enum_value_parse_string(PyObject *o, void *p)
|
||||
}
|
||||
struct BPy_EnumProperty_Parse *parse_data = p;
|
||||
if (pyrna_enum_value_from_id(
|
||||
parse_data->items, identifier, &parse_data->value, "enum identifier") == -1) {
|
||||
parse_data->items, identifier, &parse_data->value, "enum identifier") == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -218,7 +219,8 @@ int pyrna_enum_bitfield_parse_set(PyObject *o, void *p)
|
||||
|
||||
struct BPy_EnumProperty_Parse *parse_data = p;
|
||||
if (pyrna_enum_bitfield_from_set(
|
||||
parse_data->items, o, &parse_data->value, "enum identifier set") == -1) {
|
||||
parse_data->items, o, &parse_data->value, "enum identifier set") == -1)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
parse_data->value_orig = o;
|
||||
|
||||
@@ -214,8 +214,8 @@ static int PyC_AsArray_Multi_FAST_impl(void **array_p,
|
||||
const int length = dims[0];
|
||||
|
||||
if (dims_len == 1) {
|
||||
if (PyC_AsArray_FAST(*array_p, array_item_size, value_fast, length, type, error_prefix) ==
|
||||
-1) {
|
||||
if (PyC_AsArray_FAST(*array_p, array_item_size, value_fast, length, type, error_prefix) == -1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
*array_p = POINTER_OFFSET(*array_p, array_item_size * length);
|
||||
@@ -241,7 +241,8 @@ static int PyC_AsArray_Multi_FAST_impl(void **array_p,
|
||||
dims_next,
|
||||
dims_next_len,
|
||||
type,
|
||||
error_prefix) == -1) {
|
||||
error_prefix) == -1)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
@@ -1309,7 +1310,8 @@ void *PyC_RNA_AsPointer(PyObject *value, const char *type_name)
|
||||
|
||||
if (STREQ(Py_TYPE(value)->tp_name, type_name) &&
|
||||
(as_pointer = PyObject_GetAttrString(value, "as_pointer")) != NULL &&
|
||||
PyCallable_Check(as_pointer)) {
|
||||
PyCallable_Check(as_pointer))
|
||||
{
|
||||
void *result = NULL;
|
||||
|
||||
/* must be a 'type_name' object */
|
||||
|
||||
Reference in New Issue
Block a user