[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [11721] branches/2-44-stable/blender: fix for rgbTuple compile error on some platforms (from trunk)

Campbell Barton cbarton at metavr.com
Mon Aug 20 01:46:50 CEST 2007


Revision: 11721
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=11721
Author:   campbellbarton
Date:     2007-08-20 01:46:50 +0200 (Mon, 20 Aug 2007)

Log Message:
-----------
fix for rgbTuple compile error on some platforms (from trunk)
and console.py had a check flipped

Modified Paths:
--------------
    branches/2-44-stable/blender/release/scripts/console.py
    branches/2-44-stable/blender/source/blender/python/api2_2x/Types.c
    branches/2-44-stable/blender/source/blender/python/api2_2x/rgbTuple.c

Modified: branches/2-44-stable/blender/release/scripts/console.py
===================================================================
--- branches/2-44-stable/blender/release/scripts/console.py	2007-08-19 23:30:56 UTC (rev 11720)
+++ branches/2-44-stable/blender/release/scripts/console.py	2007-08-19 23:46:50 UTC (rev 11721)
@@ -775,7 +775,7 @@
 # Autoexec, startup code.
 scriptDir = Get('scriptsdir')
 if scriptDir:
-	if scriptDir.endswith(Blender.sys.sep):
+	if not scriptDir.endswith(Blender.sys.sep):
 		scriptDir += Blender.sys.sep
 	
 	console_autoexec  = '%s%s' % (scriptDir, 'console_autoexec.py')

Modified: branches/2-44-stable/blender/source/blender/python/api2_2x/Types.c
===================================================================
--- branches/2-44-stable/blender/source/blender/python/api2_2x/Types.c	2007-08-19 23:30:56 UTC (rev 11720)
+++ branches/2-44-stable/blender/source/blender/python/api2_2x/Types.c	2007-08-19 23:46:50 UTC (rev 11721)
@@ -128,7 +128,7 @@
 	euler_Type.ob_type = &PyType_Type;
 	matrix_Type.ob_type = &PyType_Type;
 	quaternion_Type.ob_type = &PyType_Type;
-	rgbTuple_Type.ob_type = &PyType_Type;
+	PyType_Ready( &rgbTuple_Type );
 	vector_Type.ob_type = &PyType_Type;
 	property_Type.ob_type = &PyType_Type;
 	point_Type.ob_type = &PyType_Type;

Modified: branches/2-44-stable/blender/source/blender/python/api2_2x/rgbTuple.c
===================================================================
--- branches/2-44-stable/blender/source/blender/python/api2_2x/rgbTuple.c	2007-08-19 23:30:56 UTC (rev 11720)
+++ branches/2-44-stable/blender/source/blender/python/api2_2x/rgbTuple.c	2007-08-19 23:46:50 UTC (rev 11721)
@@ -86,10 +86,10 @@
 	PyObject_HEAD_INIT( NULL ) 
 	0,	/* ob_size */
 	"rgbTuple",		/* tp_name */
-	sizeof( BPy_rgbTuple ),	/* tp_basicsize */
+	sizeof( BPy_rgbTuple ),			/* tp_basicsize */
 	0,			/* tp_itemsize */
 	/* methods */
-	NULL,			/* tp_dealloc */
+	0,			/* tp_dealloc */
 	0,			/* tp_print */
 	( getattrfunc ) rgbTuple_getAttr,	/* tp_getattr */
 	( setattrfunc ) rgbTuple_setAttr,	/* tp_setattr */
@@ -99,11 +99,31 @@
 	&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,14 +131,8 @@
 /*****************************************************************************/
 PyObject *rgbTuple_New( float *rgb[3] )
 {
-	BPy_rgbTuple *rgbTuple;
+	BPy_rgbTuple *rgbTuple = PyObject_NEW( BPy_rgbTuple, &rgbTuple_Type );
 
-	rgbTuple_Type.ob_type = &PyType_Type;
-	rgbTuple_Type.tp_dealloc = (destructor)&PyObject_Del;
-	rgbTuple =
-		( BPy_rgbTuple * ) PyObject_NEW( BPy_rgbTuple,
-						 &rgbTuple_Type );
-
 	if( rgbTuple == NULL )
 		return EXPP_ReturnPyObjError( PyExc_MemoryError,
 					      "couldn't create rgbTuple object" );





More information about the Bf-blender-cvs mailing list