Cleanup: use C comments for descriptive text
Follow our code style guide by using C-comments for text descriptions.
This commit is contained in:
@@ -69,7 +69,7 @@ void BPY_thread_restore(BPy_ThreadStatePtr tstate);
|
||||
|
||||
void BPY_text_free_code(struct Text *text);
|
||||
void BPY_modules_update(
|
||||
struct bContext *C); // XXX - annoying, need this for pointers that get out of date
|
||||
struct bContext *C); /* XXX - annoying, need this for pointers that get out of date */
|
||||
void BPY_modules_load_user(struct bContext *C);
|
||||
|
||||
void BPY_app_handlers_reset(const short do_all);
|
||||
|
@@ -98,7 +98,7 @@ PyDoc_STRVAR(bpy_bmlayeraccess_collection__string_doc,
|
||||
":class:`BMLayerCollection`");
|
||||
PyDoc_STRVAR(bpy_bmlayeraccess_collection__deform_doc,
|
||||
"Vertex deform weight :class:`BMDeformVert` (TODO).\n\ntype: "
|
||||
":class:`BMLayerCollection`" // TYPE DOESN'T EXIST YET
|
||||
":class:`BMLayerCollection`" /* TYPE DOESN'T EXIST YET */
|
||||
);
|
||||
PyDoc_STRVAR(
|
||||
bpy_bmlayeraccess_collection__shape_doc,
|
||||
|
@@ -120,7 +120,7 @@ static void bm_init_types_bmloopuv(void)
|
||||
|
||||
BPy_BMLoopUV_Type.tp_name = "BMLoopUV";
|
||||
|
||||
BPy_BMLoopUV_Type.tp_doc = NULL; // todo
|
||||
BPy_BMLoopUV_Type.tp_doc = NULL; /* todo */
|
||||
|
||||
BPy_BMLoopUV_Type.tp_getset = bpy_bmloopuv_getseters;
|
||||
|
||||
@@ -233,7 +233,7 @@ static void bm_init_types_bmvertskin(void)
|
||||
|
||||
BPy_BMVertSkin_Type.tp_name = "BMVertSkin";
|
||||
|
||||
BPy_BMVertSkin_Type.tp_doc = NULL; // todo
|
||||
BPy_BMVertSkin_Type.tp_doc = NULL; /* todo */
|
||||
|
||||
BPy_BMVertSkin_Type.tp_getset = bpy_bmvertskin_getseters;
|
||||
|
||||
@@ -645,7 +645,7 @@ static void bm_init_types_bmdvert(void)
|
||||
|
||||
BPy_BMDeformVert_Type.tp_name = "BMDeformVert";
|
||||
|
||||
BPy_BMDeformVert_Type.tp_doc = NULL; // todo
|
||||
BPy_BMDeformVert_Type.tp_doc = NULL; /* todo */
|
||||
|
||||
BPy_BMDeformVert_Type.tp_as_sequence = &bpy_bmdeformvert_as_sequence;
|
||||
BPy_BMDeformVert_Type.tp_as_mapping = &bpy_bmdeformvert_as_mapping;
|
||||
|
@@ -646,10 +646,12 @@ PyObject *PyC_ExceptionBuffer(void)
|
||||
goto error_cleanup;
|
||||
}
|
||||
|
||||
Py_INCREF(stdout_backup); // since these were borrowed we don't want them freed when replaced.
|
||||
/* Since these were borrowed we don't want them freed when replaced. */
|
||||
Py_INCREF(stdout_backup);
|
||||
Py_INCREF(stderr_backup);
|
||||
|
||||
PySys_SetObject("stdout", string_io); // both of these are freed when restoring
|
||||
/* Both of these are freed when restoring. */
|
||||
PySys_SetObject("stdout", string_io);
|
||||
PySys_SetObject("stderr", string_io);
|
||||
|
||||
PyErr_Restore(error_type, error_value, error_traceback);
|
||||
|
@@ -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[] = {
|
||||
|
@@ -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
|
||||
|
@@ -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");
|
||||
|
@@ -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();
|
||||
}
|
||||
|
@@ -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"
|
||||
|
@@ -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
|
||||
|
@@ -727,7 +727,7 @@ void BaseMathObject_dealloc(BaseMathObject *self)
|
||||
BaseMathObject_clear(self);
|
||||
}
|
||||
|
||||
Py_TYPE(self)->tp_free(self); // PyObject_DEL(self); // breaks subtypes
|
||||
Py_TYPE(self)->tp_free(self); // PyObject_DEL(self); /* breaks subtypes. */
|
||||
}
|
||||
|
||||
/*----------------------------MODULE INIT-------------------------*/
|
||||
|
Reference in New Issue
Block a user