-- Fix bugs caused (by me) by incorrect use of Py_RETURN_NONE macro in
authorKen Hughes <khughes@pacific.edu>
Mon, 28 Nov 2005 05:21:25 +0000 (05:21 +0000)
committerKen Hughes <khughes@pacific.edu>
Mon, 28 Nov 2005 05:21:25 +0000 (05:21 +0000)
   "if" statements.  The macro defined in gen_utils.h expands to two
   statements; putting after an "if" statement without {} means the second
   statement should always be executed.  I'm not sure if just putting
   braces around both statements would cause other compilers to complain.
   But this explains an earlier bug in the Object module which only
   appeared on MacOS/X.

source/blender/python/api2_2x/Key.c
source/blender/python/api2_2x/Object.c

index d57c7a60d9b608a729895df3084c9eba81b7fa3d..e71602ad6b41f8839c4589496c7c50c8a0b8bb1d 100644 (file)
@@ -530,8 +530,9 @@ static PyObject *KeyBlock_getData( PyObject * self )
        BPy_KeyBlock *kb = ( BPy_KeyBlock * ) self;
        Key *key = kb->key;
 
-       if( !kb->keyblock->data )
+       if( !kb->keyblock->data ) {
                Py_RETURN_NONE;
+       }
 
        l = PyList_New( kb->keyblock->totelem );
        if( !l )
index ae6b3ec89a4f37740624181a88ee3927d24099fd..f88aa01aea6c3addd6f313f1fc27414eee85c066 100644 (file)
@@ -2760,8 +2760,9 @@ static PyObject *Object_getAttr( BPy_Object * obj, char *name )
        if( StringEqual( name, "parent" ) ) {
                if( object->parent )
                        return Object_CreatePyObject( object->parent );
-               else
+               else {
                        Py_RETURN_NONE;
+               }
        }
        if( StringEqual( name, "parentbonename" ) ) {
                if( object->parent && object->parsubstr[0] )