Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-03-26 10:55:09 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-03-26 10:55:09 +0400
commit11d12d945e1a04da102f080f8748514c9bcc0024 (patch)
tree5083c37495889353340751eeda724dc7b10594f9 /source/blender/python/mathutils/mathutils_Euler.c
parent7c8c1a0718bebe6dbea7ce3583e29301053a3923 (diff)
style cleanup: python api
Diffstat (limited to 'source/blender/python/mathutils/mathutils_Euler.c')
-rw-r--r--source/blender/python/mathutils/mathutils_Euler.c142
1 files changed, 71 insertions, 71 deletions
diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c
index 957649e6365..ecd0cee03b5 100644
--- a/source/blender/python/mathutils/mathutils_Euler.c
+++ b/source/blender/python/mathutils/mathutils_Euler.c
@@ -61,16 +61,16 @@ static PyObject *Euler_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
return NULL;
switch (PyTuple_GET_SIZE(args)) {
- case 0:
- break;
- case 2:
- if ((order = euler_order_from_string(order_str, "mathutils.Euler()")) == -1)
- return NULL;
+ case 0:
+ break;
+ case 2:
+ if ((order = euler_order_from_string(order_str, "mathutils.Euler()")) == -1)
+ return NULL;
/* intentionally pass through */
- case 1:
- if (mathutils_array_parse(eul, EULER_SIZE, EULER_SIZE, seq, "mathutils.Euler()") == -1)
- return NULL;
- break;
+ case 1:
+ if (mathutils_array_parse(eul, EULER_SIZE, EULER_SIZE, seq, "mathutils.Euler()") == -1)
+ return NULL;
+ break;
}
return Euler_CreatePyObject(eul, order, Py_NEW, type);
}
@@ -86,12 +86,12 @@ short euler_order_from_string(const char *str, const char *error_prefix)
{
if ((str[0] && str[1] && str[2] && str[3] == '\0')) {
switch (*((PY_INT32_T *)str)) {
- case 'X'|'Y'<<8|'Z'<<16: return EULER_ORDER_XYZ;
- case 'X'|'Z'<<8|'Y'<<16: return EULER_ORDER_XZY;
- case 'Y'|'X'<<8|'Z'<<16: return EULER_ORDER_YXZ;
- case 'Y'|'Z'<<8|'X'<<16: return EULER_ORDER_YZX;
- case 'Z'|'X'<<8|'Y'<<16: return EULER_ORDER_ZXY;
- case 'Z'|'Y'<<8|'X'<<16: return EULER_ORDER_ZYX;
+ case 'X' | 'Y' << 8 | 'Z' << 16: return EULER_ORDER_XYZ;
+ case 'X' | 'Z' << 8 | 'Y' << 16: return EULER_ORDER_XZY;
+ case 'Y' | 'X' << 8 | 'Z' << 16: return EULER_ORDER_YXZ;
+ case 'Y' | 'Z' << 8 | 'X' << 16: return EULER_ORDER_YZX;
+ case 'Z' | 'X' << 8 | 'Y' << 16: return EULER_ORDER_ZXY;
+ case 'Z' | 'Y' << 8 | 'X' << 16: return EULER_ORDER_ZYX;
}
}
@@ -164,7 +164,7 @@ static PyObject *Euler_to_matrix(EulerObject *self)
eulO_to_mat3((float (*)[3])mat, self->eul, self->order);
- return Matrix_CreatePyObject(mat, 3, 3 , Py_NEW, NULL);
+ return Matrix_CreatePyObject(mat, 3, 3, Py_NEW, NULL);
}
PyDoc_STRVAR(Euler_zero_doc,
@@ -550,16 +550,16 @@ static int Euler_ass_subscript(EulerObject *self, PyObject *item, PyObject *valu
//-----------------PROTCOL DECLARATIONS--------------------------
static PySequenceMethods Euler_SeqMethods = {
- (lenfunc) Euler_len, /* sq_length */
- (binaryfunc) NULL, /* sq_concat */
- (ssizeargfunc) NULL, /* sq_repeat */
- (ssizeargfunc) Euler_item, /* sq_item */
- (ssizessizeargfunc) NULL, /* sq_slice, deprecated */
- (ssizeobjargproc) Euler_ass_item, /* sq_ass_item */
- (ssizessizeobjargproc) NULL, /* sq_ass_slice, deprecated */
- (objobjproc) NULL, /* sq_contains */
- (binaryfunc) NULL, /* sq_inplace_concat */
- (ssizeargfunc) NULL, /* sq_inplace_repeat */
+ (lenfunc) Euler_len, /* sq_length */
+ (binaryfunc) NULL, /* sq_concat */
+ (ssizeargfunc) NULL, /* sq_repeat */
+ (ssizeargfunc) Euler_item, /* sq_item */
+ (ssizessizeargfunc) NULL, /* sq_slice, deprecated */
+ (ssizeobjargproc) Euler_ass_item, /* sq_ass_item */
+ (ssizessizeobjargproc) NULL, /* sq_ass_slice, deprecated */
+ (objobjproc) NULL, /* sq_contains */
+ (binaryfunc) NULL, /* sq_inplace_concat */
+ (ssizeargfunc) NULL, /* sq_inplace_repeat */
};
static PyMappingMethods Euler_AsMapping = {
@@ -643,51 +643,51 @@ PyDoc_STRVAR(euler_doc,
);
PyTypeObject euler_Type = {
PyVarObject_HEAD_INIT(NULL, 0)
- "mathutils.Euler", //tp_name
- sizeof(EulerObject), //tp_basicsize
- 0, //tp_itemsize
- (destructor)BaseMathObject_dealloc, //tp_dealloc
- NULL, //tp_print
- NULL, //tp_getattr
- NULL, //tp_setattr
- NULL, //tp_compare
- (reprfunc) Euler_repr, //tp_repr
- NULL, //tp_as_number
- &Euler_SeqMethods, //tp_as_sequence
- &Euler_AsMapping, //tp_as_mapping
- NULL, //tp_hash
- NULL, //tp_call
- (reprfunc) Euler_str, //tp_str
- NULL, //tp_getattro
- NULL, //tp_setattro
- NULL, //tp_as_buffer
+ "mathutils.Euler", //tp_name
+ sizeof(EulerObject), //tp_basicsize
+ 0, //tp_itemsize
+ (destructor)BaseMathObject_dealloc, //tp_dealloc
+ NULL, //tp_print
+ NULL, //tp_getattr
+ NULL, //tp_setattr
+ NULL, //tp_compare
+ (reprfunc) Euler_repr, //tp_repr
+ NULL, //tp_as_number
+ &Euler_SeqMethods, //tp_as_sequence
+ &Euler_AsMapping, //tp_as_mapping
+ NULL, //tp_hash
+ NULL, //tp_call
+ (reprfunc) Euler_str, //tp_str
+ NULL, //tp_getattro
+ NULL, //tp_setattro
+ NULL, //tp_as_buffer
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, //tp_flags
euler_doc, //tp_doc
- (traverseproc)BaseMathObject_traverse, //tp_traverse
- (inquiry)BaseMathObject_clear, //tp_clear
- (richcmpfunc)Euler_richcmpr, //tp_richcompare
- 0, //tp_weaklistoffset
- NULL, //tp_iter
- NULL, //tp_iternext
- Euler_methods, //tp_methods
- NULL, //tp_members
- Euler_getseters, //tp_getset
- NULL, //tp_base
- NULL, //tp_dict
- NULL, //tp_descr_get
- NULL, //tp_descr_set
- 0, //tp_dictoffset
- NULL, //tp_init
- NULL, //tp_alloc
- Euler_new, //tp_new
- NULL, //tp_free
- NULL, //tp_is_gc
- NULL, //tp_bases
- NULL, //tp_mro
- NULL, //tp_cache
- NULL, //tp_subclasses
- NULL, //tp_weaklist
- NULL //tp_del
+ (traverseproc)BaseMathObject_traverse, //tp_traverse
+ (inquiry)BaseMathObject_clear, //tp_clear
+ (richcmpfunc)Euler_richcmpr, //tp_richcompare
+ 0, //tp_weaklistoffset
+ NULL, //tp_iter
+ NULL, //tp_iternext
+ Euler_methods, //tp_methods
+ NULL, //tp_members
+ Euler_getseters, //tp_getset
+ NULL, //tp_base
+ NULL, //tp_dict
+ NULL, //tp_descr_get
+ NULL, //tp_descr_set
+ 0, //tp_dictoffset
+ NULL, //tp_init
+ NULL, //tp_alloc
+ Euler_new, //tp_new
+ NULL, //tp_free
+ NULL, //tp_is_gc
+ NULL, //tp_bases
+ NULL, //tp_mro
+ NULL, //tp_cache
+ NULL, //tp_subclasses
+ NULL, //tp_weaklist
+ NULL //tp_del
};
//------------------------Euler_CreatePyObject (internal)-------------
//creates a new euler object
@@ -699,8 +699,8 @@ PyObject *Euler_CreatePyObject(float *eul, short order, int type, PyTypeObject *
{
EulerObject *self;
- self = base_type ? (EulerObject *)base_type->tp_alloc(base_type, 0) :
- (EulerObject *)PyObject_GC_New(EulerObject, &euler_Type);
+ self = base_type ? (EulerObject *)base_type->tp_alloc(base_type, 0) :
+ (EulerObject *)PyObject_GC_New(EulerObject, &euler_Type);
if (self) {
/* init callbacks as NULL */