diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-04 00:36:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-04 00:36:09 +0400 |
commit | 35900761939465a3014ef58a12e9293d59575e32 (patch) | |
tree | e9fca2efa21e2b109084fca9b559593c30d9663f /source/blender/python | |
parent | 95670e03a01d30cda5a0f685974f28790be6809d (diff) |
style cleanup - comment formatting
Diffstat (limited to 'source/blender/python')
20 files changed, 218 insertions, 213 deletions
diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 65bce912963..2d5a60d2190 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -2307,14 +2307,14 @@ void BPy_BM_init_types(void) BPy_BMIter_Type.tp_dealloc = NULL; /* - BPy_BMesh_Type. - BPy_BMVert_Type. - BPy_BMEdge_Type. - BPy_BMFace_Type. - BPy_BMLoop_Type. - BPy_BMElemSeq_Type. - BPy_BMIter_Type. - */ + * BPy_BMesh_Type. + * BPy_BMVert_Type. + * BPy_BMEdge_Type. + * BPy_BMFace_Type. + * BPy_BMLoop_Type. + * BPy_BMElemSeq_Type. + * BPy_BMIter_Type. + */ BPy_BMesh_Type.tp_flags = Py_TPFLAGS_DEFAULT; BPy_BMVert_Type.tp_flags = Py_TPFLAGS_DEFAULT; diff --git a/source/blender/python/generic/bgl.h b/source/blender/python/generic/bgl.h index e23f4c2e86d..9df08882b8a 100644 --- a/source/blender/python/generic/bgl.h +++ b/source/blender/python/generic/bgl.h @@ -75,7 +75,7 @@ extern PyTypeObject BGL_bufferType; /*@ By golly George! It looks like fancy pants macro time!!! */ -/* +#if 0 /* unused so far */ #define int_str "i" #define int_var(number) bgl_int##number #define int_ref(number) &bgl_int##number @@ -85,7 +85,7 @@ extern PyTypeObject BGL_bufferType; #define float_var(number) bgl_float##number #define float_ref(number) &bgl_float##number #define float_def(number) float float_var(number) -*/ +#endif /* TYPE_str is the string to pass to Py_ArgParse (for the format) */ /* TYPE_var is the name to pass to the GL function */ diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index 4cff5cbca95..3462e6ee5d4 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -399,9 +399,9 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty if ((val.array.type= idp_sequence_type(ob)) == -1) return "only floats, ints and dicts are allowed in ID property arrays"; - /*validate sequence and derive type. - we assume IDP_INT unless we hit a float - number; then we assume it's */ + /* validate sequence and derive type. + * we assume IDP_INT unless we hit a float + * number; then we assume it's */ val.array.len = PySequence_Size(ob); @@ -443,8 +443,8 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty keys = PyMapping_Keys(ob); vals = PyMapping_Values(ob); - /*we allocate the group first; if we hit any invalid data, - we can delete it easily enough.*/ + /* we allocate the group first; if we hit any invalid data, + * we can delete it easily enough.*/ prop = IDP_New(IDP_GROUP, &val, name); len = PyMapping_Length(ob); for (i=0; i<len; i++) { @@ -666,9 +666,9 @@ static PyObject *BPy_IDGroup_Pop(BPy_IDProperty *self, PyObject *value) pyform = BPy_IDGroup_MapDataToPy(idprop); if (!pyform) { - /*ok something bad happened with the pyobject, - so don't remove the prop from the group. if pyform is - NULL, then it already should have raised an exception.*/ + /* ok something bad happened with the pyobject, + * so don't remove the prop from the group. if pyform is + * NULL, then it already should have raised an exception.*/ return NULL; } diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index e63e0146330..499a691156b 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -419,16 +419,16 @@ PyObject *PyC_UnicodeFromByte(const char *str) } /***************************************************************************** -* Description: This function creates a new Python dictionary object. -* note: dict is owned by sys.modules["__main__"] module, reference is borrowed -* note: important we use the dict from __main__, this is what python expects - for 'pickle' to work as well as strings like this... - >> foo = 10 - >> print(__import__("__main__").foo) -* -* note: this overwrites __main__ which gives problems with nested calles. -* be sure to run PyC_MainModule_Backup & PyC_MainModule_Restore if there is -* any chance that python is in the call stack. + * Description: This function creates a new Python dictionary object. + * note: dict is owned by sys.modules["__main__"] module, reference is borrowed + * note: important we use the dict from __main__, this is what python expects + * for 'pickle' to work as well as strings like this... + * >> foo = 10 + * >> print(__import__("__main__").foo) + * + * note: this overwrites __main__ which gives problems with nested calles. + * be sure to run PyC_MainModule_Backup & PyC_MainModule_Restore if there is + * any chance that python is in the call stack. *****************************************************************************/ PyObject *PyC_DefaultNameSpace(const char *filename) { @@ -475,7 +475,7 @@ void PyC_SetHomePath(const char *py_path_bundle) #ifdef __APPLE__ /* OSX allow file/directory names to contain : character (represented as / in the Finder) - but current Python lib (release 3.1.1) doesn't handle these correctly */ + * but current Python lib (release 3.1.1) doesn't handle these correctly */ if (strchr(py_path_bundle, ':')) printf("Warning : Blender application is located in a path containing : or / chars\ \nThis may make python import function fail\n"); @@ -483,7 +483,7 @@ void PyC_SetHomePath(const char *py_path_bundle) #ifdef _WIN32 /* cmake/MSVC debug build crashes without this, why only - in this case is unknown.. */ + * in this case is unknown.. */ { BLI_setenv("PYTHONPATH", py_path_bundle); } diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index e0e3dd5519c..0f5ca13586c 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -227,9 +227,9 @@ static PyObject *bpy_import_test(const char *modname) return mod; } -/***************************************************************************** -* Description: Creates the bpy module and adds it to sys.modules for importing -*****************************************************************************/ +/****************************************************************************** + * Description: Creates the bpy module and adds it to sys.modules for importing + ******************************************************************************/ void BPy_init_modules(void) { extern BPy_StructRNA *bpy_context_module; diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index 721bce51693..f4962cd39b6 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -68,11 +68,11 @@ static PyStructSequence_Desc app_cb_info_desc = { (sizeof(app_cb_info_fields) / sizeof(PyStructSequence_Field)) - 1 }; -/* -#if (BLI_CB_EVT_TOT != ((sizeof(app_cb_info_fields)/sizeof(PyStructSequence_Field)))) -# error "Callbacks are out of sync" +#if 0 +# if (BLI_CB_EVT_TOT != ((sizeof(app_cb_info_fields)/sizeof(PyStructSequence_Field)))) +# error "Callbacks are out of sync" +# endif #endif -*/ /* --------------------------------------------------------------------------*/ /* permanent tagging code */ diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 413b29e7e2d..2f03fd6974f 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -671,11 +671,11 @@ int BPY_context_member_get(bContext *C, const char *member, bContextDataResult * PyObject *list_item = PySequence_Fast_GET_ITEM(seq_fast, i); if (BPy_StructRNA_Check(list_item)) { - /* +#if 0 CollectionPointerLink *link = MEM_callocN(sizeof(CollectionPointerLink), "bpy_context_get"); link->ptr = ((BPy_StructRNA *)item)->ptr; BLI_addtail(&result->list, link); - */ +#endif ptr = &(((BPy_StructRNA *)list_item)->ptr); CTX_data_list_add(result, ptr->id.data, ptr->type, ptr->data); } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index ab6d23ba4db..5fbfb75555f 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1309,11 +1309,11 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val) if (free) MEM_freeN(enum_item); - /* +#if 0 PyErr_Format(PyExc_AttributeError, "RNA Error: Current value \"%d\" matches no enum", val); ret = NULL; - */ +#endif } } @@ -2549,10 +2549,12 @@ static PyObject *pyrna_prop_array_subscript(BPy_PropertyArrayRNA *self, PyObject { PYRNA_PROP_CHECK_OBJ((BPy_PropertyRNA *)self); - /*if (PyUnicode_Check(key)) { +#if 0 + if (PyUnicode_Check(key)) { return pyrna_prop_array_subscript_str(self, _PyUnicode_AsString(key)); } - else */ + else +#endif if (PyIndex_Check(key)) { Py_ssize_t i = PyNumber_AsSsize_t(key, PyExc_IndexError); if (i == -1 && PyErr_Occurred()) @@ -3576,14 +3578,14 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb if (srna == NULL) { /* allow setting on unregistered classes which can be registered later on */ - /* +#if 0 if (value && is_deferred_prop) { PyErr_Format(PyExc_AttributeError, "pyrna_struct_meta_idprop_setattro() unable to get srna from class '%.200s'", ((PyTypeObject *)cls)->tp_name); return -1; } - */ +#endif /* srna_from_self may set an error */ PyErr_Clear(); return PyType_Type.tp_setattro(cls, attr, value); @@ -4571,14 +4573,14 @@ static PyObject *pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject * else if (PyType_IsSubtype(Py_TYPE(base), &pyrna_struct_Type)) { /* this almost never runs, only when using user defined subclasses of built-in object. * this isn't common since its NOT related to registerable subclasses. eg: - - >>> class MyObSubclass(bpy.types.Object): - ... def test_func(self): - ... print(100) - ... - >>> myob = MyObSubclass(bpy.context.object) - >>> myob.test_func() - 100 + * + * >>> class MyObSubclass(bpy.types.Object): + * ... def test_func(self): + * ... print(100) + * ... + * >>> myob = MyObSubclass(bpy.context.object) + * >>> myob.test_func() + * 100 * * Keep this since it could be useful. */ @@ -4866,7 +4868,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject } /* for testing */ - /* +#if 0 { const char *fn; int lineno; @@ -4874,7 +4876,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject printf("pyrna_func_call > %.200s.%.200s : %.200s:%d\n", RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), fn, lineno); } - */ +#endif /* include the ID pointer for pyrna_param_to_py() so we can include the * ID pointer on return values, this only works when returned values have @@ -5104,14 +5106,14 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject #ifdef DEBUG_STRING_FREE - /* +#if 0 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)); } - */ +#endif Py_DECREF(string_free_ls); #undef DEBUG_STRING_FREE #endif @@ -6018,10 +6020,10 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna) * mainly for the purposing of matching the C/rna type hierarchy */ else { /* subclass equivalents - - class myClass(myBase): - some = 'value' # or ... - - myClass = type(name='myClass', bases=(myBase,), dict={'__module__':'bpy.types'}) - */ + * - class myClass(myBase): + * some = 'value' # or ... + * - myClass = type(name='myClass', bases=(myBase,), dict={'__module__':'bpy.types'}) + */ /* Assume RNA_struct_py_type_get(srna) was already checked */ PyObject *py_base = pyrna_srna_PyBase(srna); @@ -6523,8 +6525,10 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item /* Since this is a class dict, ignore args that can't be passed */ /* for testing only */ - /* PyC_ObSpit("Why doesn't this work??", item); - PyErr_Print(); */ +#if 0 + PyC_ObSpit("Why doesn't this work??", item); + PyErr_Print(); +#endif PyErr_Clear(); } } @@ -6886,9 +6890,12 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param rna_disallow_writes = TRUE; /* 'almost' all the time calling the class isn't needed. - * We could just do... + * We could just do... */ +#if 0 py_class_instance = py_srna; Py_INCREF(py_class_instance); +#endif + /* * This would work fine but means __init__ functions wouldnt run. * none of blenders default scripts use __init__ but its nice to call it * for general correctness. just to note why this is here when it could be safely removed. @@ -7230,14 +7237,14 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class return NULL; /* fails in cases, cant use this check but would like to :| */ - /* +#if 0 if (RNA_struct_py_type_get(srna)) { PyErr_Format(PyExc_ValueError, "register_class(...): %.200s's parent class %.200s is already registered, this is not allowed", ((PyTypeObject *)py_class)->tp_name, RNA_struct_identifier(srna)); return NULL; } - */ +#endif /* check that we have a register callback for this type */ reg = RNA_struct_register(srna); @@ -7352,11 +7359,13 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla return NULL; } - /*if (PyDict_GetItem(((PyTypeObject *)py_class)->tp_dict, bpy_intern_str_bl_rna) == NULL) { +#if 0 + if (PyDict_GetItem(((PyTypeObject *)py_class)->tp_dict, bpy_intern_str_bl_rna) == NULL) { PWM_cursor_wait(0); PyErr_SetString(PyExc_ValueError, "unregister_class(): not a registered as a subclass"); return NULL; - }*/ + } +#endif if (!pyrna_write_check()) { PyErr_Format(PyExc_RuntimeError, diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index a74d0417ca2..187db194c36 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -50,17 +50,17 @@ typedef void (*RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *); typedef void (*RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *); /* - arr[3][4][5] - 0 1 2 <- dimension index -*/ + * arr[3][4][5] + * 0 1 2 <- dimension index + */ /* - arr[2] = x - - py_to_array_index(arraydim=0, arrayoffset=0, index=2) - validate_array(lvalue_dim=0) - ... make real index ... -*/ + * arr[2] = x + * + * py_to_array_index(arraydim=0, arrayoffset=0, index=2) + * validate_array(lvalue_dim=0) + * ... make real index ... + */ /* arr[3] = x, self->arraydim is 0, lvalue_dim is 1 */ /* Ensures that a python sequence has expected number of items/sub-items and items are of desired type. */ @@ -101,8 +101,8 @@ static int validate_array_type(PyObject *seq, int dim, int totdim, int dimsize[] * dim = 0 */ else if (PySequence_Size(item) != dimsize[dim + 1]) { /* BLI_snprintf(error_str, error_str_size, - "sequences of dimension %d should contain %d items", - (int)dim + 1, (int)dimsize[dim + 1]); */ + * "sequences of dimension %d should contain %d items", + * (int)dim + 1, (int)dimsize[dim + 1]); */ PyErr_Format(PyExc_ValueError, "%s sequences of dimension %d should contain %d items", error_prefix, (int)dim + 1, (int)dimsize[dim + 1]); ok = 0; @@ -205,8 +205,8 @@ static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA /* length is flexible */ if (!RNA_property_dynamic_array_set_length(ptr, prop, tot)) { /* BLI_snprintf(error_str, error_str_size, - "%s.%s: array length cannot be changed to %d", - RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); */ + * "%s.%s: array length cannot be changed to %d", + * RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); */ PyErr_Format(PyExc_ValueError, "%s %s.%s: array length cannot be changed to %d", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), tot); return -1; @@ -232,18 +232,18 @@ static int validate_array_length(PyObject *rvalue, PointerRNA *ptr, PropertyRNA len = 1; /* arr[3][4][5] - - arr[2] = x - dimsize = {4, 5} - dimsize[1] = 4 - dimsize[2] = 5 - lvalue_dim = 0, totdim = 3 - - arr[2][3] = x - lvalue_dim = 1 - - arr[2][3][4] = x - lvalue_dim = 2 */ + * + * arr[2] = x + * dimsize = {4, 5} + * dimsize[1] = 4 + * dimsize[2] = 5 + * lvalue_dim = 0, totdim = 3 + * + * arr[2][3] = x + * lvalue_dim = 1 + * + * arr[2][3][4] = x + * lvalue_dim = 2 */ for (i = lvalue_dim; i < totdim; i++) len *= dimsize[i]; } @@ -462,12 +462,12 @@ static int py_to_array_index(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, /* convert index */ /* arr[3][4][5] - - arr[2] = x - lvalue_dim = 0, index = 0 + 2 * 4 * 5 - - arr[2][3] = x - lvalue_dim = 1, index = 40 + 3 * 5 */ + * + * arr[2] = x + * lvalue_dim = 0, index = 0 + 2 * 4 * 5 + * + * arr[2][3] = x + * lvalue_dim = 1, index = 40 + 3 * 5 */ lvalue_dim++; @@ -677,12 +677,12 @@ PyObject *pyrna_py_from_array_index(BPy_PropertyArrayRNA *self, PointerRNA *ptr, ret->arraydim = arraydim + 1; /* arr[3][4][5] - - x = arr[2] - index = 0 + 2 * 4 * 5 - - x = arr[2][3] - index = offset + 3 * 5 */ + * + * x = arr[2] + * index = 0 + 2 * 4 * 5 + * + * x = arr[2][3] + * index = offset + 3 * 5 */ for (i = arraydim + 1; i < totdim; i++) index *= dimsize[i]; diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index e6be81f88a3..2dd1d256b01 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -257,7 +257,7 @@ int EXPP_FloatsAreEqual(float af, float bf, int maxDiff) } /*---------------------- EXPP_VectorsAreEqual ------------------------- - Builds on EXPP_FloatsAreEqual to test vectors */ + * Builds on EXPP_FloatsAreEqual to test vectors */ int EXPP_VectorsAreEqual(float *vecA, float *vecB, int size, int floatSteps) { int x; diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 7f3f811c41a..e925b115178 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -619,7 +619,7 @@ static PyObject *Color_idiv(PyObject *v1, PyObject *v2) } /* -obj - returns the negative of this object */ + * returns the negative of this object */ static PyObject *Color_neg(ColorObject *self) { float tcol[COLOR_SIZE]; @@ -848,10 +848,10 @@ PyTypeObject color_Type = { }; //------------------------Color_CreatePyObject (internal)------------- //creates a new color object -/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER - (i.e. it was allocated elsewhere by MEM_mallocN()) - pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON - (i.e. it must be created here with PyMEM_malloc())*/ +/* pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER + * (i.e. it was allocated elsewhere by MEM_mallocN()) + * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON + * (i.e. it must be created here with PyMEM_malloc())*/ PyObject *Color_CreatePyObject(float *col, int type, PyTypeObject *base_type) { ColorObject *self; diff --git a/source/blender/python/mathutils/mathutils_Color.h b/source/blender/python/mathutils/mathutils_Color.h index 786afeed5da..cfa83a9630e 100644 --- a/source/blender/python/mathutils/mathutils_Color.h +++ b/source/blender/python/mathutils/mathutils_Color.h @@ -42,10 +42,10 @@ typedef struct { BASE_MATH_MEMBERS(col); } ColorObject; -/*struct data contains a pointer to the actual data that the -object uses. It can use either PyMem allocated data (which will -be stored in py_data) or be a wrapper for data allocated through -blender (stored in blend_data). This is an either/or struct not both*/ +/* struct data contains a pointer to the actual data that the + * object uses. It can use either PyMem allocated data (which will + * be stored in py_data) or be a wrapper for data allocated through + * blender (stored in blend_data). This is an either/or struct not both*/ //prototypes PyObject *Color_CreatePyObject( float *col, int type, PyTypeObject *base_type); diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index 66caed50aa9..17e4115233b 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -691,10 +691,10 @@ PyTypeObject euler_Type = { }; //------------------------Euler_CreatePyObject (internal)------------- //creates a new euler object -/*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER - (i.e. it was allocated elsewhere by MEM_mallocN()) - pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON - (i.e. it must be created here with PyMEM_malloc())*/ +/* pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER + * (i.e. it was allocated elsewhere by MEM_mallocN()) + * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON + * (i.e. it must be created here with PyMEM_malloc())*/ PyObject *Euler_CreatePyObject(float *eul, short order, int type, PyTypeObject *base_type) { EulerObject *self; diff --git a/source/blender/python/mathutils/mathutils_Euler.h b/source/blender/python/mathutils/mathutils_Euler.h index 3656aa14461..d9ed86401dc 100644 --- a/source/blender/python/mathutils/mathutils_Euler.h +++ b/source/blender/python/mathutils/mathutils_Euler.h @@ -44,10 +44,10 @@ typedef struct { } EulerObject; -/*struct data contains a pointer to the actual data that the -object uses. It can use either PyMem allocated data (which will -be stored in py_data) or be a wrapper for data allocated through -blender (stored in blend_data). This is an either/or struct not both */ +/* struct data contains a pointer to the actual data that the + * object uses. It can use either PyMem allocated data (which will + * be stored in py_data) or be a wrapper for data allocated through + * blender (stored in blend_data). This is an either/or struct not both */ //prototypes PyObject *Euler_CreatePyObject( float *eul, short order, int type, PyTypeObject *base_type); diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index d4f07def6d1..ea329b17013 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -1218,8 +1218,6 @@ static PyObject *Matrix_invert(MatrixObject *self) z++; } } - /*transpose - Matrix_transpose(self);*/ } else { PyErr_SetString(PyExc_ValueError, @@ -1631,15 +1629,15 @@ static PyObject *Matrix_richcmpr(PyObject *a, PyObject *b, int op) } /*---------------------SEQUENCE PROTOCOLS------------------------ - ----------------------------len(object)------------------------ - sequence length */ + * ----------------------------len(object)------------------------ + * sequence length */ static int Matrix_len(MatrixObject *self) { return (self->num_row); } /*----------------------------object[]--------------------------- - sequence accessor (get) - the wrapped vector gives direct access to the matrix data */ + * sequence accessor (get) + * the wrapped vector gives direct access to the matrix data */ static PyObject *Matrix_item_row(MatrixObject *self, int row) { if (BaseMath_ReadCallback(self) == -1) @@ -1669,7 +1667,7 @@ static PyObject *Matrix_item_col(MatrixObject *self, int col) } /*----------------------------object[]------------------------- - sequence accessor (set) */ + * sequence accessor (set) */ static int Matrix_ass_item_row(MatrixObject *self, int row, PyObject *value) { @@ -1724,7 +1722,7 @@ static int Matrix_ass_item_col(MatrixObject *self, int col, PyObject *value) /*----------------------------object[z:y]------------------------ - sequence slice (get)*/ + * sequence slice (get)*/ static PyObject *Matrix_slice(MatrixObject *self, int begin, int end) { @@ -1748,7 +1746,7 @@ static PyObject *Matrix_slice(MatrixObject *self, int begin, int end) return tuple; } /*----------------------------object[z:y]------------------------ - sequence slice (set)*/ + * sequence slice (set)*/ static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *value) { PyObject *value_fast = NULL; @@ -1807,7 +1805,7 @@ static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *va } } /*------------------------NUMERIC PROTOCOLS---------------------- - ------------------------obj + obj------------------------------*/ + *------------------------obj + obj------------------------------*/ static PyObject *Matrix_add(PyObject *m1, PyObject *m2) { float mat[16]; @@ -1839,7 +1837,7 @@ static PyObject *Matrix_add(PyObject *m1, PyObject *m2) return Matrix_CreatePyObject(mat, mat1->num_col, mat1->num_row, Py_NEW, Py_TYPE(mat1)); } /*------------------------obj - obj------------------------------ - subtraction*/ + * subtraction */ static PyObject *Matrix_sub(PyObject *m1, PyObject *m2) { float mat[16]; @@ -1872,7 +1870,7 @@ static PyObject *Matrix_sub(PyObject *m1, PyObject *m2) return Matrix_CreatePyObject(mat, mat1->num_col, mat1->num_row, Py_NEW, Py_TYPE(mat1)); } /*------------------------obj * obj------------------------------ - mulplication*/ + * mulplication */ static PyObject *matrix_mul_float(MatrixObject *mat, const float scalar) { float tmat[16]; diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index c5159ce0fa2..b3767d2b8bb 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -854,7 +854,7 @@ static PyObject *Quaternion_mul(PyObject *q1, PyObject *q2) } /* -obj - returns the negative of this object*/ + * returns the negative of this object*/ static PyObject *Quaternion_neg(QuaternionObject *self) { float tquat[QUAT_SIZE]; @@ -1232,9 +1232,9 @@ PyTypeObject quaternion_Type = { //------------------------Quaternion_CreatePyObject (internal)------------- //creates a new quaternion object /*pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER - (i.e. it was allocated elsewhere by MEM_mallocN()) - pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON - (i.e. it must be created here with PyMEM_malloc())*/ + * (i.e. it was allocated elsewhere by MEM_mallocN()) + * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON + * (i.e. it must be created here with PyMEM_malloc())*/ PyObject *Quaternion_CreatePyObject(float *quat, int type, PyTypeObject *base_type) { QuaternionObject *self; diff --git a/source/blender/python/mathutils/mathutils_Quaternion.h b/source/blender/python/mathutils/mathutils_Quaternion.h index 8e91f26b08f..556e6d80948 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.h +++ b/source/blender/python/mathutils/mathutils_Quaternion.h @@ -42,10 +42,10 @@ typedef struct { BASE_MATH_MEMBERS(quat); } QuaternionObject; -/*struct data contains a pointer to the actual data that the -object uses. It can use either PyMem allocated data (which will -be stored in py_data) or be a wrapper for data allocated through -blender (stored in blend_data). This is an either/or struct not both*/ +/* struct data contains a pointer to the actual data that the + * object uses. It can use either PyMem allocated data (which will + * be stored in py_data) or be a wrapper for data allocated through + * blender (stored in blend_data). This is an either/or struct not both */ //prototypes PyObject *Quaternion_CreatePyObject( float *quat, int type, PyTypeObject *base_type); diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 765df7afcf9..46663f55be6 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -40,8 +40,8 @@ #define MAX_DIMENSIONS 4 /* Swizzle axes get packed into a single value that is used as a closure. Each - axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is - used as a sentinel: if it is unset, the axis is not valid. */ + * axis uses SWIZZLE_BITS_PER_AXIS bits. The first bit (SWIZZLE_VALID_AXIS) is + * used as a sentinel: if it is unset, the axis is not valid. */ #define SWIZZLE_BITS_PER_AXIS 3 #define SWIZZLE_VALID_AXIS 0x4 #define SWIZZLE_AXIS 0x3 @@ -439,8 +439,6 @@ static PyObject *Vector_resized(VectorObject *self, PyObject *value) int size; float *vec; - /*if (!PyArg_ParseTuple(args, "i:resize", &size)) - return NULL;*/ if ((size = PyLong_AsLong(value)) == -1) { return NULL; } @@ -788,8 +786,8 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args) } /* - flip vector around, since vectoquat expect a vector from target to tracking object - and the python function expects the inverse (a vector to the target). + * flip vector around, since vectoquat expect a vector from target to tracking object + * and the python function expects the inverse (a vector to the target). */ negate_v3_v3(vec, self->vec); @@ -1476,7 +1474,7 @@ static PyObject *Vector_isub(PyObject *v1, PyObject *v2) } /*------------------------obj * obj------------------------------ - mulplication*/ + * mulplication*/ /* COLUMN VECTOR Multiplication (Matrix X Vector) @@ -1643,7 +1641,7 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2) return NULL; /* only support vec*=float and vec*=mat - vec*=vec result is a float so that wont work */ + * vec*=vec result is a float so that wont work */ if (MatrixObject_Check(v2)) { /* ------ to be removed ------*/ #if 1 @@ -1785,7 +1783,7 @@ static PyObject *Vector_idiv(PyObject *v1, PyObject *v2) } /* -obj - returns the negative of this object*/ + * returns the negative of this object*/ static PyObject *Vector_neg(VectorObject *self) { float *tvec; @@ -1801,16 +1799,16 @@ static PyObject *Vector_neg(VectorObject *self) /*------------------------vec_magnitude_nosqrt (internal) - for comparing only */ static double vec_magnitude_nosqrt(float *data, int size) { - /*return (double)sqrt(dot);*/ + /* return (double)sqrt(dot);*/ /* warning, line above removed because we are not using the length, - rather the comparing the sizes and for this we do not need the sqrt - for the actual length, the dot must be sqrt'd */ + * rather the comparing the sizes and for this we do not need the sqrt + * for the actual length, the dot must be sqrt'd */ return dot_vn_vn(data, data, size); } /*------------------------tp_richcmpr - returns -1 execption, 0 false, 1 true */ + * returns -1 execption, 0 false, 1 true */ static PyObject *Vector_richcmpr(PyObject *objectA, PyObject *objectB, int comparison_type) { VectorObject *vecA = NULL, *vecB = NULL; @@ -2147,7 +2145,7 @@ static PyObject *Vector_swizzle_get(VectorObject *self, void *closure) * - If the value is scalar, it is copied to all axes listed in the swizzle. * - If an axis appears more than once in the swizzle, the final occurrence is * the one that determines its value. - + * * Returns 0 on success and -1 on failure. On failure, the vector will be * unchanged. */ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure) @@ -2719,9 +2717,9 @@ static struct PyMethodDef Vector_methods[] = { /* Note - Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing - but this means for eg that - vec*mat and mat*vec both get sent to Vector_mul and it neesd to sort out the order + * Py_TPFLAGS_CHECKTYPES allows us to avoid casting all types to Vector when coercing + * but this means for eg that + * (vec * mat) and (mat * vec) both get sent to Vector_mul and it neesd to sort out the order */ PyDoc_STRVAR(vector_doc, @@ -2809,11 +2807,11 @@ PyTypeObject vector_Type = { }; /*------------------------Vector_CreatePyObject (internal)------------- - creates a new vector object - pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER - (i.e. it was allocated elsewhere by MEM_mallocN()) - pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON - (i.e. it must be created here with PyMEM_malloc())*/ + * creates a new vector object + * pass Py_WRAP - if vector is a WRAPPER for data allocated by BLENDER + * (i.e. it was allocated elsewhere by MEM_mallocN()) + * pass Py_NEW - if vector is not a WRAPPER and managed by PYTHON + * (i.e. it must be created here with PyMEM_malloc())*/ PyObject *Vector_CreatePyObject(float *vec, const int size, const int type, PyTypeObject *base_type) { VectorObject *self; diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index b4f3f4e470e..bddd8027f93 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -1120,7 +1120,7 @@ static PyObject *M_Geometry_tesselate_polygon(PyObject *UNUSED(self), PyObject * filldisplist(&dispbase, &dispbase, 0); /* The faces are stored in a new DisplayList - thats added to the head of the listbase */ + * thats added to the head of the listbase */ dl = dispbase.first; tri_list = PyList_New(dl->parts); diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c index 47e93492e7a..8114e32a5fb 100644 --- a/source/blender/python/mathutils/mathutils_noise.c +++ b/source/blender/python/mathutils/mathutils_noise.c @@ -64,50 +64,50 @@ /*-----------------------------------------*/ /* 'mersenne twister' random number generator */ -/* - A C-program for MT19937, with initialization improved 2002/2/10. - Coded by Takuji Nishimura and Makoto Matsumoto. - This is a faster version by taking Shawn Cokus's optimization, - Matthe Bellew's simplification, Isaku Wada's real version. - - Before using, initialize the state by using init_genrand(seed) - or init_by_array(init_key, key_length). - - Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, - All rights reserved. - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: - - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. The names of its contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - - Any feedback is very welcome. - http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html - email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) -*/ +/* + * A C-program for MT19937, with initialization improved 2002/2/10. + * Coded by Takuji Nishimura and Makoto Matsumoto. + * This is a faster version by taking Shawn Cokus's optimization, + * Matthe Bellew's simplification, Isaku Wada's real version. + * + * Before using, initialize the state by using init_genrand(seed) + * or init_by_array(init_key, key_length). + * + * Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * 3. The names of its contributors may not be used to endorse or promote + * products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * + * Any feedback is very welcome. + * http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html + * email: m-mat @ math.sci.hiroshima-u.ac.jp (remove space) + */ /* Period parameters */ #define N 624 @@ -237,7 +237,7 @@ static float turb(float x, float y, float z, int oct, int hard, int nb, } /* Fills an array of length 3 with the turbulence vector for a given -position (x, y, z) */ + * position (x, y, z) */ static void vTurb(float x, float y, float z, int oct, int hard, int nb, float ampscale, float freqscale, float v[3]) { @@ -321,7 +321,7 @@ static PyObject *M_Noise_random_unit_vector(PyObject *UNUSED(self), PyObject *ar return Vector_CreatePyObject(vec, size, Py_NEW, NULL); } /* This is dumb, most people will want a unit vector anyway, since this doesn't have uniform distribution over a sphere*/ -/* +#if 0 PyDoc_STRVAR(M_Noise_random_vector_doc, ".. function:: random_vector(size=3)\n" "\n" @@ -349,7 +349,7 @@ static PyObject *M_Noise_random_vector(PyObject *UNUSED(self), PyObject *args) return Vector_CreatePyObject(vec, size, Py_NEW, NULL); } -*/ +#endif PyDoc_STRVAR(M_Noise_seed_set_doc, ".. function:: seed_set(seed)\n" |