diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-02-05 06:04:26 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-02-05 06:04:26 +0400 |
commit | 4acab3eb33db20eef89d0159199429c690b0f2df (patch) | |
tree | e3a8f567c4f065d5a34b486b5e6a9b8c049c4d56 /source/blender/python/intern | |
parent | 5c395b69f55560e20c4c1f3e972b8e0759c647c2 (diff) |
Code Cleanup: line length and use Py_ssize_t for PyC_AsArray utility function.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_operator_wrap.c | 8 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 26 |
2 files changed, 25 insertions, 9 deletions
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 7860762059c..39780e7e257 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -112,7 +112,9 @@ PyObject *PYOP_wrap_macro_define(PyObject *UNUSED(self), PyObject *args) return NULL; if (WM_operatortype_find(opname, TRUE) == NULL) { - PyErr_Format(PyExc_ValueError, "Macro Define: '%s' is not a valid operator id", opname); + PyErr_Format(PyExc_ValueError, + "Macro Define: '%s' is not a valid operator id", + opname); return NULL; } @@ -123,7 +125,9 @@ PyObject *PYOP_wrap_macro_define(PyObject *UNUSED(self), PyObject *args) ot = WM_operatortype_find(macroname, TRUE); if (!ot) { - PyErr_Format(PyExc_ValueError, "Macro Define: '%s' is not a valid macro or hasn't been registered yet", macroname); + PyErr_Format(PyExc_ValueError, + "Macro Define: '%s' is not a valid macro or hasn't been registered yet", + macroname); return NULL; } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 11e79fdee2a..fa2a20a10e6 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2571,7 +2571,8 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject return NULL; } else if (key_slice->start == Py_None && key_slice->stop == Py_None) { - /* note, no significant advantage with optimizing [:] slice as with collections but include here for consistency with collection slice func */ + /* note, no significant advantage with optimizing [:] slice as with collections + * but include here for consistency with collection slice func */ Py_ssize_t len = (Py_ssize_t)pyrna_prop_array_length(self); return pyrna_prop_array_subscript_slice(self, &self->ptr, self->prop, 0, len, len); } @@ -2834,7 +2835,8 @@ static int pyrna_prop_collection_contains(BPy_PropertyRNA *self, PyObject *key) const char *keyname = _PyUnicode_AsString(key); if (keyname == NULL) { - PyErr_SetString(PyExc_TypeError, "bpy_prop_collection.__contains__: expected a string or a typle of strings"); + PyErr_SetString(PyExc_TypeError, + "bpy_prop_collection.__contains__: expected a string or a typle of strings"); return -1; } @@ -5102,7 +5104,14 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject #ifdef DEBUG_STRING_FREE - // if (PyList_GET_SIZE(string_free_ls)) printf("%.200s.%.200s(): has %d strings\n", RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), (int)PyList_GET_SIZE(string_free_ls)); + /* + if (PyList_GET_SIZE(string_free_ls)) { + printf("%.200s.%.200s(): has %d strings\n", + RNA_struct_identifier(self_ptr->type), + RNA_function_identifier(self_func), + (int)PyList_GET_SIZE(string_free_ls)); + } + */ Py_DECREF(string_free_ls); #undef DEBUG_STRING_FREE #endif @@ -5126,7 +5135,10 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject PyTypeObject pyrna_struct_meta_idprop_Type = { PyVarObject_HEAD_INIT(NULL, 0) "bpy_struct_meta_idprop", /* tp_name */ - sizeof(PyHeapTypeObject), /* tp_basicsize */ // XXX, would be PyTypeObject, but subtypes of Type must be PyHeapTypeObject's + + /* NOTE! would be PyTypeObject, but subtypes of Type must be PyHeapTypeObject's */ + sizeof(PyHeapTypeObject), /* tp_basicsize */ + 0, /* tp_itemsize */ /* methods */ NULL, /* tp_dealloc */ @@ -5380,16 +5392,16 @@ PyTypeObject pyrna_prop_Type = { PyTypeObject pyrna_prop_array_Type = { PyVarObject_HEAD_INIT(NULL, 0) - "bpy_prop_array", /* tp_name */ + "bpy_prop_array", /* tp_name */ sizeof(BPy_PropertyArrayRNA), /* tp_basicsize */ - 0, /* tp_itemsize */ + 0, /* tp_itemsize */ /* methods */ (destructor)pyrna_prop_array_dealloc, /* tp_dealloc */ NULL, /* printfunc tp_print; */ NULL, /* getattrfunc tp_getattr; */ NULL, /* setattrfunc tp_setattr; */ NULL, /* tp_compare */ /* DEPRECATED in python 3.0! */ - NULL,/* subclassed */ /* tp_repr */ + NULL,/* subclassed */ /* tp_repr */ /* Method suites for standard classes */ |