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:
authorCampbell Barton <ideasman42@gmail.com>2007-08-19 23:06:42 +0400
committerCampbell Barton <ideasman42@gmail.com>2007-08-19 23:06:42 +0400
commit2866dde90a0cfbd65b9f52c313f706dc46fc9603 (patch)
tree57384d23685f35a9d6bfb70876f30dfaab9286ed /source/blender/python/api2_2x/rgbTuple.c
parentd27abcccdd43b45c9c5d90a91821fa12e98203ac (diff)
aparently mingw was still having problems, fixed this properly by using PyType_Ready, this needed some changes to the PyType to work.
Diffstat (limited to 'source/blender/python/api2_2x/rgbTuple.c')
-rw-r--r--source/blender/python/api2_2x/rgbTuple.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/source/blender/python/api2_2x/rgbTuple.c b/source/blender/python/api2_2x/rgbTuple.c
index 862cd318ada..d8bfd930752 100644
--- a/source/blender/python/api2_2x/rgbTuple.c
+++ b/source/blender/python/api2_2x/rgbTuple.c
@@ -86,10 +86,10 @@ PyTypeObject rgbTuple_Type = {
PyObject_HEAD_INIT( NULL )
0, /* ob_size */
"rgbTuple", /* tp_name */
- 0, /* tp_basicsize */
+ sizeof( BPy_rgbTuple ), /* tp_basicsize */
0, /* tp_itemsize */
/* methods */
- ( destructor )PyObject_Del, /* tp_dealloc */
+ 0, /* tp_dealloc */
0, /* tp_print */
( getattrfunc ) rgbTuple_getAttr, /* tp_getattr */
( setattrfunc ) rgbTuple_setAttr, /* tp_setattr */
@@ -99,11 +99,31 @@ PyTypeObject rgbTuple_Type = {
&rgbTupleAsSequence, /* tp_as_sequence */
&rgbTupleAsMapping, /* tp_as_mapping */
0, /* tp_as_hash */
- 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, Py_TPFLAGS_DEFAULT,
0, /* tp_doc */
0, 0, 0, 0, 0, 0,
0, /* tp_methods */
0, /* tp_members */
+ 0, /* struct PyGetSetDef *tp_getset; */
+ 0, /* struct _typeobject *tp_base; */
+ 0, /* PyObject *tp_dict; */
+ 0, /* descrgetfunc tp_descr_get; */
+ 0, /* descrsetfunc tp_descr_set; */
+ 0, /* long tp_dictoffset; */
+ 0, /* initproc tp_init; */
+ 0, /* allocfunc tp_alloc; */
+ 0, /* newfunc tp_new; */
+ /* Low-level free-memory routine */
+ 0, /* freefunc tp_free; */
+ /* For PyObject_IS_GC */
+ 0, /* inquiry tp_is_gc; */
+ 0, /* PyObject *tp_bases; */
+ /* method resolution order */
+ 0, /* PyObject *tp_mro; */
+ 0, /* PyObject *tp_cache; */
+ 0, /* PyObject *tp_subclasses; */
+ 0, /* PyObject *tp_weaklist; */
+ 0
};
/*****************************************************************************/
@@ -111,13 +131,7 @@ PyTypeObject rgbTuple_Type = {
/*****************************************************************************/
PyObject *rgbTuple_New( float *rgb[3] )
{
- BPy_rgbTuple *rgbTuple;
-
- rgbTuple_Type.ob_type = &PyType_Type;
- rgbTuple_Type.tp_dealloc = (destructor)&PyObject_Del;
- rgbTuple =
- ( BPy_rgbTuple * ) PyObject_NEW( BPy_rgbTuple,
- &rgbTuple_Type );
+ BPy_rgbTuple *rgbTuple = PyObject_NEW( BPy_rgbTuple, &rgbTuple_Type );
if( rgbTuple == NULL )
return EXPP_ReturnPyObjError( PyExc_MemoryError,