formatting edits in py api, no functional changes
authorCampbell Barton <ideasman42@gmail.com>
Sun, 18 Dec 2011 08:50:06 +0000 (08:50 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 18 Dec 2011 08:50:06 +0000 (08:50 +0000)
17 files changed:
source/blender/python/generic/bgl.c
source/blender/python/generic/idprop_py_api.c
source/blender/python/generic/py_capi_utils.c
source/blender/python/intern/bpy_app_handlers.c
source/blender/python/intern/bpy_props.c
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna_anim.c
source/blender/python/intern/bpy_rna_callback.c
source/blender/python/intern/gpu.c
source/blender/python/mathutils/mathutils.c
source/blender/python/mathutils/mathutils_Color.c
source/blender/python/mathutils/mathutils_Euler.c
source/blender/python/mathutils/mathutils_Matrix.c
source/blender/python/mathutils/mathutils_Quaternion.c
source/blender/python/mathutils/mathutils_Vector.c
source/blender/python/mathutils/mathutils_geometry.c
source/blender/python/mathutils/mathutils_noise.c

index 03d66e918d5bedcb88518f4946638e2b86eb0c9a..c2fd60364146f4af9b37633de8c74137c796288b 100644 (file)
@@ -453,7 +453,7 @@ static int Buffer_ass_item(Buffer *self, int i, PyObject *v)
                }
        }
 
-       switch(self->type) {
+       switch (self->type) {
        case GL_BYTE:
                return PyArg_Parse(v, "b:Expected ints", &self->buf.asbyte[i]) ? 0:-1;
        case GL_SHORT:
@@ -595,7 +595,7 @@ static PyObject *Buffer_repr(Buffer *self)
        PyObject *repr;
        const char *typestr= "UNKNOWN";
 
-       switch(self->type) {
+       switch (self->type) {
        case GL_BYTE:   typestr= "GL_BYTE"; break;
        case GL_SHORT:  typestr= "GL_SHORT"; break;
        case GL_INT:    typestr= "GL_BYTE"; break;
index c31dadff3e1a9351724f1d010c3207e9ad4ec3e0..c058ee1d4f0692738b362e44389a27b79f589c73 100644 (file)
@@ -405,7 +405,7 @@ const char *BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty
 
                val.array.len = PySequence_Size(ob);
 
-               switch(val.array.type) {
+               switch (val.array.type) {
                case IDP_DOUBLE:
                        prop = IDP_New(IDP_ARRAY, &val, name);
                        for (i=0; i<val.array.len; i++) {
@@ -565,7 +565,7 @@ static PyObject *BPy_IDGroup_MapDataToPy(IDProperty *prop)
                        return NULL;
                }
 
-               switch(prop->subtype) {
+               switch (prop->subtype) {
                case IDP_FLOAT:
                {
                        float *array= (float*)IDP_Array(prop);
@@ -976,7 +976,7 @@ static PyObject *BPy_IDArray_repr(BPy_IDArray *self)
 
 static PyObject *BPy_IDArray_GetType(BPy_IDArray *self)
 {
-       switch(self->prop->subtype) {
+       switch (self->prop->subtype) {
        case IDP_FLOAT:
                return PyUnicode_FromString("f");
        case IDP_DOUBLE:
index 8d68a407e625dc573f78e80dfb22dfcd151005a8..43b8dc21300b9c530323d9df68f3fdfd4dbf69bd 100644 (file)
@@ -191,7 +191,7 @@ void PyC_FileAndNum(const char **filename, int *lineno)
 
 void PyC_FileAndNum_Safe(const char **filename, int *lineno)
 {
-       if(!PYC_INTERPRETER_ACTIVE) {
+       if (!PYC_INTERPRETER_ACTIVE) {
                return;
        }
 
index dd512791e850b07a0cb6cd1f045f870521b12848..dc9ef9ee8e8de76d27490b6fc66082e13c74449c 100644 (file)
@@ -82,7 +82,7 @@ static PyObject *bpy_app_handlers_persistent_new(PyTypeObject *UNUSED(type), PyO
 {
        PyObject *value;
 
-       if(!PyArg_ParseTuple(args, "O:bpy.app.handlers.persistent", &value))
+       if (!PyArg_ParseTuple(args, "O:bpy.app.handlers.persistent", &value))
                return NULL;
 
        if (PyFunction_Check(value)) {
@@ -252,12 +252,12 @@ void BPY_app_handlers_reset(const short do_all)
                        PyObject *item;
                        PyObject **dict_ptr;
 
-                       for(i= PyList_GET_SIZE(ls) - 1; i >= 0; i--) {
+                       for (i= PyList_GET_SIZE(ls) - 1; i >= 0; i--) {
 
-                               if (    (PyFunction_Check((item= PyList_GET_ITEM(ls, i)))) &&
-                                       (dict_ptr= _PyObject_GetDictPtr(item)) &&
-                                       (*dict_ptr) &&
-                                       (PyDict_GetItem(*dict_ptr, perm_id_str) != NULL))
+                               if ( (PyFunction_Check((item= PyList_GET_ITEM(ls, i)))) &&
+                                    (dict_ptr= _PyObject_GetDictPtr(item)) &&
+                                    (*dict_ptr) &&
+                                    (PyDict_GetItem(*dict_ptr, perm_id_str) != NULL))
                                {
                                        /* keep */
                                }
index c0d796669d63ede69376a3fe646bf53de51eecb1..d140801508953a2b93c5118f5fd575dae66689be 100644 (file)
@@ -971,14 +971,14 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
 
                item= PySequence_Fast_GET_ITEM(seq_fast, i);
 
-               if (    (PyTuple_CheckExact(item)) &&
-                       (item_size= PyTuple_GET_SIZE(item)) &&
-                       (item_size == 3 || item_size == 4) &&
-                       (tmp.identifier=  _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) &&
-                       (tmp.name=        _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) &&
-                       (tmp.description= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) &&
-                       (item_size < 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1) /* TODO, number isnt ensured to be unique from the script author */
-               {
+               if ( (PyTuple_CheckExact(item)) &&
+                    (item_size= PyTuple_GET_SIZE(item)) &&
+                    (item_size == 3 || item_size == 4) &&
+                    (tmp.identifier=  _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 0), &id_str_size)) &&
+                    (tmp.name=        _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 1), &name_str_size)) &&
+                    (tmp.description= _PyUnicode_AsStringAndSize(PyTuple_GET_ITEM(item, 2), &desc_str_size)) &&
+                    (item_size < 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value) != -1)) /* TODO, number isnt ensured to be unique from the script author */
+               {
                        if (is_enum_flag) {
                                if (item_size < 4) {
                                        tmp.value= 1<<i;
index f099994fc57b55ba55fedbdc844973aa8a740290..69a5fb39b673f5783d968bfe6e6b204861714cb2 100644 (file)
@@ -624,7 +624,7 @@ PyObject *pyrna_math_object_from_array(PointerRNA *ptr, PropertyRNA *prop)
                if (!is_thick)
                        ret= pyrna_prop_CreatePyObject(ptr, prop); /* owned by the mathutils PyObject */
 
-               switch(subtype) {
+               switch (subtype) {
                case PROP_ALL_VECTOR_SUBTYPES:
                        if (len>=2 && len <= 4) {
                                if (is_thick) {
@@ -3441,7 +3441,7 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname)
                        int done= CTX_data_get(C, name, &newptr, &newlb, &newtype);
 
                        if (done==1) { /* found */
-                               switch(newtype) {
+                               switch (newtype) {
                                case CTX_DATA_TYPE_POINTER:
                                        if (newptr.data == NULL) {
                                                ret= Py_None;
@@ -4201,7 +4201,7 @@ static int foreach_compat_buffer(RawPropertyType raw_type, int attr_signed, cons
 {
        char f= format ? *format:'B'; /* B is assumed when not set */
 
-       switch(raw_type) {
+       switch (raw_type) {
        case PROP_RAW_CHAR:
                if (attr_signed)  return (f=='b') ? 1:0;
                else              return (f=='B') ? 1:0;
@@ -4265,7 +4265,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
 
                        for ( ; i<tot; i++) {
                                item= PySequence_GetItem(seq, i);
-                               switch(raw_type) {
+                               switch (raw_type) {
                                case PROP_RAW_CHAR:
                                        ((char *)array)[i]= (char)PyLong_AsLong(item);
                                        break;
@@ -4320,7 +4320,7 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set)
 
                        for ( ; i<tot; i++) {
 
-                               switch(raw_type) {
+                               switch (raw_type) {
                                case PROP_RAW_CHAR:
                                        item= PyLong_FromSsize_t((Py_ssize_t) ((char *)array)[i]);
                                        break;
@@ -4616,7 +4616,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
                                PyTuple_SET_ITEM(ret, a, PyLong_FromSsize_t((Py_ssize_t)((int*)data)[a]));
                        break;
                case PROP_FLOAT:
-                       switch(RNA_property_subtype(prop)) {
+                       switch (RNA_property_subtype(prop)) {
 #ifdef USE_MATHUTILS
                                case PROP_ALL_VECTOR_SUBTYPES:
                                        ret= Vector_CreatePyObject(data, len, Py_NEW, NULL);
@@ -6969,10 +6969,10 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
        if (err != 0) {
                ReportList *reports;
                /* alert the user, else they wont know unless they see the console. */
-               if (    (!is_static) &&
-                       (ptr->data) &&
-                       (RNA_struct_is_a(ptr->type, &RNA_Operator)) &&
-                       (is_valid_wm == (CTX_wm_manager(C) != NULL)))
+               if ( (!is_static) &&
+                    (ptr->data) &&
+                    (RNA_struct_is_a(ptr->type, &RNA_Operator)) &&
+                    (is_valid_wm == (CTX_wm_manager(C) != NULL)))
                {
                        wmOperator *op= ptr->data;
                        reports= op->reports;
index 8f88814b3e4699991e85404dd6376c893898126b..3006e2a6b909ea935a4fbc04e2eafccee5b43403 100644 (file)
@@ -148,8 +148,8 @@ static int pyrna_struct_anim_args_parse(
 
 /* internal use for insert and delete */
 static int pyrna_struct_keyframe_parse(
-        PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix,
-        const char **path_full, int *index, float *cfra, const char **group_name) /* return values */
+               PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix,
+               const char **path_full, int *index, float *cfra, const char **group_name) /* return values */
 {
        static const char *kwlist[]= {"data_path", "index", "frame", "group", NULL};
        const char *path;
index 85f950947a79435f522805ed0c155b528af9b2d6..134cbfda71f91cb170f0bab7b3eca75d443a3dfc 100644 (file)
@@ -60,7 +60,7 @@ static void cb_region_draw(const bContext *C, ARegion *UNUSED(ar), void *customd
        cb_args= PyTuple_GET_ITEM((PyObject *)customdata, 1);
        result= PyObject_CallObject(cb_func, cb_args);
 
-       if(result) {
+       if (result) {
                Py_DECREF(result);
        }
        else {
@@ -82,21 +82,22 @@ PyObject *pyrna_callback_add(BPy_StructRNA *self, PyObject *args)
        if (!PyArg_ParseTuple(args, "OO!|s:bpy_struct.callback_add", &cb_func, &PyTuple_Type, &cb_args, &cb_event_str))
                return NULL;
        
-       if(!PyCallable_Check(cb_func)) {
+       if (!PyCallable_Check(cb_func)) {
                PyErr_SetString(PyExc_TypeError, "callback_add(): first argument isn't callable");
                return NULL;
        }
 
-       if(RNA_struct_is_a(self->ptr.type, &RNA_Region)) {
-               if(cb_event_str) {
+       if (RNA_struct_is_a(self->ptr.type, &RNA_Region)) {
+               if (cb_event_str) {
                        static EnumPropertyItem region_draw_mode_items[]= {
                                {REGION_DRAW_POST_PIXEL, "POST_PIXEL", 0, "Post Pixel", ""},
                                {REGION_DRAW_POST_VIEW, "POST_VIEW", 0, "Post View", ""},
                                {REGION_DRAW_PRE_VIEW, "PRE_VIEW", 0, "Pre View", ""},
                                {0, NULL, 0, NULL, NULL}};
        
-                       if(pyrna_enum_value_from_id(region_draw_mode_items, cb_event_str, &cb_event, "bpy_struct.callback_add()") < 0)
+                       if (pyrna_enum_value_from_id(region_draw_mode_items, cb_event_str, &cb_event, "bpy_struct.callback_add()") < 0) {
                                return NULL;
+                       }
                }
                else {
                        cb_event= REGION_DRAW_POST_PIXEL;
@@ -124,12 +125,12 @@ PyObject *pyrna_callback_remove(BPy_StructRNA *self, PyObject *args)
 
        handle= PyCapsule_GetPointer(py_handle, RNA_CAPSULE_ID);
 
-       if(handle==NULL) {
+       if (handle==NULL) {
                PyErr_SetString(PyExc_ValueError, "callback_remove(handle): NULL handle given, invalid or already removed");
                return NULL;
        }
 
-       if(RNA_struct_is_a(self->ptr.type, &RNA_Region)) {
+       if (RNA_struct_is_a(self->ptr.type, &RNA_Region)) {
                customdata= ED_region_draw_cb_customdata(handle);
                Py_DECREF((PyObject *)customdata);
 
index 0da6329707756bd39eb37a60c9170fb4456f56d1..a155a7ec3d96ec796adb1e8b0be0de6e4e5d24f2 100644 (file)
@@ -184,7 +184,8 @@ static PyObject* GPU_export_shader(PyObject* UNUSED(self), PyObject *args, PyObj
                        PyErr_SetString(PyExc_SystemError, "scene.as_pointer() failed");
                        return NULL;
                }
-       } else {
+       }
+       else {
                PyErr_SetString(PyExc_TypeError, "gpu.export_shader() first argument should be of Scene type");
                return NULL;
        }
@@ -204,7 +205,8 @@ static PyObject* GPU_export_shader(PyObject* UNUSED(self), PyObject *args, PyObj
                        PyErr_SetString(PyExc_SystemError, "scene.as_pointer() failed");
                        return NULL;
                }
-       } else {
+       }
+       else {
                PyErr_SetString(PyExc_TypeError, "gpu.export_shader() second argument should be of Material type");
                return NULL;
        }
@@ -260,7 +262,8 @@ static PyObject* GPU_export_shader(PyObject* UNUSED(self), PyObject *args, PyObj
                if (attribute->name) {
                        if (attribute->name[0] != 0) {
                                PY_DICT_ADD_STRING(dict,attribute,name);
-                       } else {
+                       }
+                       else {
                                val = PyLong_FromLong(0);
                                PyDict_SetItemString(dict, "name", val);
                                Py_DECREF(val);
index 6a7f54d6f81d4d958c2a86ee74ca48b9b51ca834..5587028d81291d3bd66785c26eecbd86467b2a2e 100644 (file)
@@ -74,10 +74,10 @@ int mathutils_array_parse(float *array, int array_min, int array_max, PyObject *
 
 #if 1 /* approx 6x speedup for mathutils types */
 
-       if (    (size= VectorObject_Check(value)     ? ((VectorObject *)value)->size : 0) ||
-               (size= EulerObject_Check(value)      ? 3 : 0) ||
-               (size= QuaternionObject_Check(value) ? 4 : 0) ||
-               (size= ColorObject_Check(value)      ? 3 : 0))
+       if ( (size= VectorObject_Check(value)     ? ((VectorObject *)value)->size : 0) ||
+            (size= EulerObject_Check(value)      ? 3 : 0) ||
+            (size= QuaternionObject_Check(value) ? 4 : 0) ||
+            (size= ColorObject_Check(value)      ? 3 : 0))
        {
                if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) {
                        return -1;
@@ -138,10 +138,10 @@ int mathutils_array_parse_alloc(float **array, int array_min, PyObject *value, c
 
 #if 1 /* approx 6x speedup for mathutils types */
 
-       if (    (size= VectorObject_Check(value)     ? ((VectorObject *)value)->size : 0) ||
-               (size= EulerObject_Check(value)      ? 3 : 0) ||
-               (size= QuaternionObject_Check(value) ? 4 : 0) ||
-               (size= ColorObject_Check(value)      ? 3 : 0))
+       if ( (size= VectorObject_Check(value)     ? ((VectorObject *)value)->size : 0) ||
+            (size= EulerObject_Check(value)      ? 3 : 0) ||
+            (size= QuaternionObject_Check(value) ? 4 : 0) ||
+            (size= ColorObject_Check(value)      ? 3 : 0))
        {
                if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) {
                        return -1;
index 8409344a9fe871aed37c061751f51070670509a5..e46dda7560f55a7d3bc3e11a7ab07714d526cda0 100644 (file)
@@ -48,7 +48,7 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
                return NULL;
        }
 
-       switch(PyTuple_GET_SIZE(args)) {
+       switch (PyTuple_GET_SIZE(args)) {
        case 0:
                break;
        case 1:
index 7e769da14cb80d97f3fb30be97518350dd6ae4e3..f44c0b82a2d4e05e054a4fe5691a93d0a63f7fac 100644 (file)
@@ -59,7 +59,7 @@ static PyObject *Euler_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
        if (!PyArg_ParseTuple(args, "|Os:mathutils.Euler", &seq, &order_str))
                return NULL;
 
-       switch(PyTuple_GET_SIZE(args)) {
+       switch (PyTuple_GET_SIZE(args)) {
        case 0:
                break;
        case 2:
@@ -84,7 +84,7 @@ static const char *euler_order_str(EulerObject *self)
 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)) {
+               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;
index ea636ef52fbc0ee180551f14a99830f61f2b79f0..bc68d469fc1dc9e8ca6f51f0a55ea2cb514083cd 100644 (file)
@@ -123,7 +123,7 @@ static PyObject *Matrix_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
                return NULL;
        }
 
-       switch(PyTuple_GET_SIZE(args)) {
+       switch (PyTuple_GET_SIZE(args)) {
                case 0:
                        return Matrix_CreatePyObject(NULL, 4, 4, Py_NEW, type);
                case 1:
@@ -1307,7 +1307,7 @@ static PyObject *Matrix_repr(MatrixObject *self)
                        PyTuple_SET_ITEM(rows[x], y, PyFloat_FromDouble(self->matrix[x][y]));
                }
        }
-       switch(self->row_size) {
+       switch (self->row_size) {
        case 2: return PyUnicode_FromFormat("Matrix((%R,\n"
                                                                                "        %R))", rows[0], rows[1]);
 
index cf817003a986eac95d3a1e1fa420ca3aef885a24..7ab9b7b07138094a4042f6aa520fc1a04cc779f0 100644 (file)
@@ -1039,7 +1039,7 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw
        if (!PyArg_ParseTuple(args, "|Od:mathutils.Quaternion", &seq, &angle))
                return NULL;
 
-       switch(PyTuple_GET_SIZE(args)) {
+       switch (PyTuple_GET_SIZE(args)) {
        case 0:
                break;
        case 1:
@@ -1075,18 +1075,18 @@ static PyObject *quat__apply_to_copy(PyNoArgsFunction quat_func, QuaternionObjec
 static void quat__axis_angle_sanitize(float axis[3], float *angle)
 {
        if (axis) {
-               if (   !finite(axis[0]) ||
-                          !finite(axis[1]) ||
-                          !finite(axis[2]))
+               if ( !finite(axis[0]) ||
+                    !finite(axis[1]) ||
+                    !finite(axis[2]))
                {
                        axis[0]= 1.0f;
                        axis[1]= 0.0f;
                        axis[2]= 0.0f;
                }
-               else if (    EXPP_FloatsAreEqual(axis[0], 0.0f, 10) &&
-                                        EXPP_FloatsAreEqual(axis[1], 0.0f, 10) &&
-                                        EXPP_FloatsAreEqual(axis[2], 0.0f, 10)
-               {
+               else if ( EXPP_FloatsAreEqual(axis[0], 0.0f, 10) &&
+                         EXPP_FloatsAreEqual(axis[1], 0.0f, 10) &&
+                         EXPP_FloatsAreEqual(axis[2], 0.0f, 10))
+               {
                        axis[0] = 1.0f;
                }
        }
index a812311dad4601e88e607d75bebfec04422657e6..b9bfde58248f1e790e0d399b59c2d7b393ab4dad 100644 (file)
@@ -57,7 +57,7 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED
        float *vec= NULL;
        int size= 3; /* default to a 3D vector */
 
-       switch(PyTuple_GET_SIZE(args)) {
+       switch (PyTuple_GET_SIZE(args)) {
        case 0:
                vec= PyMem_Malloc(size * sizeof(float));
 
@@ -165,7 +165,7 @@ static PyObject *C_Vector_Range(PyObject *cls, PyObject *args)
                return NULL;
        }
 
-       switch(PyTuple_GET_SIZE(args)){
+       switch (PyTuple_GET_SIZE(args)) {
        case 1:
                size = start;
                start= 0;
@@ -430,7 +430,7 @@ static PyObject *Vector_resized(VectorObject *self, PyObject *value)
 
        /*if (!PyArg_ParseTuple(args, "i:resize", &size))
                return NULL;*/
-       if ((size = PyLong_AsLong(value)) == -1){
+       if ((size = PyLong_AsLong(value)) == -1) {
                return NULL;
        }
 
@@ -712,7 +712,7 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
 
                if (strlen(strack) == 2) {
                        if (strack[0] == '-') {
-                               switch(strack[1]) {
+                               switch (strack[1]) {
                                        case 'X':
                                                track = 3;
                                                break;
@@ -733,7 +733,7 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
                        }
                }
                else if (strlen(strack) == 1) {
-                       switch(strack[0]) {
+                       switch (strack[0]) {
                        case '-':
                        case 'X':
                                track = 0;
@@ -758,7 +758,7 @@ static PyObject *Vector_to_track_quat(VectorObject *self, PyObject *args)
        if (sup) {
                const char *axis_err_msg= "only X, Y or Z for up axis";
                if (strlen(sup) == 1) {
-                       switch(*sup) {
+                       switch (*sup) {
                        case 'X':
                                up = 0;
                                break;
index d3b6e2e8b29f9a60b532e10dbe2d7f7edb6a3fe1..f3a843baf66785da7d6b2409f28674e762e7cb37 100644 (file)
@@ -99,11 +99,11 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject*
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(vec1) == -1 ||
-               BaseMath_ReadCallback(vec2) == -1 ||
-               BaseMath_ReadCallback(vec3) == -1 ||
-               BaseMath_ReadCallback(ray)  == -1 ||
-               BaseMath_ReadCallback(ray_off) == -1)
+       if ( BaseMath_ReadCallback(vec1) == -1 ||
+            BaseMath_ReadCallback(vec2) == -1 ||
+            BaseMath_ReadCallback(vec3) == -1 ||
+            BaseMath_ReadCallback(ray)  == -1 ||
+            BaseMath_ReadCallback(ray_off) == -1)
        {
                return NULL;
        }
@@ -199,10 +199,10 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(vec1) == -1 ||
-               BaseMath_ReadCallback(vec2) == -1 ||
-               BaseMath_ReadCallback(vec3) == -1 ||
-               BaseMath_ReadCallback(vec4) == -1)
+       if ( BaseMath_ReadCallback(vec1) == -1 ||
+            BaseMath_ReadCallback(vec2) == -1 ||
+            BaseMath_ReadCallback(vec3) == -1 ||
+            BaseMath_ReadCallback(vec4) == -1)
        {
                return NULL;
        }
@@ -298,9 +298,9 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject* args)
                        return NULL;
                }
 
-               if (    BaseMath_ReadCallback(vec1) == -1 ||
-                       BaseMath_ReadCallback(vec2) == -1 ||
-                       BaseMath_ReadCallback(vec3) == -1)
+               if ( BaseMath_ReadCallback(vec1) == -1 ||
+                    BaseMath_ReadCallback(vec2) == -1 ||
+                    BaseMath_ReadCallback(vec3) == -1)
                {
                        return NULL;
                }
@@ -327,10 +327,10 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject* args)
                        return NULL;
                }
 
-               if (    BaseMath_ReadCallback(vec1) == -1 ||
-                       BaseMath_ReadCallback(vec2) == -1 ||
-                       BaseMath_ReadCallback(vec3) == -1 ||
-                       BaseMath_ReadCallback(vec4) == -1)
+               if ( BaseMath_ReadCallback(vec1) == -1 ||
+                    BaseMath_ReadCallback(vec2) == -1 ||
+                    BaseMath_ReadCallback(vec3) == -1 ||
+                    BaseMath_ReadCallback(vec4) == -1)
                {
                        return NULL;
                }
@@ -374,9 +374,9 @@ static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject* args)
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(vec1) == -1 ||
-               BaseMath_ReadCallback(vec2) == -1 ||
-               BaseMath_ReadCallback(vec3) == -1)
+       if ( BaseMath_ReadCallback(vec1) == -1 ||
+            BaseMath_ReadCallback(vec2) == -1 ||
+            BaseMath_ReadCallback(vec3) == -1)
        {
                return NULL;
        }
@@ -424,10 +424,10 @@ static PyObject *M_Geometry_intersect_line_line_2d(PyObject *UNUSED(self), PyObj
                return NULL;
        }
        
-       if (    BaseMath_ReadCallback(line_a1) == -1 ||
-               BaseMath_ReadCallback(line_a2) == -1 ||
-               BaseMath_ReadCallback(line_b1) == -1 ||
-               BaseMath_ReadCallback(line_b2) == -1)
+       if ( BaseMath_ReadCallback(line_a1) == -1 ||
+            BaseMath_ReadCallback(line_a2) == -1 ||
+            BaseMath_ReadCallback(line_b1) == -1 ||
+            BaseMath_ReadCallback(line_b2) == -1)
        {
                return NULL;
        }
@@ -474,10 +474,10 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(line_a) == -1 ||
-               BaseMath_ReadCallback(line_b) == -1 ||
-               BaseMath_ReadCallback(plane_co) == -1 ||
-               BaseMath_ReadCallback(plane_no) == -1) 
+       if ( BaseMath_ReadCallback(line_a) == -1 ||
+            BaseMath_ReadCallback(line_b) == -1 ||
+            BaseMath_ReadCallback(plane_co) == -1 ||
+            BaseMath_ReadCallback(plane_no) == -1)
        {
                return NULL;
        }
@@ -530,10 +530,10 @@ static PyObject *M_Geometry_intersect_plane_plane(PyObject *UNUSED(self), PyObje
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(plane_a_co) == -1 ||
-               BaseMath_ReadCallback(plane_a_no) == -1 ||
-               BaseMath_ReadCallback(plane_b_co) == -1 ||
-               BaseMath_ReadCallback(plane_b_no) == -1)
+       if ( BaseMath_ReadCallback(plane_a_co) == -1 ||
+            BaseMath_ReadCallback(plane_a_no) == -1 ||
+            BaseMath_ReadCallback(plane_b_co) == -1 ||
+            BaseMath_ReadCallback(plane_b_no) == -1)
        {
                return NULL;
        }
@@ -592,9 +592,9 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(line_a) == -1 ||
-               BaseMath_ReadCallback(line_b) == -1 ||
-               BaseMath_ReadCallback(sphere_co) == -1)
+       if ( BaseMath_ReadCallback(line_a) == -1 ||
+            BaseMath_ReadCallback(line_b) == -1 ||
+            BaseMath_ReadCallback(sphere_co) == -1)
        {
                return NULL;
        }
@@ -612,7 +612,7 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje
 
                PyObject *ret= PyTuple_New(2);
 
-               switch(isect_line_sphere_v3(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
+               switch (isect_line_sphere_v3(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
                case 1:
                        if (!(!clip || (((lambda= line_point_factor_v3(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a= FALSE;
                        use_b= FALSE;
@@ -672,9 +672,9 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(line_a) == -1 ||
-               BaseMath_ReadCallback(line_b) == -1 ||
-               BaseMath_ReadCallback(sphere_co) == -1)
+       if ( BaseMath_ReadCallback(line_a) == -1 ||
+            BaseMath_ReadCallback(line_b) == -1 ||
+            BaseMath_ReadCallback(sphere_co) == -1)
        {
                return NULL;
        }
@@ -685,7 +685,7 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO
 
                PyObject *ret= PyTuple_New(2);
 
-               switch(isect_line_sphere_v2(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
+               switch (isect_line_sphere_v2(line_a->vec, line_b->vec, sphere_co->vec, sphere_radius, isect_a, isect_b)) {
                case 1:
                        if (!(!clip || (((lambda= line_point_factor_v2(isect_a, line_a->vec, line_b->vec)) >= 0.0f) && (lambda <= 1.0f)))) use_a= FALSE;
                        use_b= FALSE;
@@ -737,9 +737,9 @@ static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObjec
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(pt) == -1 ||
-               BaseMath_ReadCallback(line_1) == -1 ||
-               BaseMath_ReadCallback(line_2) == -1)
+       if ( BaseMath_ReadCallback(pt) == -1 ||
+            BaseMath_ReadCallback(line_1) == -1 ||
+            BaseMath_ReadCallback(line_2) == -1)
        {
                return NULL;
        }
@@ -791,10 +791,10 @@ static PyObject *M_Geometry_intersect_point_tri_2d(PyObject *UNUSED(self), PyObj
                return NULL;
        }
        
-       if (    BaseMath_ReadCallback(pt_vec) == -1 ||
-               BaseMath_ReadCallback(tri_p1) == -1 ||
-               BaseMath_ReadCallback(tri_p2) == -1 ||
-               BaseMath_ReadCallback(tri_p3) == -1)
+       if ( BaseMath_ReadCallback(pt_vec) == -1 ||
+            BaseMath_ReadCallback(tri_p1) == -1 ||
+            BaseMath_ReadCallback(tri_p2) == -1 ||
+            BaseMath_ReadCallback(tri_p3) == -1)
        {
                return NULL;
        }
@@ -834,11 +834,11 @@ static PyObject *M_Geometry_intersect_point_quad_2d(PyObject *UNUSED(self), PyOb
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(pt_vec) == -1  ||
-               BaseMath_ReadCallback(quad_p1) == -1 ||
-               BaseMath_ReadCallback(quad_p2) == -1 ||
-               BaseMath_ReadCallback(quad_p3) == -1 ||
-               BaseMath_ReadCallback(quad_p4) == -1)
+       if ( BaseMath_ReadCallback(pt_vec)  == -1 ||
+            BaseMath_ReadCallback(quad_p1) == -1 ||
+            BaseMath_ReadCallback(quad_p2) == -1 ||
+            BaseMath_ReadCallback(quad_p3) == -1 ||
+            BaseMath_ReadCallback(quad_p4) == -1)
        {
                return NULL;
        }
@@ -872,9 +872,9 @@ static PyObject *M_Geometry_distance_point_to_plane(PyObject *UNUSED(self), PyOb
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(pt) == -1 ||
-               BaseMath_ReadCallback(plene_co) == -1 ||
-               BaseMath_ReadCallback(plane_no) == -1)
+       if ( BaseMath_ReadCallback(pt) == -1 ||
+            BaseMath_ReadCallback(plene_co) == -1 ||
+            BaseMath_ReadCallback(plane_no) == -1)
        {
                return NULL;
        }
@@ -993,10 +993,10 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject*
                return NULL;
        }
 
-       if (    BaseMath_ReadCallback(vec_k1) == -1 ||
-               BaseMath_ReadCallback(vec_h1) == -1 ||
-               BaseMath_ReadCallback(vec_k2) == -1 ||
-               BaseMath_ReadCallback(vec_h2) == -1)
+       if ( BaseMath_ReadCallback(vec_k1) == -1 ||
+            BaseMath_ReadCallback(vec_h1) == -1 ||
+            BaseMath_ReadCallback(vec_k2) == -1 ||
+            BaseMath_ReadCallback(vec_h2) == -1)
        {
                return NULL;
        }
index 09337d9a23b90d9ae8dcae8e760d3798ce634277..c0e8ac24baaa5fce93ce75555498476ba29036a4 100644 (file)
@@ -201,7 +201,7 @@ static void rand_vn(float *array_tar, const int size)
 {
        float *array_pt= array_tar + (size-1);
        int i= size;
-       while(i--) { *(array_pt--) = 2.0f * frand() - 1.0f; }
+       while (i--) { *(array_pt--) = 2.0f * frand() - 1.0f; }
 }
 
 /* Fills an array of length 3 with noise values */