From 2abfcebb0eb7989e3d1e7d03f37ecf5c088210af Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 10 Oct 2020 18:19:55 +1100 Subject: Cleanup: use C comments for descriptive text Follow our code style guide by using C-comments for text descriptions. --- source/blender/python/intern/bpy.c | 2 +- source/blender/python/intern/bpy_app_ffmpeg.c | 2 +- source/blender/python/intern/bpy_app_sdl.c | 4 ++-- source/blender/python/intern/bpy_driver.c | 4 ++-- source/blender/python/intern/bpy_interface.c | 2 +- source/blender/python/intern/bpy_rna.c | 9 ++++++--- 6 files changed, 13 insertions(+), 10 deletions(-) (limited to 'source/blender/python/intern') diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index a4a73d2aa75..75314e4e2ea 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -147,7 +147,7 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec return list; } -// PyDoc_STRVAR(bpy_user_resource_doc[] = // now in bpy/utils.py +// PyDoc_STRVAR(bpy_user_resource_doc[] = /* now in bpy/utils.py */ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObject *kw) { const struct PyC_StringEnumItems type_items[] = { diff --git a/source/blender/python/intern/bpy_app_ffmpeg.c b/source/blender/python/intern/bpy_app_ffmpeg.c index fdd09be508a..4e396668450 100644 --- a/source/blender/python/intern/bpy_app_ffmpeg.c +++ b/source/blender/python/intern/bpy_app_ffmpeg.c @@ -75,7 +75,7 @@ static PyObject *make_ffmpeg_info(void) return NULL; } -#if 0 // UNUSED +#if 0 /* UNUSED */ # define SetIntItem(flag) PyStructSequence_SET_ITEM(ffmpeg_info, pos++, PyLong_FromLong(flag)) #endif #ifndef WITH_FFMPEG diff --git a/source/blender/python/intern/bpy_app_sdl.c b/source/blender/python/intern/bpy_app_sdl.c index c8be2c521d3..645119c1c5d 100644 --- a/source/blender/python/intern/bpy_app_sdl.c +++ b/source/blender/python/intern/bpy_app_sdl.c @@ -89,7 +89,7 @@ static PyObject *make_sdl_info(void) SDL_GetVersion(&version); sdl_available = true; } -# else // WITH_SDL_DYNLOAD=OFF +# else /* WITH_SDL_DYNLOAD=OFF */ sdl_available = true; # if SDL_MAJOR_VERSION >= 2 SDL_GetVersion(&version); @@ -107,7 +107,7 @@ static PyObject *make_sdl_info(void) } SetObjItem(PyBool_FromLong(sdl_available)); -#else // WITH_SDL=OFF +#else /* WITH_SDL=OFF */ SetObjItem(PyBool_FromLong(0)); SetObjItem(PyC_Tuple_Pack_I32(0, 0, 0)); SetStrItem("Unknown"); diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 8ba468f91e8..c0536693f38 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -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(); } @@ -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_interface.c b/source/blender/python/intern/bpy_interface.c index 0c45a9222ee..f64332d94cc 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -91,7 +91,7 @@ static int py_call_level = 0; /* Set by command line arguments before Python starts. */ static bool py_use_system_env = false; -// #define TIME_PY_RUN // simple python tests. prints on exit. +// #define TIME_PY_RUN /* simple python tests. prints on exit. */ #ifdef TIME_PY_RUN # include "PIL_time.h" diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 1aad07af591..7796d0a01a1 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -722,7 +722,7 @@ PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop) } 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. */ @@ -6048,7 +6048,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject /* enable this so all strings are copied and freed after calling. * this exposes bugs where the pointer to the string is held and re-used */ - // #define DEBUG_STRING_FREE + /* #define DEBUG_STRING_FREE */ #ifdef DEBUG_STRING_FREE PyObject *string_free_ls = PyList_New(0); @@ -8820,7 +8820,10 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class /* Old srna still references us, keep the check in case registering somehow can free it. */ if (RNA_struct_py_type_get(srna)) { RNA_struct_py_type_set(srna, NULL); - // Py_DECREF(py_class); /* Should be able to do this XXX since the old RNA adds a new ref. */ +#if 0 + /* Should be able to do this XXX since the old RNA adds a new ref. */ + Py_DECREF(py_class); +#endif } /* Can't use this because it returns a dict proxy -- cgit v1.2.3