From bfe42eea43ab7731f92b75c9ecae3098a02a7fc7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 18 Mar 2006 15:23:02 +0000 Subject: [PATCH] Moved declerations to the top of the skope so as to work with MSVC? started removeing // from constant.h to shut GCC's -pedantic up. realized // are used everywhere. --- source/blender/python/api2_2x/Group.c | 25 ++++++++++-------------- source/blender/python/api2_2x/constant.h | 8 ++++---- 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/source/blender/python/api2_2x/Group.c b/source/blender/python/api2_2x/Group.c index 5034ddfb050..513efa71d41 100755 --- a/source/blender/python/api2_2x/Group.c +++ b/source/blender/python/api2_2x/Group.c @@ -10,20 +10,11 @@ #include "BKE_scene.h" #include "BKE_group.h" -#include "BSE_edit.h" - -#include "BLI_arithb.h" #include "BLI_blenlib.h" -#include "BDR_editobject.h" -#include "BDR_editcurve.h" - -#include "MEM_guardedalloc.h" - -#include "mydevice.h" #include "blendef.h" #include "Object.h" -#include "gen_utils.h" + /*****************************************************************************/ /* Python API function prototypes for the Blender module. */ @@ -85,15 +76,16 @@ static PyObject *M_Group_getObjects( BPy_Group * self ) return (PyObject *)seq; } - +/* only for internal use Blender.Group.Get("MyGroup").objects= []*/ static int M_Group_setObjects( BPy_Group * self, PyObject * args ) { int i; Group *group; - group= self->group; Object *blen_ob; Base *base; + group= self->group; + if( PyList_Check( args ) ) { if( EXPP_check_sequence_consistency( args, &Object_Type ) != 1) return EXPP_ReturnIntError( PyExc_TypeError, @@ -159,11 +151,12 @@ static int Group_setName( BPy_Group * self, PyObject * value ) static PyObject *Group_getName( BPy_Group * self, PyObject * args ) { + PyObject *attr; if( !(self->group) ) return EXPP_ReturnPyObjError( PyExc_RuntimeError, "Blender Group was deleted!" ); - PyObject *attr = PyString_FromString( self->group->id.name + 2 ); + attr = PyString_FromString( self->group->id.name + 2 ); if( attr ) return attr; @@ -294,12 +287,13 @@ PyObject *M_Group_New( PyObject * self, PyObject * args ) char *name = "Group"; char buf[21]; BPy_Group *py_group; /* for Group Data object wrapper in Python */ + struct Group *bl_group; if( !PyArg_ParseTuple( args, "|s", &name ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, "string expected as argument" ); - struct Group *bl_group= add_group(); + bl_group= add_group(); if( bl_group ) /* now create the wrapper grp in Python */ py_group = ( BPy_Group * ) Group_CreatePyObject( bl_group ); @@ -396,12 +390,13 @@ PyObject *M_Group_Unlink( PyObject * self, PyObject * args ) { PyObject *pyob=NULL; BPy_Group *pygrp=NULL; + Group *group; if( !PyArg_ParseTuple( args, "O!", &Group_Type, &pyob) ) return ( EXPP_ReturnPyObjError( PyExc_TypeError, "expected a group" ) ); pygrp= (BPy_Group *)pyob; - Group *group= pygrp->group; + group= pygrp->group; if( !group ) return EXPP_ReturnPyObjError( PyExc_RuntimeError, diff --git a/source/blender/python/api2_2x/constant.h b/source/blender/python/api2_2x/constant.h index aeeb9675495..a3eb7e98e0d 100644 --- a/source/blender/python/api2_2x/constant.h +++ b/source/blender/python/api2_2x/constant.h @@ -35,16 +35,16 @@ #include -//-------------------TYPE CHECKS--------------------------------- +/*-------------------TYPE CHECKS-------------------------------*/ #define BPy_Constant_Check(v) ((v)->ob_type==&constant_Type) -//-------------------TYPEOBJECT---------------------------------- +/*-------------------TYPEOBJECT--------------------------------*/ extern PyTypeObject constant_Type; -//-------------------STRUCT DEFINITION--------------------------- +/*-------------------STRUCT DEFINITION-------------------------*/ typedef struct { PyObject_HEAD PyObject * dict; } BPy_constant; -//-------------------VISIBLE PROTOTYPES------------------------- +/*-------------------VISIBLE PROTOTYPES-----------------------*/ PyObject *PyConstant_New(void); int PyConstant_Insert(BPy_constant *self, char *name, PyObject *value); PyObject *PyConstant_NewInt(char *name, int value);