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:
authorStephen Swaney <sswaney@centurytel.net>2004-09-26 00:30:40 +0400
committerStephen Swaney <sswaney@centurytel.net>2004-09-26 00:30:40 +0400
commita509b8adc9b8952cdb395c69406e821f57a9a6c7 (patch)
tree7c0e3c7b81007acc6b3e268e59a6af5fcb4bd93f /source/blender/python/api2_2x/rgbTuple.c
parentbd371ddb9ff947d4e598ad04af9402d89fa80d5e (diff)
Another round in the Great BPy Cleanup:
Run everything thru indent to cleanup spaces vs tabs. Clean up some of the comments by hand. BGL.c was not touched due to all that macro wackyness. There are no functional changes to the code. Pre-indent versions of source are tagged with tag bpy-cleanup-20040925 , just in case.
Diffstat (limited to 'source/blender/python/api2_2x/rgbTuple.c')
-rw-r--r--source/blender/python/api2_2x/rgbTuple.c362
1 files changed, 192 insertions, 170 deletions
diff --git a/source/blender/python/api2_2x/rgbTuple.c b/source/blender/python/api2_2x/rgbTuple.c
index 60ffa616f3b..c61120bfd75 100644
--- a/source/blender/python/api2_2x/rgbTuple.c
+++ b/source/blender/python/api2_2x/rgbTuple.c
@@ -38,94 +38,94 @@
/*****************************************************************************/
/* Python rgbTuple_Type callback function prototypes: */
/*****************************************************************************/
-static void rgbTuple_dealloc (BPy_rgbTuple *self);
-static PyObject *rgbTuple_getAttr (BPy_rgbTuple *self, char *name);
-static int rgbTuple_setAttr (BPy_rgbTuple *self, char *name, PyObject *v);
-static PyObject *rgbTuple_repr (BPy_rgbTuple *self);
+static void rgbTuple_dealloc( BPy_rgbTuple * self );
+static PyObject *rgbTuple_getAttr( BPy_rgbTuple * self, char *name );
+static int rgbTuple_setAttr( BPy_rgbTuple * self, char *name, PyObject * v );
+static PyObject *rgbTuple_repr( BPy_rgbTuple * self );
-static int rgbTupleLength(BPy_rgbTuple *self);
+static int rgbTupleLength( BPy_rgbTuple * self );
-static PyObject *rgbTupleSubscript(BPy_rgbTuple *self, PyObject *key);
-static int rgbTupleAssSubscript(BPy_rgbTuple *self, PyObject *who,
- PyObject *cares);
+static PyObject *rgbTupleSubscript( BPy_rgbTuple * self, PyObject * key );
+static int rgbTupleAssSubscript( BPy_rgbTuple * self, PyObject * who,
+ PyObject * cares );
-static PyObject *rgbTupleItem(BPy_rgbTuple *self, int i);
-static int rgbTupleAssItem(BPy_rgbTuple *self, int i, PyObject *ob);
-static PyObject *rgbTupleSlice(BPy_rgbTuple *self, int begin, int end);
-static int rgbTupleAssSlice(BPy_rgbTuple *self, int begin, int end, PyObject *seq);
+static PyObject *rgbTupleItem( BPy_rgbTuple * self, int i );
+static int rgbTupleAssItem( BPy_rgbTuple * self, int i, PyObject * ob );
+static PyObject *rgbTupleSlice( BPy_rgbTuple * self, int begin, int end );
+static int rgbTupleAssSlice( BPy_rgbTuple * self, int begin, int end,
+ PyObject * seq );
/*****************************************************************************/
/* Python rgbTuple_Type Mapping Methods table: */
/*****************************************************************************/
-static PyMappingMethods rgbTupleAsMapping =
-{
- (inquiry)rgbTupleLength, /* mp_length */
- (binaryfunc)rgbTupleSubscript, /* mp_subscript */
- (objobjargproc)rgbTupleAssSubscript, /* mp_ass_subscript */
+static PyMappingMethods rgbTupleAsMapping = {
+ ( inquiry ) rgbTupleLength, /* mp_length */
+ ( binaryfunc ) rgbTupleSubscript, /* mp_subscript */
+ ( objobjargproc ) rgbTupleAssSubscript, /* mp_ass_subscript */
};
/*****************************************************************************/
/* Python rgbTuple_Type Sequence Methods table: */
/*****************************************************************************/
-static PySequenceMethods rgbTupleAsSequence =
-{
- (inquiry) rgbTupleLength, /* sq_length */
- (binaryfunc) 0, /* sq_concat */
- (intargfunc) 0, /* sq_repeat */
- (intargfunc) rgbTupleItem, /* sq_item */
- (intintargfunc) rgbTupleSlice, /* sq_slice */
- (intobjargproc) rgbTupleAssItem, /* sq_ass_item */
- (intintobjargproc) rgbTupleAssSlice, /* sq_ass_slice */
+static PySequenceMethods rgbTupleAsSequence = {
+ ( inquiry ) rgbTupleLength, /* sq_length */
+ ( binaryfunc ) 0, /* sq_concat */
+ ( intargfunc ) 0, /* sq_repeat */
+ ( intargfunc ) rgbTupleItem, /* sq_item */
+ ( intintargfunc ) rgbTupleSlice, /* sq_slice */
+ ( intobjargproc ) rgbTupleAssItem, /* sq_ass_item */
+ ( intintobjargproc ) rgbTupleAssSlice, /* sq_ass_slice */
};
/*****************************************************************************/
/* Python rgbTuple_Type structure definition: */
/*****************************************************************************/
-PyTypeObject rgbTuple_Type =
-{
- PyObject_HEAD_INIT(NULL)
- 0, /* ob_size */
- "rgbTuple", /* tp_name */
- sizeof (BPy_rgbTuple), /* tp_basicsize */
- 0, /* tp_itemsize */
- /* methods */
- (destructor)rgbTuple_dealloc, /* tp_dealloc */
- 0, /* tp_print */
- (getattrfunc)rgbTuple_getAttr, /* tp_getattr */
- (setattrfunc)rgbTuple_setAttr, /* tp_setattr */
- 0, /* tp_compare */
- (reprfunc)rgbTuple_repr, /* tp_repr */
- 0, /* tp_as_number */
- &rgbTupleAsSequence, /* tp_as_sequence */
- &rgbTupleAsMapping, /* tp_as_mapping */
- 0, /* tp_as_hash */
- 0,0,0,0,0,0,
- 0, /* tp_doc */
- 0,0,0,0,0,0,
- 0, /* tp_methods */
- 0, /* tp_members */
+PyTypeObject rgbTuple_Type = {
+ PyObject_HEAD_INIT( NULL )
+ 0, /* ob_size */
+ "rgbTuple", /* tp_name */
+ sizeof( BPy_rgbTuple ), /* tp_basicsize */
+ 0, /* tp_itemsize */
+ /* methods */
+ ( destructor ) rgbTuple_dealloc, /* tp_dealloc */
+ 0, /* tp_print */
+ ( getattrfunc ) rgbTuple_getAttr, /* tp_getattr */
+ ( setattrfunc ) rgbTuple_setAttr, /* tp_setattr */
+ 0, /* tp_compare */
+ ( reprfunc ) rgbTuple_repr, /* tp_repr */
+ 0, /* tp_as_number */
+ &rgbTupleAsSequence, /* tp_as_sequence */
+ &rgbTupleAsMapping, /* tp_as_mapping */
+ 0, /* tp_as_hash */
+ 0, 0, 0, 0, 0, 0,
+ 0, /* tp_doc */
+ 0, 0, 0, 0, 0, 0,
+ 0, /* tp_methods */
+ 0, /* tp_members */
};
/*****************************************************************************/
/* Function: rgbTuple_New */
/*****************************************************************************/
-PyObject *rgbTuple_New(float *rgb[3])
+PyObject *rgbTuple_New( float *rgb[3] )
{
- BPy_rgbTuple *rgbTuple;
+ BPy_rgbTuple *rgbTuple;
- rgbTuple_Type.ob_type = &PyType_Type;
+ rgbTuple_Type.ob_type = &PyType_Type;
- rgbTuple = (BPy_rgbTuple *)PyObject_NEW(BPy_rgbTuple, &rgbTuple_Type);
+ rgbTuple =
+ ( BPy_rgbTuple * ) PyObject_NEW( BPy_rgbTuple,
+ &rgbTuple_Type );
- if (rgbTuple == NULL)
- return EXPP_ReturnPyObjError (PyExc_MemoryError,
- "couldn't create rgbTuple object");
+ if( rgbTuple == NULL )
+ return EXPP_ReturnPyObjError( PyExc_MemoryError,
+ "couldn't create rgbTuple object" );
rgbTuple->rgb[0] = rgb[0];
rgbTuple->rgb[1] = rgb[1];
rgbTuple->rgb[2] = rgb[2];
- return (PyObject *)rgbTuple;
+ return ( PyObject * ) rgbTuple;
}
/*****************************************************************************/
@@ -134,39 +134,41 @@ PyObject *rgbTuple_New(float *rgb[3])
/* get function returns a tuple, the set one accepts three */
/* floats (separated or in a tuple) as arguments. */
/*****************************************************************************/
-PyObject *rgbTuple_getCol (BPy_rgbTuple *self)
+PyObject *rgbTuple_getCol( BPy_rgbTuple * self )
{
- PyObject *list = PyList_New (3);
+ PyObject *list = PyList_New( 3 );
- if (!list) return EXPP_ReturnPyObjError (PyExc_MemoryError,
- "couldn't create PyList");
+ if( !list )
+ return EXPP_ReturnPyObjError( PyExc_MemoryError,
+ "couldn't create PyList" );
- PyList_SET_ITEM (list, 0, Py_BuildValue ("f", *(self->rgb[0]) ));
- PyList_SET_ITEM (list, 1, Py_BuildValue ("f", *(self->rgb[1]) ));
- PyList_SET_ITEM (list, 2, Py_BuildValue ("f", *(self->rgb[2]) ));
+ PyList_SET_ITEM( list, 0, Py_BuildValue( "f", *( self->rgb[0] ) ) );
+ PyList_SET_ITEM( list, 1, Py_BuildValue( "f", *( self->rgb[1] ) ) );
+ PyList_SET_ITEM( list, 2, Py_BuildValue( "f", *( self->rgb[2] ) ) );
return list;
}
-PyObject *rgbTuple_setCol (BPy_rgbTuple *self, PyObject *args)
+PyObject *rgbTuple_setCol( BPy_rgbTuple * self, PyObject * args )
{
int ok;
float r = 0, g = 0, b = 0;
- if (PyObject_Length (args) == 3)
- ok = PyArg_ParseTuple (args, "fff", &r, &g, &b);
+ if( PyObject_Length( args ) == 3 )
+ ok = PyArg_ParseTuple( args, "fff", &r, &g, &b );
- else ok = PyArg_ParseTuple (args, "|(fff)", &r, &g, &b);
+ else
+ ok = PyArg_ParseTuple( args, "|(fff)", &r, &g, &b );
- if (!ok)
- return EXPP_ReturnPyObjError (PyExc_TypeError,
- "expected [f,f,f] or f,f,f as arguments (or nothing)");
+ if( !ok )
+ return EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected [f,f,f] or f,f,f as arguments (or nothing)" );
- *(self->rgb[0]) = EXPP_ClampFloat (r, 0.0, 1.0);
- *(self->rgb[1]) = EXPP_ClampFloat (g, 0.0, 1.0);
- *(self->rgb[2]) = EXPP_ClampFloat (b, 0.0, 1.0);
+ *( self->rgb[0] ) = EXPP_ClampFloat( r, 0.0, 1.0 );
+ *( self->rgb[1] ) = EXPP_ClampFloat( g, 0.0, 1.0 );
+ *( self->rgb[2] ) = EXPP_ClampFloat( b, 0.0, 1.0 );
- return EXPP_incr_ret (Py_None);
+ return EXPP_incr_ret( Py_None );
}
/*****************************************************************************/
@@ -174,9 +176,9 @@ PyObject *rgbTuple_setCol (BPy_rgbTuple *self, PyObject *args)
/* Description: This is a callback function for the BPy_rgbTuple type. It is */
/* the destructor function. */
/*****************************************************************************/
-static void rgbTuple_dealloc (BPy_rgbTuple *self)
+static void rgbTuple_dealloc( BPy_rgbTuple * self )
{
- PyObject_DEL (self);
+ PyObject_DEL( self );
}
/*****************************************************************************/
@@ -185,21 +187,24 @@ static void rgbTuple_dealloc (BPy_rgbTuple *self)
/* the function that accesses BPy_rgbTuple member variables and */
/* methods. */
/*****************************************************************************/
-static PyObject* rgbTuple_getAttr (BPy_rgbTuple *self, char *name)
+static PyObject *rgbTuple_getAttr( BPy_rgbTuple * self, char *name )
{
int i;
- if (strcmp(name, "__members__") == 0)
- return Py_BuildValue("[s,s,s]", "R", "G", "B");
+ if( strcmp( name, "__members__" ) == 0 )
+ return Py_BuildValue( "[s,s,s]", "R", "G", "B" );
- else if (!strcmp(name, "R") || !strcmp(name, "r")) i = 0;
- else if (!strcmp(name, "G") || !strcmp(name, "g")) i = 1;
- else if (!strcmp(name, "B") || !strcmp(name, "b")) i = 2;
+ else if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
+ i = 0;
+ else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
+ i = 1;
+ else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
+ i = 2;
else
- return (EXPP_ReturnPyObjError (PyExc_AttributeError,
- "attribute not found"));
+ return ( EXPP_ReturnPyObjError( PyExc_AttributeError,
+ "attribute not found" ) );
- return Py_BuildValue("f", *(self->rgb[i]));
+ return Py_BuildValue( "f", *( self->rgb[i] ) );
}
/*****************************************************************************/
@@ -207,27 +212,28 @@ static PyObject* rgbTuple_getAttr (BPy_rgbTuple *self, char *name)
/* Description: This is a callback function for the BPy_rgbTuple type. It is */
/* the function that changes BPy_rgbTuple member variables. */
/*****************************************************************************/
-static int rgbTuple_setAttr (BPy_rgbTuple *self, char *name, PyObject *v)
+static int rgbTuple_setAttr( BPy_rgbTuple * self, char *name, PyObject * v )
{
float value;
- if (!PyArg_Parse (v, "f", &value))
- return EXPP_ReturnIntError (PyExc_TypeError,
- "expected float argument");
+ if( !PyArg_Parse( v, "f", &value ) )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected float argument" );
- value = EXPP_ClampFloat(value, 0.0, 1.0);
+ value = EXPP_ClampFloat( value, 0.0, 1.0 );
- if (!strcmp(name, "R") || !strcmp(name, "r"))
- *(self->rgb[0]) = value;
+ if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
+ *( self->rgb[0] ) = value;
- else if (!strcmp(name, "G") || !strcmp(name, "g"))
- *(self->rgb[1]) = value;
+ else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
+ *( self->rgb[1] ) = value;
- else if (!strcmp(name, "B") || !strcmp(name, "b"))
- *(self->rgb[2]) = value;
+ else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
+ *( self->rgb[2] ) = value;
- else return (EXPP_ReturnIntError (PyExc_AttributeError,
- "attribute not found"));
+ else
+ return ( EXPP_ReturnIntError( PyExc_AttributeError,
+ "attribute not found" ) );
return 0;
}
@@ -237,55 +243,64 @@ static int rgbTuple_setAttr (BPy_rgbTuple *self, char *name, PyObject *v)
/* These functions provide code to access rgbTuple objects as */
/* mappings. */
/*****************************************************************************/
-static int rgbTupleLength(BPy_rgbTuple *self)
+static int rgbTupleLength( BPy_rgbTuple * self )
{
- return 3;
+ return 3;
}
-static PyObject *rgbTupleSubscript(BPy_rgbTuple *self, PyObject *key)
+static PyObject *rgbTupleSubscript( BPy_rgbTuple * self, PyObject * key )
{
char *name = NULL;
int i;
- if (PyNumber_Check(key)) return rgbTupleItem(self, (int)PyInt_AsLong(key));
+ if( PyNumber_Check( key ) )
+ return rgbTupleItem( self, ( int ) PyInt_AsLong( key ) );
- if (!PyArg_ParseTuple(key, "s", &name))
- return EXPP_ReturnPyObjError (PyExc_TypeError,
- "expected int or string argument");
+ if( !PyArg_ParseTuple( key, "s", &name ) )
+ return EXPP_ReturnPyObjError( PyExc_TypeError,
+ "expected int or string argument" );
- if (!strcmp(name, "R") || !strcmp(name, "r")) i = 0;
- else if (!strcmp(name, "G") || !strcmp(name, "g")) i = 1;
- else if (!strcmp(name, "B") || !strcmp(name, "b")) i = 2;
+ if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
+ i = 0;
+ else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
+ i = 1;
+ else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
+ i = 2;
else
- return EXPP_ReturnPyObjError (PyExc_AttributeError, name);
+ return EXPP_ReturnPyObjError( PyExc_AttributeError, name );
- return Py_BuildValue("f", *(self->rgb[i]));
+ return Py_BuildValue( "f", *( self->rgb[i] ) );
}
-static int rgbTupleAssSubscript(BPy_rgbTuple *self, PyObject *key, PyObject *v)
+static int rgbTupleAssSubscript( BPy_rgbTuple * self, PyObject * key,
+ PyObject * v )
{
- char *name = NULL;
+ char *name = NULL;
int i;
- if (!PyNumber_Check(v)) return EXPP_ReturnIntError(PyExc_TypeError,
- "value to assign must be a number");
+ if( !PyNumber_Check( v ) )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "value to assign must be a number" );
- if (PyNumber_Check(key))
- return rgbTupleAssItem(self, (int)PyInt_AsLong(key), v);
+ if( PyNumber_Check( key ) )
+ return rgbTupleAssItem( self, ( int ) PyInt_AsLong( key ), v );
- if (!PyArg_Parse(key, "s", &name))
- return EXPP_ReturnIntError (PyExc_TypeError,
- "expected int or string argument");
+ if( !PyArg_Parse( key, "s", &name ) )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "expected int or string argument" );
- if (!strcmp(name, "R") || !strcmp(name, "r")) i = 0;
- else if (!strcmp(name, "G") || !strcmp(name, "g")) i = 1;
- else if (!strcmp(name, "B") || !strcmp(name, "b")) i = 2;
+ if( !strcmp( name, "R" ) || !strcmp( name, "r" ) )
+ i = 0;
+ else if( !strcmp( name, "G" ) || !strcmp( name, "g" ) )
+ i = 1;
+ else if( !strcmp( name, "B" ) || !strcmp( name, "b" ) )
+ i = 2;
else
- return EXPP_ReturnIntError (PyExc_AttributeError, name);
+ return EXPP_ReturnIntError( PyExc_AttributeError, name );
- *(self->rgb[i]) = EXPP_ClampFloat(PyFloat_AsDouble(v), 0.0, 1.0);
+ *( self->rgb[i] ) = EXPP_ClampFloat( PyFloat_AsDouble( v ), 0.0, 1.0 );
- return 0;
+ return 0;
}
/*****************************************************************************/
@@ -293,77 +308,84 @@ static int rgbTupleAssSubscript(BPy_rgbTuple *self, PyObject *key, PyObject *v)
/* These functions provide code to access rgbTuple objects as */
/* sequences. */
/*****************************************************************************/
-static PyObject *rgbTupleItem(BPy_rgbTuple *self, int i)
+static PyObject *rgbTupleItem( BPy_rgbTuple * self, int i )
{
- if (i < 0 || i >= 3)
- return EXPP_ReturnPyObjError (PyExc_IndexError,
- "array index out of range");
+ if( i < 0 || i >= 3 )
+ return EXPP_ReturnPyObjError( PyExc_IndexError,
+ "array index out of range" );
- return Py_BuildValue("f", *(self->rgb[i]));
+ return Py_BuildValue( "f", *( self->rgb[i] ) );
}
-static PyObject *rgbTupleSlice(BPy_rgbTuple *self, int begin, int end)
+static PyObject *rgbTupleSlice( BPy_rgbTuple * self, int begin, int end )
{
PyObject *list;
int count;
- if (begin < 0) begin = 0;
- if (end > 3) end = 3;
- if (begin > end) begin = end;
+ if( begin < 0 )
+ begin = 0;
+ if( end > 3 )
+ end = 3;
+ if( begin > end )
+ begin = end;
- list = PyList_New(end - begin);
+ list = PyList_New( end - begin );
- for (count = begin; count < end; count++)
- PyList_SetItem(list, count - begin,
- PyFloat_FromDouble(*(self->rgb[count])));
+ for( count = begin; count < end; count++ )
+ PyList_SetItem( list, count - begin,
+ PyFloat_FromDouble( *( self->rgb[count] ) ) );
return list;
}
-static int rgbTupleAssItem(BPy_rgbTuple *self, int i, PyObject *ob)
+static int rgbTupleAssItem( BPy_rgbTuple * self, int i, PyObject * ob )
{
- if (i < 0 || i >= 3)
- return EXPP_ReturnIntError(PyExc_IndexError,
- "array assignment index out of range");
+ if( i < 0 || i >= 3 )
+ return EXPP_ReturnIntError( PyExc_IndexError,
+ "array assignment index out of range" );
- if (!PyNumber_Check(ob))
- return EXPP_ReturnIntError(PyExc_IndexError,
- "color component must be a number");
+ if( !PyNumber_Check( ob ) )
+ return EXPP_ReturnIntError( PyExc_IndexError,
+ "color component must be a number" );
/* XXX this check above is probably ... */
- *(self->rgb[i]) = EXPP_ClampFloat(PyFloat_AsDouble(ob), 0.0, 1.0);
+ *( self->rgb[i] ) =
+ EXPP_ClampFloat( PyFloat_AsDouble( ob ), 0.0, 1.0 );
return 0;
}
-static int rgbTupleAssSlice(BPy_rgbTuple *self, int begin, int end,
- PyObject *seq)
+static int rgbTupleAssSlice( BPy_rgbTuple * self, int begin, int end,
+ PyObject * seq )
{
int count;
-
- if (begin < 0) begin = 0;
- if (end > 3) end = 3;
- if (begin > end) begin = end;
- if (!PySequence_Check(seq))
- return EXPP_ReturnIntError(PyExc_TypeError,
- "illegal argument type for built-in operation");
+ if( begin < 0 )
+ begin = 0;
+ if( end > 3 )
+ end = 3;
+ if( begin > end )
+ begin = end;
+
+ if( !PySequence_Check( seq ) )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "illegal argument type for built-in operation" );
- if (PySequence_Length(seq) != (end - begin))
- return EXPP_ReturnIntError(PyExc_TypeError,
- "size mismatch in slice assignment");
+ if( PySequence_Length( seq ) != ( end - begin ) )
+ return EXPP_ReturnIntError( PyExc_TypeError,
+ "size mismatch in slice assignment" );
- for (count = begin; count < end; count++) {
+ for( count = begin; count < end; count++ ) {
float value;
- PyObject *ob = PySequence_GetItem(seq, count);
+ PyObject *ob = PySequence_GetItem( seq, count );
- if (!PyArg_Parse(ob, "f", &value)) {
- Py_DECREF(ob);
+ if( !PyArg_Parse( ob, "f", &value ) ) {
+ Py_DECREF( ob );
return -1;
}
- *(self->rgb[count]) = EXPP_ClampFloat(value, 0.0, 1.0);
+ *( self->rgb[count] ) = EXPP_ClampFloat( value, 0.0, 1.0 );
- Py_DECREF(ob);
+ Py_DECREF( ob );
}
return 0;
@@ -374,13 +396,13 @@ static int rgbTupleAssSlice(BPy_rgbTuple *self, int begin, int end,
/* Description: This is a callback function for the BPy_rgbTuple type. It */
/* builds a meaninful string to represent rgbTuple objects. */
/*****************************************************************************/
-static PyObject *rgbTuple_repr (BPy_rgbTuple *self)
+static PyObject *rgbTuple_repr( BPy_rgbTuple * self )
{
float r, g, b;
- r = *(self->rgb[0]);
- g = *(self->rgb[1]);
- b = *(self->rgb[2]);
+ r = *( self->rgb[0] );
+ g = *( self->rgb[1] );
+ b = *( self->rgb[2] );
- return PyString_FromFormat("[%f, %f, %f]", r, g, b);
+ return PyString_FromFormat( "[%f, %f, %f]", r, g, b );
}