diff options
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_app_handlers.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app_translations.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_driver.c | 10 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_gizmo_wrap.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 6 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface_atexit.c | 5 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_msgbus.c | 8 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 10 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 6 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 63 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_anim.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_array.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna_gizmo.c | 4 |
13 files changed, 65 insertions, 61 deletions
diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index bc05c51414f..7c5c1122aea 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -347,7 +347,7 @@ void bpy_app_generic_callback(struct Main *UNUSED(main), } /* Iterate the list and run the callbacks - * note: don't store the list size since the scripts may remove themselves */ + * NOTE: don't store the list size since the scripts may remove themselves. */ for (pos = 0; pos < PyList_GET_SIZE(cb_list); pos++) { func = PyList_GET_ITEM(cb_list, pos); PyObject *args = choose_arguments(func, args_all, args_single); diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c index 478ae61aecd..7437598582f 100644 --- a/source/blender/python/intern/bpy_app_translations.c +++ b/source/blender/python/intern/bpy_app_translations.c @@ -101,7 +101,7 @@ static bool _ghashutil_keycmp(const void *a, const void *b) const GHashKey *A = a; const GHashKey *B = b; - /* Note: comparing msgid first, most of the time it will be enough! */ + /* NOTE: comparing msgid first, most of the time it will be enough! */ if (BLI_ghashutil_strcmp(A->msgid, B->msgid) == false) { return BLI_ghashutil_strcmp(A->msgctxt, B->msgctxt); } @@ -497,7 +497,7 @@ static PyObject *app_translations_locale_get(PyObject *UNUSED(self), void *UNUSE return PyUnicode_FromString(BLT_lang_get()); } -/* Note: defining as getter, as (even if quite unlikely), this *may* change during runtime... */ +/* NOTE: defining as getter, as (even if quite unlikely), this *may* change during runtime... */ PyDoc_STRVAR(app_translations_locales_doc, "All locales currently known by Blender (i.e. available as translations)."); static PyObject *app_translations_locales_get(PyObject *UNUSED(self), void *UNUSED(userdata)) diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index a7b99f211c2..7effa25e6e8 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -175,7 +175,7 @@ int bpy_pydriver_create_dict(void) return 0; } -/* note, this function should do nothing most runs, only when changing frame */ +/* NOTE: this function should do nothing most runs, only when changing frame. */ /* not thread safe but neither is python */ static struct { float evaltime; @@ -266,7 +266,7 @@ static void pydriver_error(ChannelDriver *driver) "\nError in Driver: The following Python expression failed:\n\t'%s'\n\n", driver->expression); - // BPy_errors_to_report(NULL); /* TODO - reports */ + // BPy_errors_to_report(NULL); /* TODO: reports. */ PyErr_Print(); PyErr_Clear(); } @@ -433,12 +433,12 @@ static void bpy_pydriver_namespace_add_depsgraph(PyObject *driver_vars, * This evaluates Python driver expressions, `driver_orig->expression` * is a Python expression that should evaluate to a float number, which is returned. * - * (old)note: PyGILState_Ensure() isn't always called because python can call + * (old) NOTE: PyGILState_Ensure() isn't always called because python can call * the bake operator which intern starts a thread which calls scene update * which does a driver update. to avoid a deadlock check #PyC_IsInterpreterActive() * if #PyGILState_Ensure() is needed, see T27683. * - * (new)note: checking if python is running is not thread-safe T28114 + * (new) NOTE: checking if python is running is not thread-safe T28114 * now release the GIL on python operator execution instead, using * #PyEval_SaveThread() / #PyEval_RestoreThread() so we don't lock up blender. * @@ -613,7 +613,7 @@ float BPY_driver_exec(struct PathResolvedRNA *anim_rna, fprintf( stderr, "\tBPY_driver_eval() - couldn't add variable '%s' to namespace\n", dvar->name); - // BPy_errors_to_report(NULL); /* TODO - reports */ + // BPy_errors_to_report(NULL); /* TODO: reports. */ PyErr_Print(); PyErr_Clear(); } diff --git a/source/blender/python/intern/bpy_gizmo_wrap.c b/source/blender/python/intern/bpy_gizmo_wrap.c index 686a4d88266..34d2ba16e69 100644 --- a/source/blender/python/intern/bpy_gizmo_wrap.c +++ b/source/blender/python/intern/bpy_gizmo_wrap.c @@ -49,7 +49,7 @@ static bool bpy_gizmotype_target_property_def(wmGizmoType *gzt, PyObject *item) { - /* Note: names based on 'rna_rna.c' */ + /* NOTE: names based on `rna_rna.c`. */ PyObject *empty_tuple = PyTuple_New(0); struct { diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 832af9e8460..f91ba4d362c 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -154,7 +154,7 @@ void bpy_context_clear(bContext *UNUSED(C), const PyGILState_STATE *gilstate) fprintf(stderr, "ERROR: Python context internal state bug. this should not happen!\n"); } else if (py_call_level == 0) { - /* XXX - Calling classes currently won't store the context :\, + /* XXX: Calling classes currently won't store the context :\, * can't set NULL because of this. but this is very flakey still. */ #if 0 BPY_context_set(NULL); @@ -763,7 +763,7 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult * } #ifdef WITH_PYTHON_MODULE -/* TODO, reloading the module isn't functional at the moment. */ +/* TODO: reloading the module isn't functional at the moment. */ static void bpy_module_free(void *mod); @@ -825,7 +825,7 @@ static void dealloc_obj_dealloc(PyObject *self) { bpy_module_delay_init(((dealloc_obj *)self)->mod); - /* Note, for subclassed PyObjects we can't just call PyObject_DEL() directly or it will crash */ + /* NOTE: for subclassed PyObjects we can't just call PyObject_DEL() directly or it will crash. */ dealloc_obj_Type.tp_free(self); } diff --git a/source/blender/python/intern/bpy_interface_atexit.c b/source/blender/python/intern/bpy_interface_atexit.c index 03d51b2fd59..f92a48eb597 100644 --- a/source/blender/python/intern/bpy_interface_atexit.c +++ b/source/blender/python/intern/bpy_interface_atexit.c @@ -46,9 +46,8 @@ static PyObject *func_bpy_atregister = NULL; /* borrowed reference, `atexit` hol static void atexit_func_call(const char *func_name, PyObject *atexit_func_arg) { - /* note - no error checking, if any of these fail we'll get a crash - * this is intended, but if its problematic it could be changed - * - campbell */ + /* NOTE(campbell): no error checking, if any of these fail we'll get a crash + * this is intended, but if its problematic it could be changed. */ PyObject *atexit_mod = PyImport_ImportModuleLevel("atexit", NULL, NULL, NULL, 0); PyObject *atexit_func = PyObject_GetAttrString(atexit_mod, func_name); diff --git a/source/blender/python/intern/bpy_msgbus.c b/source/blender/python/intern/bpy_msgbus.c index 4e6d2aacb49..04220cf3105 100644 --- a/source/blender/python/intern/bpy_msgbus.c +++ b/source/blender/python/intern/bpy_msgbus.c @@ -90,12 +90,12 @@ static int py_msgbus_rna_key_from_py(PyObject *py_sub, msg_key_params->prop = data_prop->prop; } else if (BPy_StructRNA_Check(py_sub)) { - /* note, this isn't typically used since we don't edit structs directly. */ + /* NOTE: this isn't typically used since we don't edit structs directly. */ BPy_StructRNA *data_srna = (BPy_StructRNA *)py_sub; PYRNA_STRUCT_CHECK_INT(data_srna); msg_key_params->ptr = data_srna->ptr; } - /* TODO - property / type, not instance. */ + /* TODO: property / type, not instance. */ else if (PyType_Check(py_sub)) { StructRNA *data_type = pyrna_struct_as_srna(py_sub, false, error_prefix); if (data_type == NULL) { @@ -264,7 +264,7 @@ static PyObject *bpy_msgbus_subscribe_rna(PyObject *UNUSED(self), PyObject *args return NULL; } - /* Note: we may want to have a way to pass this in. */ + /* NOTE: we may want to have a way to pass this in. */ bContext *C = BPY_context_get(); struct wmMsgBus *mbus = CTX_wm_message_bus(C); wmMsgParams_RNA msg_key_params = {{0}}; @@ -339,7 +339,7 @@ static PyObject *bpy_msgbus_publish_rna(PyObject *UNUSED(self), PyObject *args, return NULL; } - /* Note: we may want to have a way to pass this in. */ + /* NOTE: we may want to have a way to pass this in. */ bContext *C = BPY_context_get(); struct wmMsgBus *mbus = CTX_wm_message_bus(C); wmMsgParams_RNA msg_key_params = {{0}}; diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index 055dd624ea8..9ee9f2e477f 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -82,8 +82,8 @@ static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args) int context = WM_OP_EXEC_DEFAULT; - /* XXX Todo, work out a better solution for passing on context, - * could make a tuple from self and pack the name and Context into it... */ + /* XXX TODO: work out a better solution for passing on context, + * could make a tuple from self and pack the name and Context into it. */ bContext *C = BPY_context_get(); if (C == NULL) { @@ -169,8 +169,8 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) int context = WM_OP_EXEC_DEFAULT; int is_undo = false; - /* XXX Todo, work out a better solution for passing on context, - * could make a tuple from self and pack the name and Context into it... */ + /* XXX TODO: work out a better solution for passing on context, + * could make a tuple from self and pack the name and Context into it. */ bContext *C = BPY_context_get(); if (C == NULL) { @@ -276,7 +276,7 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) #ifdef BPY_RELEASE_GIL /* release GIL, since a thread could be started from an operator * that updates a driver */ - /* note: I have not seen any examples of code that does this + /* NOTE: I have not seen any examples of code that does this * so it may not be officially supported but seems to work ok. */ { PyThreadState *ts = PyEval_SaveThread(); diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 0d451a8dd7f..14e25e02d84 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -1784,7 +1784,7 @@ static const EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, (tmp.identifier = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) && (tmp.name = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) && (tmp.description = PyUnicode_AsUTF8AndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) && - /* TODO, number isn't ensured to be unique from the script author */ + /* TODO: number isn't ensured to be unique from the script author. */ (item_size != 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value)) && (item_size != 5 || ((py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.icon) || (tmp_icon = PyUnicode_AsUTF8(PyTuple_GET_ITEM(item, 3)))) && @@ -3509,7 +3509,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) if (def) { /* Only support getting integer default values here. */ if (!py_long_as_int(def, &defvalue)) { - /* note, using type error here is odd but python does this for invalid arguments */ + /* NOTE: using type error here is odd but python does this for invalid arguments. */ PyErr_SetString( PyExc_TypeError, "EnumProperty(...): 'default' can only be an integer when 'items' is a function"); @@ -3557,7 +3557,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) RNA_def_property_duplicate_pointers(srna, prop); if (is_itemf == false) { - /* note: this must be postponed until after #RNA_def_property_duplicate_pointers + /* NOTE: this must be postponed until after #RNA_def_property_duplicate_pointers * otherwise if this is a generator it may free the strings before we copy them */ Py_DECREF(items_fast); diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index a3c5d4e9d66..e6479df2fa8 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -734,12 +734,12 @@ PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop) const short order = pyrna_rotation_euler_order_get( ptr, EULER_ORDER_XYZ, &prop_eul_order); - ret = Euler_CreatePyObject(NULL, order, NULL); /* TODO, get order from RNA. */ + ret = Euler_CreatePyObject(NULL, order, NULL); /* TODO: get order from RNA. */ RNA_property_float_get_array(ptr, prop, ((EulerObject *)ret)->eul); } else { /* Order will be updated from callback on use. */ - /* TODO, get order from RNA. */ + /* TODO: get order from RNA. */ PyObject *eul_cb = Euler_CreatePyObject_cb( ret, EULER_ORDER_XYZ, mathutils_rna_array_cb_index, MATHUTILS_CB_SUBTYPE_EUL); Py_DECREF(ret); /* The euler owns 'ret' now. */ @@ -817,7 +817,7 @@ int pyrna_enum_value_from_id(const EnumPropertyItem *item, return 0; } -/* note on __cmp__: +/* NOTE(campbell): Regarding comparison `__cmp__`: * checking the 'ptr->data' matches works in almost all cases, * however there are a few RNA properties that are fake sub-structs and * share the pointer with the parent, in those cases this happens 'a.b == a' @@ -825,8 +825,7 @@ int pyrna_enum_value_from_id(const EnumPropertyItem *item, * * So compare the 'ptr->type' as well to avoid this problem. * It's highly unlikely this would happen that 'ptr->data' and 'ptr->prop' would match, - * but _not_ 'ptr->type' but include this check for completeness. - * - campbell */ + * but _not_ 'ptr->type' but include this check for completeness. */ static int pyrna_struct_compare(BPy_StructRNA *a, BPy_StructRNA *b) { @@ -1196,7 +1195,7 @@ static void pyrna_struct_dealloc(BPy_StructRNA *self) } #endif /* !USE_PYRNA_STRUCT_REFERENCE */ - /* Note, for subclassed PyObjects calling PyObject_DEL() directly crashes. */ + /* NOTE: for subclassed PyObjects calling PyObject_DEL() directly crashes. */ Py_TYPE(self)->tp_free(self); } @@ -1225,7 +1224,7 @@ static void pyrna_prop_dealloc(BPy_PropertyRNA *self) PyObject_ClearWeakRefs((PyObject *)self); } #endif - /* Note, for subclassed PyObjects calling PyObject_DEL() directly crashes. */ + /* NOTE: for subclassed PyObjects calling PyObject_DEL() directly crashes. */ Py_TYPE(self)->tp_free(self); } @@ -1236,7 +1235,7 @@ static void pyrna_prop_array_dealloc(BPy_PropertyRNA *self) PyObject_ClearWeakRefs((PyObject *)self); } #endif - /* Note, for subclassed PyObjects calling PyObject_DEL() directly crashes. */ + /* NOTE: for subclassed PyObjects calling PyObject_DEL() directly crashes. */ Py_TYPE(self)->tp_free(self); } @@ -1879,7 +1878,7 @@ static int pyrna_py_to_prop( #ifdef USE_STRING_COERCE PyObject *value_coerce = NULL; if (ELEM(subtype, PROP_FILEPATH, PROP_DIRPATH, PROP_FILENAME)) { - /* TODO, get size. */ + /* TODO: get size. */ param = PyC_UnicodeAsByte(value, &value_coerce); } else { @@ -2640,7 +2639,7 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, } /** - * TODO - dimensions + * TODO: dimensions * \note Could also use pyrna_prop_array_to_py_index(self, count) in a loop, but it's much slower * since at the moment it reads (and even allocates) the entire array for each index. */ @@ -2853,7 +2852,7 @@ static int pyrna_prop_collection_type_check(BPy_PropertyRNA *self, PyObject *val return -1; } -/* note: currently this is a copy of 'pyrna_prop_collection_subscript' with +/* NOTE: currently this is a copy of 'pyrna_prop_collection_subscript' with * large blocks commented, we may support slice/key indices later */ static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, PyObject *key, @@ -2884,7 +2883,7 @@ static int pyrna_prop_collection_ass_subscript(BPy_PropertyRNA *self, return pyrna_prop_collection_ass_subscript_int(self, i, value); } -#if 0 /* TODO, fake slice assignment. */ +#if 0 /* TODO: fake slice assignment. */ else if (PySlice_Check(key)) { PySliceObject *key_slice = (PySliceObject *)key; Py_ssize_t step = 1; @@ -2967,7 +2966,7 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject return NULL; } if (key_slice->start == Py_None && key_slice->stop == Py_None) { - /* Note: no significant advantage with optimizing [:] slice as with collections, + /* NOTE: no significant advantage with optimizing [:] slice as with collections, * but include here for consistency with collection slice func */ const 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); @@ -4113,7 +4112,7 @@ static PyObject *pyrna_struct_bl_rna_get_subclass(PyObject *cls, PyObject *args) } } else { - /* TODO, panels, menus etc. */ + /* TODO: panels, menus etc. */ PyErr_Format( PyExc_ValueError, "Class type \"%.200s\" not supported", RNA_struct_identifier(srna_base)); return NULL; @@ -5183,7 +5182,7 @@ static int foreach_parse_args(BPy_PropertyRNA *self, return -1; } - /* TODO - buffer may not be a sequence! array.array() is though. */ + /* TODO: buffer may not be a sequence! array.array() is though. */ *r_tot = PySequence_Size(*r_seq); if (*r_tot > 0) { @@ -5357,7 +5356,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set) Py_buffer buf; PyObject_GetBuffer(seq, &buf, PyBUF_SIMPLE | PyBUF_FORMAT); - /* Check if the buffer matches, TODO - signed/unsigned types. */ + /* Check if the buffer matches, TODO: signed/unsigned types. */ buffer_is_compat = foreach_compat_buffer(raw_type, attr_signed, buf.format); @@ -5817,8 +5816,10 @@ static struct PyMethodDef pyrna_prop_collection_idprop_methods[] = { {NULL, NULL, 0, NULL}, }; -/* only needed for subtyping, so a new class gets a valid BPy_StructRNA - * todo - also accept useful args */ +/** + * only needed for sub-typing, so a new class gets a valid #BPy_StructRNA + * TODO: also accept useful args. + */ static PyObject *pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) { if (PyTuple_GET_SIZE(args) == 1) { @@ -5865,8 +5866,10 @@ static PyObject *pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject * return NULL; } -/* only needed for subtyping, so a new class gets a valid BPy_StructRNA - * todo - also accept useful args */ +/** + * Only needed for sub-typing, so a new class gets a valid #BPy_StructRNA + * TODO: also accept useful args. + */ static PyObject *pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) { BPy_PropertyRNA *base; @@ -6025,7 +6028,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat RNA_id_pointer_create(*(void **)data, &newptr); } else { - /* note: this is taken from the function's ID pointer + /* NOTE: this is taken from the function's ID pointer * and will break if a function returns a pointer from * another ID block, watch this! - it should at least be * easy to debug since they are all ID's */ @@ -6088,7 +6091,7 @@ static PyObject *small_dict_get_item_string(PyObject *dict, const char *key_look static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject *kw) { - /* Note, both BPy_StructRNA and BPy_PropertyRNA can be used here. */ + /* NOTE: both BPy_StructRNA and BPy_PropertyRNA can be used here. */ PointerRNA *self_ptr = &self->ptr; FunctionRNA *self_func = self->func; @@ -6436,11 +6439,11 @@ static PyObject *pyrna_func_doc_get(BPy_FunctionRNA *self, void *UNUSED(closure) } /* Subclasses of pyrna_struct_Type which support idprop definitions use this as a metaclass. */ -/* note: tp_base member is set to &PyType_Type on init */ +/* NOTE: tp_base member is set to &PyType_Type on init. */ PyTypeObject pyrna_struct_meta_idprop_Type = { PyVarObject_HEAD_INIT(NULL, 0) "bpy_struct_meta_idprop", /* tp_name */ - /* NOTE! 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 */ @@ -7216,7 +7219,7 @@ static void pyrna_subtype_set_rna(PyObject *newclass, StructRNA *srna) RNA_pointer_create(NULL, &RNA_Struct, srna, &ptr); item = pyrna_struct_CreatePyObject(&ptr); - /* Note, must set the class not the __dict__ else the internal slots are not updated correctly. + /* NOTE: must set the class not the __dict__ else the internal slots are not updated correctly. */ PyObject_SetAttr(newclass, bpy_intern_str_bl_rna, item); Py_DECREF(item); @@ -7433,7 +7436,9 @@ static PyObject *pyrna_srna_Subtype(StructRNA *srna) return newclass; } -/* Use for subtyping so we know which srna is used for a PointerRNA. */ +/** + * Use for sub-typing so we know which SRNA is used for a #PointerRNA. + */ static StructRNA *srna_from_ptr(PointerRNA *ptr) { if (ptr->type == &RNA_Struct) { @@ -7454,7 +7459,7 @@ PyObject *pyrna_struct_CreatePyObject(PointerRNA *ptr) { BPy_StructRNA *pyrna = NULL; - /* Note: don't rely on this to return None since NULL data with a valid type can often crash. */ + /* NOTE: don't rely on this to return None since NULL data with a valid type can often crash. */ if (ptr->data == NULL && ptr->type == NULL) { /* Operator RNA has NULL data. */ Py_RETURN_NONE; } @@ -8367,7 +8372,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun return bpy_class_validate_recursive(dummyptr, dummyptr->type, py_data, have_function); } -/* TODO - multiple return values like with RNA functions. */ +/* TODO: multiple return values like with RNA functions. */ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) { PyObject *args; @@ -8772,7 +8777,7 @@ void pyrna_free_types(void) void *py_ptr = RNA_struct_py_type_get(srna); if (py_ptr) { -#if 0 /* XXX - should be able to do this, but makes Python crash on exit. */ +#if 0 /* XXX: should be able to do this, but makes Python crash on exit. */ bpy_class_free(py_ptr); #endif RNA_struct_py_type_set(srna, NULL); diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index b359e93315e..9745f39b6b8 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -240,7 +240,7 @@ static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *pyoptions = NULL; const char *path; - /* note, parse_str MUST start with 's|ifsO!' */ + /* NOTE: `parse_str` MUST start with `s|ifsO!`. */ if (!PyArg_ParseTupleAndKeywords(args, kw, parse_str, diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index aafc787b6fc..abbc332d89d 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -548,7 +548,7 @@ static int py_to_array(PyObject *seq, } if (totitem) { - /* note: this code is confusing */ + /* NOTE: this code is confusing. */ if (param_data && RNA_property_flag(prop) & PROP_DYNAMIC) { /* not freeing allocated mem, RNA_parameter_list_free() will do this */ ParameterDynAlloc *param_alloc = (ParameterDynAlloc *)param_data; @@ -990,7 +990,7 @@ PyObject *pyrna_py_from_array(PointerRNA *ptr, PropertyRNA *prop) return pyrna_prop_CreatePyObject(ptr, prop); } -/* TODO, multi-dimensional arrays */ +/* TODO: multi-dimensional arrays. */ int pyrna_array_contains_py(PointerRNA *ptr, PropertyRNA *prop, PyObject *value) { const int len = RNA_property_array_length(ptr, prop); diff --git a/source/blender/python/intern/bpy_rna_gizmo.c b/source/blender/python/intern/bpy_rna_gizmo.c index 1f27e4bcca8..869019692df 100644 --- a/source/blender/python/intern/bpy_rna_gizmo.c +++ b/source/blender/python/intern/bpy_rna_gizmo.c @@ -246,7 +246,7 @@ static PyObject *bpy_gizmo_target_set_handler(PyObject *UNUSED(self), PyObject * .py_fn_slots = {NULL}, }; - /* Note: this is a counter-part to functions: + /* NOTE: this is a counter-part to functions: * 'Gizmo.target_set_prop & target_set_operator' * (see: rna_wm_gizmo_api.c). conventions should match. */ static const char *const _keywords[] = {"self", "target", "get", "set", "range", NULL}; @@ -537,7 +537,7 @@ bool BPY_rna_gizmo_module(PyObject *mod_par) PyObject *func_inst = PyInstanceMethod_New(func); char name_prefix[128]; PyOS_snprintf(name_prefix, sizeof(name_prefix), "_rna_gizmo_%s", m->ml_name); - /* TODO, return a type that binds nearly to a method. */ + /* TODO: return a type that binds nearly to a method. */ PyModule_AddObject(mod_par, name_prefix, func_inst); } |