Some of the setattr functions created a tuple to pass to the set* functions and didn't decref'ed it properly, "leaking" memory.

Commit approved by stivs.
This commit is contained in:
2005-06-17 05:10:14 +00:00
parent 2a640f03cd
commit 5f5844b95e
9 changed files with 202 additions and 161 deletions

View File

@@ -309,7 +309,7 @@ int BuildSetAttr( BPy_Build * self, char *name, PyObject * value )
( PyExc_KeyError, "attribute not found" ) ); ( PyExc_KeyError, "attribute not found" ) );
} }
/* Py_DECREF(valtuple); */ Py_DECREF(valtuple);
if( error != Py_None ) if( error != Py_None )
return -1; return -1;

View File

@@ -843,12 +843,9 @@ static PyObject *Camera_getAttr( BPy_Camera * self, char *name )
attr = PyFloat_FromDouble( self->camera->drawsize ); attr = PyFloat_FromDouble( self->camera->drawsize );
else if( strcmp( name, "users" ) == 0 ) else if( strcmp( name, "users" ) == 0 )
attr = PyInt_FromLong( self->camera->id.us ); attr = PyInt_FromLong( self->camera->id.us );
else if( strcmp( name, "ipo" ) == 0 ) { else if( strcmp( name, "ipo" ) == 0 )
Ipo *ipo = self->camera->ipo; /* getIpo can return None and that is a valid value, so need to return straightaway */
if( ipo ) return Camera_getIpo(self);
attr = Ipo_CreatePyObject( ipo );
}
else if( strcmp( name, "Types" ) == 0 ) { else if( strcmp( name, "Types" ) == 0 ) {
attr = Py_BuildValue( "{s:h,s:h}", "persp", attr = Py_BuildValue( "{s:h,s:h}", "persp",
EXPP_CAM_TYPE_PERSP, "ortho", EXPP_CAM_TYPE_PERSP, "ortho",

View File

@@ -1514,6 +1514,8 @@ static int CurveSetAttr( BPy_Curve * self, char *name, PyObject * value )
error = Curve_setName( self, valtuple ); error = Curve_setName( self, valtuple );
else if( strcmp( name, "pathlen" ) == 0 ) else if( strcmp( name, "pathlen" ) == 0 )
error = Curve_setPathLen( self, valtuple ); error = Curve_setPathLen( self, valtuple );
else if( strcmp( name, "bevresol" ) == 0 )
error = Curve_setBevresol( self, valtuple );
else if( strcmp( name, "resolu" ) == 0 ) else if( strcmp( name, "resolu" ) == 0 )
error = Curve_setResolu( self, valtuple ); error = Curve_setResolu( self, valtuple );
else if( strcmp( name, "resolv" ) == 0 ) else if( strcmp( name, "resolv" ) == 0 )

View File

@@ -867,7 +867,7 @@ static int Lattice_setAttr( BPy_Lattice * self, char *name, PyObject * value )
if( strcmp( name, "name" ) == 0 ) if( strcmp( name, "name" ) == 0 )
error = Lattice_setName( self, valtuple ); error = Lattice_setName( self, valtuple );
else { // Error: no such member in the Lattice Data structure else { // Error: no such member in the Lattice Data structure
Py_DECREF( value ); /*Py_DECREF( value ); borrowed reference, no need to decref */
Py_DECREF( valtuple ); Py_DECREF( valtuple );
return ( EXPP_ReturnIntError( PyExc_KeyError, return ( EXPP_ReturnIntError( PyExc_KeyError,
"attribute not found or immutable" ) ); "attribute not found or immutable" ) );

View File

@@ -1105,6 +1105,7 @@ static PyObject *MetaballGetAttr( BPy_Metaball * self, char *name )
/****************************************************************************/ /****************************************************************************/
static int MetaballSetAttr( BPy_Metaball * self, char *name, PyObject * value ) static int MetaballSetAttr( BPy_Metaball * self, char *name, PyObject * value )
{ {
PyObject *result = NULL;
PyObject *valtuple = Py_BuildValue( "(O)", value ); PyObject *valtuple = Py_BuildValue( "(O)", value );
if( !valtuple ) if( !valtuple )
@@ -1112,25 +1113,29 @@ static int MetaballSetAttr( BPy_Metaball * self, char *name, PyObject * value )
"MetaballSetAttr: couldn't create PyTuple" ); "MetaballSetAttr: couldn't create PyTuple" );
if( strcmp( name, "name" ) == 0 ) { if( strcmp( name, "name" ) == 0 ) {
Metaball_setName( self, valtuple ); result = Metaball_setName( self, valtuple );
return 0; }
else if( strcmp( name, "rot" ) == 0 ) {
result = Metaball_setrot( self, valtuple );
}
else if( strcmp( name, "loc" ) == 0 ) {
result = Metaball_setloc( self, valtuple );
} }
if( strcmp( name, "rot" ) == 0 ) { else if( strcmp( name, "size" ) == 0 ) {
Metaball_setrot( self, valtuple ); result = Metaball_setsize( self, valtuple );
return 0;
} }
if( strcmp( name, "loc" ) == 0 ) { else {
Metaball_setloc( self, valtuple ); Py_DECREF(valtuple);
return 0; return ( EXPP_ReturnIntError
( PyExc_KeyError, "attribute not found" ) );
} }
Py_DECREF(valtuple);
if( strcmp( name, "size" ) == 0 ) { if (result != Py_None) {
Metaball_setsize( self, valtuple ); return -1;
return 0;
} }
return ( EXPP_ReturnIntError Py_DECREF(Py_None);
( PyExc_KeyError, "attribute not found" ) ); return 0;
} }

View File

@@ -2475,6 +2475,7 @@ static PyObject *Object_getAttr( BPy_Object * obj, char *name )
return ( Py_BuildValue return ( Py_BuildValue
( "fff", object->dsize[0], object->dsize[1], ( "fff", object->dsize[0], object->dsize[1],
object->dsize[2] ) ); object->dsize[2] ) );
/* no IKA anymore, I think we can remove this. (theeth)
if( strncmp( name, "Eff", 3 ) == 0 ) { if( strncmp( name, "Eff", 3 ) == 0 ) {
if( ( object->type == OB_IKA ) && ( object->data != NULL ) ) { if( ( object->type == OB_IKA ) && ( object->data != NULL ) ) {
ika = object->data; ika = object->data;
@@ -2486,12 +2487,13 @@ static PyObject *Object_getAttr( BPy_Object * obj, char *name )
case 'Z': case 'Z':
return ( PyFloat_FromDouble( ika->effg[2] ) ); return ( PyFloat_FromDouble( ika->effg[2] ) );
default: default:
/* Do we need to display a sensible error message here? */ // Do we need to display a sensible error message here?
return ( NULL ); return ( NULL );
} }
} }
return ( NULL ); return ( NULL );
} }
*/
/* accept both Layer (old, for compatibility) and Layers */ /* accept both Layer (old, for compatibility) and Layers */
if( strncmp( name, "Layer", 5 ) == 0) if( strncmp( name, "Layer", 5 ) == 0)
return ( PyInt_FromLong( object->lay ) ); return ( PyInt_FromLong( object->lay ) );
@@ -2567,6 +2569,20 @@ static PyObject *Object_getAttr( BPy_Object * obj, char *name )
return ( Py_BuildValue( "s", object->id.name + 2 ) ); return ( Py_BuildValue( "s", object->id.name + 2 ) );
if( StringEqual( name, "sel" ) ) if( StringEqual( name, "sel" ) )
return ( Object_isSelected( obj ) ); return ( Object_isSelected( obj ) );
if( StringEqual( name, "DupSta" ) )
return PyInt_FromLong( obj->object->dupsta );
if( StringEqual( name, "DupEnd" ) )
return PyInt_FromLong( obj->object->dupend );
if( StringEqual( name, "DupOn" ) )
return PyInt_FromLong( obj->object->dupon );
if( StringEqual( name, "DupOff" ) )
return PyInt_FromLong( obj->object->dupoff );
if( StringEqual( name, "Dupliframes" ) ){
if (obj->object->transflag & OB_DUPLIFRAMES)
return EXPP_incr_ret_True();
else
return EXPP_incr_ret_False();
}
if (StringEqual (name, "oopsLoc")) { if (StringEqual (name, "oopsLoc")) {
if (G.soops) { if (G.soops) {
Oops *oops= G.soops->oops.first; Oops *oops= G.soops->oops.first;
@@ -2594,56 +2610,48 @@ static PyObject *Object_getAttr( BPy_Object * obj, char *name )
/*****************************************************************************/ /*****************************************************************************/
static int Object_setAttr( BPy_Object * obj, char *name, PyObject * value ) static int Object_setAttr( BPy_Object * obj, char *name, PyObject * value )
{ {
PyObject *valtuple; PyObject *valtuple, *result=NULL;
struct Object *object; struct Object *object;
struct Ika *ika; struct Ika *ika;
/* First put the value(s) in a tuple. For some variables, we want to */
/* pass the values to a function, and these functions only accept */
/* PyTuples. */
valtuple = Py_BuildValue( "(O)", value );
if( !valtuple ) {
return EXPP_ReturnIntError( PyExc_MemoryError,
"Object_setAttr: couldn't create PyTuple" );
}
object = obj->object; object = obj->object;
/* Handle all properties which are Read Only */
if( StringEqual( name, "parent" ) )
return EXPP_ReturnIntError( PyExc_AttributeError,
"Setting the parent is not allowed." );
if( StringEqual( name, "data" ) )
return EXPP_ReturnIntError( PyExc_AttributeError,
"Setting the data is not allowed." );
if( StringEqual( name, "ipo" ) )
return EXPP_ReturnIntError( PyExc_AttributeError,
"Setting the ipo is not allowed." );
if( StringEqual( name, "mat" ) )
return EXPP_ReturnIntError( PyExc_AttributeError,
"Not allowed. Please use .setMatrix(matrix)" );
if( StringEqual( name, "matrix" ) )
return EXPP_ReturnIntError( PyExc_AttributeError,
"Not allowed. Please use .setMatrix(matrix)" );
/* FIRST, do attributes that are diretly changed */
if( StringEqual( name, "LocX" ) ) if( StringEqual( name, "LocX" ) )
return ( !PyArg_Parse( value, "f", &( object->loc[0] ) ) ); return ( !PyArg_Parse( value, "f", &( object->loc[0] ) ) );
if( StringEqual( name, "LocY" ) ) if( StringEqual( name, "LocY" ) )
return ( !PyArg_Parse( value, "f", &( object->loc[1] ) ) ); return ( !PyArg_Parse( value, "f", &( object->loc[1] ) ) );
if( StringEqual( name, "LocZ" ) ) if( StringEqual( name, "LocZ" ) )
return ( !PyArg_Parse( value, "f", &( object->loc[2] ) ) ); return ( !PyArg_Parse( value, "f", &( object->loc[2] ) ) );
if( StringEqual( name, "loc" ) ) {
if( Object_setLocation( obj, valtuple ) != Py_None )
return ( -1 );
else
return ( 0 );
}
if( StringEqual( name, "dLocX" ) ) if( StringEqual( name, "dLocX" ) )
return ( !PyArg_Parse( value, "f", &( object->dloc[0] ) ) ); return ( !PyArg_Parse( value, "f", &( object->dloc[0] ) ) );
if( StringEqual( name, "dLocY" ) ) if( StringEqual( name, "dLocY" ) )
return ( !PyArg_Parse( value, "f", &( object->dloc[1] ) ) ); return ( !PyArg_Parse( value, "f", &( object->dloc[1] ) ) );
if( StringEqual( name, "dLocZ" ) ) if( StringEqual( name, "dLocZ" ) )
return ( !PyArg_Parse( value, "f", &( object->dloc[2] ) ) ); return ( !PyArg_Parse( value, "f", &( object->dloc[2] ) ) );
if( StringEqual( name, "dloc" ) ) {
if( Object_setDeltaLocation( obj, valtuple ) != Py_None )
return ( -1 );
else
return ( 0 );
}
if( StringEqual( name, "RotX" ) ) if( StringEqual( name, "RotX" ) )
return ( !PyArg_Parse( value, "f", &( object->rot[0] ) ) ); return ( !PyArg_Parse( value, "f", &( object->rot[0] ) ) );
if( StringEqual( name, "RotY" ) ) if( StringEqual( name, "RotY" ) )
return ( !PyArg_Parse( value, "f", &( object->rot[1] ) ) ); return ( !PyArg_Parse( value, "f", &( object->rot[1] ) ) );
if( StringEqual( name, "RotZ" ) ) if( StringEqual( name, "RotZ" ) )
return ( !PyArg_Parse( value, "f", &( object->rot[2] ) ) ); return ( !PyArg_Parse( value, "f", &( object->rot[2] ) ) );
if( StringEqual( name, "rot" ) ) {
if( Object_setEuler( obj, valtuple ) != Py_None )
return ( -1 );
else
return ( 0 );
}
if( StringEqual( name, "dRotX" ) ) if( StringEqual( name, "dRotX" ) )
return ( !PyArg_Parse( value, "f", &( object->drot[0] ) ) ); return ( !PyArg_Parse( value, "f", &( object->drot[0] ) ) );
if( StringEqual( name, "dRotY" ) ) if( StringEqual( name, "dRotY" ) )
@@ -2674,26 +2682,33 @@ static int Object_setAttr( BPy_Object * obj, char *name, PyObject * value )
return ( !PyArg_ParseTuple return ( !PyArg_ParseTuple
( value, "fff", &( object->dsize[0] ), ( value, "fff", &( object->dsize[0] ),
&( object->dsize[1] ), &( object->dsize[2] ) ) ); &( object->dsize[1] ), &( object->dsize[2] ) ) );
if( strncmp( name, "Eff", 3 ) == 0 ) { if( StringEqual( name, "DupSta" ) )
if( ( object->type == OB_IKA ) && ( object->data != NULL ) ) { return ( !PyArg_Parse( value, "h", &( object->dupsta ) ) );
ika = object->data;
switch ( name[3] ) { if( StringEqual( name, "DupEnd" ) )
case 'X': return ( !PyArg_Parse( value, "h", &( object->dupend ) ) );
return ( !PyArg_Parse
( value, "f", &( ika->effg[0] ) ) ); if( StringEqual( name, "DupOn" ) )
case 'Y': return ( !PyArg_Parse( value, "h", &( object->dupon ) ) );
return ( !PyArg_Parse
( value, "f", &( ika->effg[1] ) ) ); if( StringEqual( name, "DupOff" ) )
case 'Z': return ( !PyArg_Parse( value, "h", &( object->dupoff ) ) );
return ( !PyArg_Parse
( value, "f", &( ika->effg[2] ) ) ); if( StringEqual( name, "Dupliframes" ) ) {
default: short dupli;
/* Do we need to display a sensible error message here? */ if ( !PyArg_Parse( value, "h", &dupli ) )
return ( 0 ); return -1;
}
} if (dupli)
return ( 0 ); obj->object->transflag |= OB_DUPLIFRAMES;
else
obj->object->transflag &= ~OB_DUPLIFRAMES;
return 0;
} }
if( StringEqual( name, "colbits" ) )
return ( !PyArg_Parse( value, "h", &( object->colbits ) ) );
/* accept both Layer (for compatibility) and Layers */ /* accept both Layer (for compatibility) and Layers */
if( strncmp( name, "Layer", 5 ) == 0 ) { if( strncmp( name, "Layer", 5 ) == 0 ) {
/* usage note: caller of this func needs to do a /* usage note: caller of this func needs to do a
@@ -2710,9 +2725,10 @@ static int Object_setAttr( BPy_Object * obj, char *name, PyObject * value )
/* uppper 2 nibbles are for local view */ /* uppper 2 nibbles are for local view */
newLayer &= 0x00FFFFFF; newLayer &= 0x00FFFFFF;
if( newLayer == 0 ) if( newLayer == 0 ) {
return EXPP_ReturnIntError( PyExc_AttributeError, return EXPP_ReturnIntError( PyExc_AttributeError,
"bitmask must have from 1 up to 20 bits set"); "bitmask must have from 1 up to 20 bits set");
}
/* update any bases pointing to our object */ /* update any bases pointing to our object */
base = FIRSTBASE; /* first base in current scene */ base = FIRSTBASE; /* first base in current scene */
@@ -2777,63 +2793,6 @@ static int Object_setAttr( BPy_Object * obj, char *name, PyObject * value )
return ( 0 ); return ( 0 );
} }
if( StringEqual( name, "parent" ) ) {
/* This is not allowed. */
return EXPP_ReturnIntError( PyExc_AttributeError,
"Setting the parent is not allowed." );
}
if( StringEqual( name, "track" ) ) {
if( Object_makeTrack( obj, valtuple ) != Py_None )
return ( -1 );
else
return ( 0 );
}
if( StringEqual( name, "data" ) ) {
/* This is not allowed. */
return EXPP_ReturnIntError( PyExc_AttributeError,
"Setting the data is not allowed." );
}
if( StringEqual( name, "ipo" ) ) {
/* This is not allowed. */
return EXPP_ReturnIntError( PyExc_AttributeError,
"Setting the ipo is not allowed." );
}
if( StringEqual( name, "mat" ) ) {
/* This is not allowed. */
return EXPP_ReturnIntError( PyExc_AttributeError,
"Setting the matrix is not allowed." );
}
if( StringEqual( name, "matrix" ) ) {
/* This is not allowed. */
return EXPP_ReturnIntError( PyExc_AttributeError,
"Please use .setMatrix(matrix)" );
}
if( StringEqual( name, "colbits" ) )
return ( !PyArg_Parse( value, "h", &( object->colbits ) ) );
if( StringEqual( name, "drawType" ) ) {
if( Object_setDrawType( obj, valtuple ) != Py_None )
return ( -1 );
else
return ( 0 );
}
if( StringEqual( name, "drawMode" ) ) {
if( Object_setDrawMode( obj, valtuple ) != Py_None )
return ( -1 );
else
return ( 0 );
}
if( StringEqual( name, "name" ) ) {
if( Object_setName( obj, valtuple ) != Py_None )
return ( -1 );
else
return ( 0 );
}
if( StringEqual( name, "sel" ) ) {
if( Object_Select( obj, valtuple ) != Py_None )
return ( -1 );
else
return ( 0 );
}
if (StringEqual (name, "oopsLoc")) { if (StringEqual (name, "oopsLoc")) {
if (G.soops) { if (G.soops) {
Oops *oops= G.soops->oops.first; Oops *oops= G.soops->oops.first;
@@ -2848,8 +2807,73 @@ static int Object_setAttr( BPy_Object * obj, char *name, PyObject * value )
} }
return 0; return 0;
} }
/*
IKA isn't even in Blender anymore, I think we can remove this... (theeth)
if( strncmp( name, "Eff", 3 ) == 0 ) {
if( ( object->type == OB_IKA ) && ( object->data != NULL ) ) {
ika = object->data;
switch ( name[3] ) {
case 'X':
return ( !PyArg_Parse
( value, "f", &( ika->effg[0] ) ) );
case 'Y':
return ( !PyArg_Parse
( value, "f", &( ika->effg[1] ) ) );
case 'Z':
return ( !PyArg_Parse
( value, "f", &( ika->effg[2] ) ) );
default:
// Do we need to display a sensible error message here?
return ( 0 );
}
}
return ( 0 );
}
*/
return EXPP_ReturnIntError( PyExc_KeyError, "attribute not found" ); /* SECOND, handle all the attributes that passes the value as a tuple to another function */
/* Put the value(s) in a tuple. For some variables, we want to */
/* pass the values to a function, and these functions only accept */
/* PyTuples. */
valtuple = Py_BuildValue( "(O)", value );
if( !valtuple ) {
return EXPP_ReturnIntError( PyExc_MemoryError,
"Object_setAttr: couldn't create PyTuple" );
}
/* Call the setFunctions to handle it */
if( StringEqual( name, "loc" ) )
result = Object_setLocation( obj, valtuple );
else if( StringEqual( name, "dloc" ) )
result = Object_setDeltaLocation( obj, valtuple );
else if( StringEqual( name, "rot" ) )
result = Object_setEuler( obj, valtuple );
else if( StringEqual( name, "track" ) )
result = Object_makeTrack( obj, valtuple );
else if( StringEqual( name, "drawType" ) )
result = Object_setDrawType( obj, valtuple );
else if( StringEqual( name, "drawMode" ) )
result = Object_setDrawMode( obj, valtuple );
else if( StringEqual( name, "name" ) )
result = Object_setName( obj, valtuple );
else if( StringEqual( name, "sel" ) )
result = Object_Select( obj, valtuple );
else { /* if it turns out here, it's not an attribute*/
Py_DECREF(valtuple);
return EXPP_ReturnIntError( PyExc_KeyError, "attribute not found" );
}
/* valtuple won't be returned to the caller, so we need to DECREF it */
Py_DECREF(valtuple);
if( result != Py_None )
return -1; /* error return */
/* Py_None was incref'ed by the called Scene_set* function. We probably
* don't need to decref Py_None (!), but since Python/C API manual tells us
* to treat it like any other PyObject regarding ref counting ... */
Py_DECREF( Py_None );
return 0; /* normal return */
} }
/*****************************************************************************/ /*****************************************************************************/
@@ -3923,17 +3947,17 @@ int setupSB(Object* ob){
} }
if(ob->soft){ if(ob->soft){
ob->soft->nodemass = 1.0; ob->soft->nodemass = 1.0f;
ob->soft->grav = 0.0; ob->soft->grav = 0.0f;
ob->soft->mediafrict = 0.5; ob->soft->mediafrict = 0.5f;
ob->soft->rklimit = 0.1; ob->soft->rklimit = 0.1f;
ob->soft->goalspring = 0.5; ob->soft->goalspring = 0.5f;
ob->soft->goalfrict = 0.0; ob->soft->goalfrict = 0.0f;
ob->soft->mingoal = 0.0; ob->soft->mingoal = 0.0f;
ob->soft->maxgoal = 1.0; ob->soft->maxgoal = 1.0f;
ob->soft->inspring = 0.5; ob->soft->inspring = 0.5f;
ob->soft->infrict = 0.5; ob->soft->infrict = 0.5f;
ob->soft->defgoal = 0.7; ob->soft->defgoal = 0.7f;
return 1; return 1;
} }
else { else {

View File

@@ -880,7 +880,7 @@ int ParticleSetAttr( BPy_Particle * self, char *name, PyObject * value )
"attribute not found" ) ); "attribute not found" ) );
} }
/*Py_DECREF(valtuple); */ Py_DECREF(valtuple);
if( error != Py_None ) if( error != Py_None )
return -1; return -1;

View File

@@ -539,7 +539,7 @@ int WaveSetAttr( BPy_Wave * self, char *name, PyObject * value )
"attribute not found" ) ); "attribute not found" ) );
} }
/*Py_DECREF(valtuple); */ Py_DECREF(valtuple);
if( error != Py_None ) if( error != Py_None )
return -1; return -1;

View File

@@ -957,30 +957,43 @@ static PyObject *World_GetAttr( BPy_World * self, char *name )
static int World_SetAttr( BPy_World * self, char *name, PyObject * value ) static int World_SetAttr( BPy_World * self, char *name, PyObject * value )
{ {
PyObject *error=NULL;
PyObject *valtuple = Py_BuildValue( "(O)", value ); PyObject *valtuple = Py_BuildValue( "(O)", value );
if( !valtuple ) if( !valtuple )
return EXPP_ReturnIntError( PyExc_MemoryError, return EXPP_ReturnIntError( PyExc_MemoryError,
"WorldSetAttr: couldn't parse args" ); "WorldSetAttr: couldn't parse args" );
if( strcmp( name, "name" ) == 0 ) else if( strcmp( name, "name" ) == 0 )
World_setName( self, valtuple ); error = World_setName( self, valtuple );
if( strcmp( name, "skytype" ) == 0 ) else if( strcmp( name, "skytype" ) == 0 )
World_setSkytype( self, valtuple ); error = World_setSkytype( self, valtuple );
if( strcmp( name, "mode" ) == 0 ) else if( strcmp( name, "mode" ) == 0 )
World_setMode( self, valtuple ); error = World_setMode( self, valtuple );
if( strcmp( name, "mistype" ) == 0 ) else if( strcmp( name, "mistype" ) == 0 )
World_setMistype( self, valtuple ); error = World_setMistype( self, valtuple );
if( strcmp( name, "hor" ) == 0 ) else if( strcmp( name, "hor" ) == 0 )
World_setHor( self, valtuple ); error = World_setHor( self, valtuple );
if( strcmp( name, "zen" ) == 0 ) else if( strcmp( name, "zen" ) == 0 )
World_setZen( self, valtuple ); error = World_setZen( self, valtuple );
if( strcmp( name, "amb" ) == 0 ) else if( strcmp( name, "amb" ) == 0 )
World_setAmb( self, valtuple ); error = World_setAmb( self, valtuple );
if( strcmp( name, "star" ) == 0 ) else if( strcmp( name, "star" ) == 0 )
World_setStar( self, valtuple ); error = World_setStar( self, valtuple );
if( strcmp( name, "mist" ) == 0 ) else if( strcmp( name, "mist" ) == 0 )
World_setMist( self, valtuple ); error = World_setMist( self, valtuple );
return 0; /* normal exit */ else {
Py_DECREF( valtuple );
return ( EXPP_ReturnIntError( PyExc_KeyError,
"attribute not found" ) );
}
Py_DECREF(valtuple);
if( error != Py_None )
return -1;
Py_DECREF( Py_None );
return 0;
} }
/** /**