[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [14457] branches/apricot/source/blender: warning fix from trunk

Campbell Barton ideasman42 at gmail.com
Thu Apr 17 23:15:53 CEST 2008


Revision: 14457
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14457
Author:   campbellbarton
Date:     2008-04-17 23:15:53 +0200 (Thu, 17 Apr 2008)

Log Message:
-----------
warning fix from trunk

Modified Paths:
--------------
    branches/apricot/source/blender/python/api2_2x/Armature.c
    branches/apricot/source/blender/python/api2_2x/Camera.c
    branches/apricot/source/blender/python/api2_2x/CurNurb.c
    branches/apricot/source/blender/python/api2_2x/IDProp.c
    branches/apricot/source/blender/python/api2_2x/Image.c
    branches/apricot/source/blender/python/api2_2x/Ipocurve.c
    branches/apricot/source/blender/python/api2_2x/Lamp.c
    branches/apricot/source/blender/python/api2_2x/Lattice.c
    branches/apricot/source/blender/python/api2_2x/Library.c
    branches/apricot/source/blender/python/api2_2x/MTex.c
    branches/apricot/source/blender/python/api2_2x/Material.c
    branches/apricot/source/blender/python/api2_2x/Mesh.c
    branches/apricot/source/blender/python/api2_2x/Node.c
    branches/apricot/source/blender/python/api2_2x/Object.c
    branches/apricot/source/blender/python/api2_2x/Pose.c
    branches/apricot/source/blender/python/api2_2x/Scene.c
    branches/apricot/source/blender/python/api2_2x/Text3d.c
    branches/apricot/source/blender/python/api2_2x/Texture.c
    branches/apricot/source/blender/python/api2_2x/bpy_config.c
    branches/apricot/source/blender/src/buttons_editing.c

Modified: branches/apricot/source/blender/python/api2_2x/Armature.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Armature.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/Armature.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -178,7 +178,7 @@
 {
 	char str[2048];
 	PyObject *key, *value;
-	int pos = 0;
+	Py_ssize_t pos = 0;
 	char *p = str;
 	char *keys, *vals;
 

Modified: branches/apricot/source/blender/python/api2_2x/Camera.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Camera.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/Camera.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -33,6 +33,7 @@
 #include "BKE_global.h"
 #include "BKE_object.h"
 #include "BKE_library.h"
+#include "BKE_utildefines.h"
 #include "BLI_blenlib.h"
 #include "BLI_arithb.h" /* for M_PI */
 #include "BSE_editipo.h"
@@ -682,7 +683,7 @@
 	float param;
 	struct Camera *cam= self->camera;
 
-	switch( (int)type ) {
+	switch( GET_INT_FROM_POINTER(type) ) {
 	case EXPP_CAM_ATTR_LENS: 
 		param = cam->lens;
 		break;
@@ -735,7 +736,7 @@
 	float min, max;
 	int ret;
  
-	switch( (int)type ) {
+	switch( GET_INT_FROM_POINTER(type) ) {
 	case EXPP_CAM_ATTR_LENS:
 		min = 1.0;
 		max = 250.0;
@@ -795,7 +796,7 @@
 	ret = EXPP_setFloatClamped( value, param, min, max );
 	
 	if (ret==0) {
-		if ((int)type == EXPP_CAM_ATTR_ANGLE) {
+		if (GET_INT_FROM_POINTER(type) == EXPP_CAM_ATTR_ANGLE) {
 			cam->lens = 16.0f / tan(M_PI*cam->lens/360.0f);
 		}
 	}
@@ -809,7 +810,7 @@
 
 static PyObject *getFlagAttr( BPy_Camera *self, void *type )
 {
-	if (self->camera->flag & (int)type)
+	if (self->camera->flag & GET_INT_FROM_POINTER(type))
 		Py_RETURN_TRUE;
 	else
 		Py_RETURN_FALSE;
@@ -827,9 +828,9 @@
 				"expected True/False or 0/1" );
 	
 	if (param)
-		self->camera->flag |= (int)type;
+		self->camera->flag |= GET_INT_FROM_POINTER(type);
 	else
-		self->camera->flag &= ~(int)type;
+		self->camera->flag &= ~GET_INT_FROM_POINTER(type);
 	return 0;
 }
 

Modified: branches/apricot/source/blender/python/api2_2x/CurNurb.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/CurNurb.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/CurNurb.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -34,6 +34,8 @@
 #include "gen_utils.h"
 #include "BezTriple.h"
 
+#include "BKE_utildefines.h"
+
 /* Only for ME_SMOOTH */
 #include "DNA_meshdata_types.h"
 
@@ -430,14 +432,14 @@
 static PyObject *CurNurb_getFlagBits( BPy_CurNurb * self, void *type )
 {
 	return EXPP_getBitfield( (void *)&self->nurb->flag,
-							  (int)type, 'h' );
+							  GET_INT_FROM_POINTER(type), 'h' );
 }
 
 static int CurNurb_setFlagBits( BPy_CurNurb * self, PyObject *value,
 									void *type )
 {
 	return EXPP_setBitfield( value, (void *)&self->nurb->flag,
-							 (int)type, 'h' );
+							 GET_INT_FROM_POINTER(type), 'h' );
 }
 
 /*

Modified: branches/apricot/source/blender/python/api2_2x/IDProp.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/IDProp.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/IDProp.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -516,7 +516,7 @@
 PyObject *BPy_IDGroup_Update(BPy_IDProperty *self, PyObject *vars)
 {
 	PyObject *pyob, *pkey, *pval;
-	int i=0;
+	Py_ssize_t i=0;
 	
 	if (PySequence_Size(vars) != 1)
 		return EXPP_ReturnPyObjError( PyExc_TypeError,

Modified: branches/apricot/source/blender/python/api2_2x/Image.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Image.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/Image.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -1191,7 +1191,7 @@
 
 static PyObject *Image_getFlag(BPy_Image *self, void *flag)
 {
-	if (self->image->flag & (int)flag)
+	if (self->image->flag & GET_INT_FROM_POINTER(flag))
 		Py_RETURN_TRUE;
 	else
 		Py_RETURN_FALSE;
@@ -1200,7 +1200,7 @@
 
 static PyObject *Image_getFlagTpage(BPy_Image *self, void *flag)
 {
-	if (self->image->tpageflag & (int)flag)
+	if (self->image->tpageflag & GET_INT_FROM_POINTER(flag))
 		Py_RETURN_TRUE;
 	else
 		Py_RETURN_FALSE;
@@ -1235,9 +1235,9 @@
 				"expected True/False or 0/1" );
 	
 	if ( param )
-		self->image->flag |= (int)flag;
+		self->image->flag |= GET_INT_FROM_POINTER(flag);
 	else
-		self->image->flag &= ~(int)flag;
+		self->image->flag &= ~GET_INT_FROM_POINTER(flag);
 	return 0;
 }
 
@@ -1249,9 +1249,9 @@
 				"expected True/False or 0/1" );
 	
 	if ( param )
-		self->image->tpageflag |= (int)flag;
+		self->image->tpageflag |= GET_INT_FROM_POINTER(flag);
 	else
-		self->image->tpageflag &= ~(int)flag;
+		self->image->tpageflag &= ~GET_INT_FROM_POINTER(flag);
 	return 0;
 }
 
@@ -1263,7 +1263,7 @@
 	int param;
 	struct Image *image = self->image;
 
-	switch( (int)type ) {
+	switch( GET_INT_FROM_POINTER(type) ) {
 	case EXPP_IMAGE_ATTR_XREP:
 		param = image->xrep;
 		break;
@@ -1304,7 +1304,7 @@
 	struct Image *image = self->image;
 	int min, max, size;
 
-	switch( (int)type ) {
+	switch( GET_INT_FROM_POINTER(type) ) {
 	case EXPP_IMAGE_ATTR_XREP:
 		min = EXPP_IMAGE_REP_MIN;
 		max = EXPP_IMAGE_REP_MAX;

Modified: branches/apricot/source/blender/python/api2_2x/Ipocurve.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Ipocurve.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/Ipocurve.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -34,6 +34,7 @@
 #include "BKE_main.h"
 #include "BKE_depsgraph.h"
 #include "BKE_ipo.h"
+#include "BKE_utildefines.h"
 #include "BIF_space.h"
 #include "BSE_editipo.h"
 #include "MEM_guardedalloc.h"
@@ -1017,7 +1018,7 @@
 
 static PyObject *IpoCurve_getFlag( C_IpoCurve * self, void *type )
 {
-	if (self->ipocurve->flag & (int)type)
+	if (self->ipocurve->flag & GET_INT_FROM_POINTER(type))
 		Py_RETURN_TRUE;
 	else
 		Py_RETURN_FALSE;
@@ -1031,9 +1032,9 @@
 				"expected True/False or 0/1" );
 	
 	if (param)
-		self->ipocurve->flag |= (int)type;
+		self->ipocurve->flag |= GET_INT_FROM_POINTER(type);
 	else
-		self->ipocurve->flag &= ~(int)type;
+		self->ipocurve->flag &= ~GET_INT_FROM_POINTER(type);
 	
 	return 0;
 }

Modified: branches/apricot/source/blender/python/api2_2x/Lamp.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Lamp.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/Lamp.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -42,6 +42,7 @@
 #include "constant.h"
 #include "gen_utils.h"
 #include "gen_library.h"
+#include "BKE_utildefines.h"
 
 /*****************************************************************************/
 /* Python BPy_Lamp defaults:                                                 */
@@ -1175,7 +1176,7 @@
 
 static PyObject *Lamp_getComponent( BPy_Lamp * self, void * closure )
 {
-	switch ( (int)closure ) {
+	switch ( GET_INT_FROM_POINTER(closure) ) {
 	case EXPP_LAMP_COMP_R:
 		return PyFloat_FromDouble( self->lamp->r );
 	case EXPP_LAMP_COMP_G:
@@ -1200,7 +1201,7 @@
 	color = (float)PyFloat_AsDouble( value );
 	color = EXPP_ClampFloat( color, EXPP_LAMP_COL_MIN, EXPP_LAMP_COL_MAX );
 
-	switch ( (int)closure ) {
+	switch ( GET_INT_FROM_POINTER(closure) ) {
 	case EXPP_LAMP_COMP_R:
 		self->lamp->r = color;
 		return 0;

Modified: branches/apricot/source/blender/python/api2_2x/Lattice.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Lattice.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/Lattice.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -676,7 +676,7 @@
 static PyObject *Lattice_getAxisType(BPy_Lattice * self, void * type)
 {
 	char interp_type = 0;
-	switch ( (int)type ) {
+	switch ( GET_INT_FROM_POINTER(type) ) {
 	case 0:
 		interp_type = self->lattice->typeu;
 		break;

Modified: branches/apricot/source/blender/python/api2_2x/Library.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Library.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/Library.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -941,7 +941,7 @@
 
 static PyObject *LibraryData_CreatePyObject( BPy_Library *self, void *mode )
 {
-	return CreatePyObject_LibData( (int)mode, OTHER, NULL, NULL,
+	return CreatePyObject_LibData( GET_INT_FROM_POINTER(mode), OTHER, NULL, NULL,
 			self->filename );
 }
 

Modified: branches/apricot/source/blender/python/api2_2x/MTex.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/MTex.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/MTex.c	2008-04-17 21:15:53 UTC (rev 14457)
@@ -674,7 +674,7 @@
 
 static PyObject *MTex_getFlag( BPy_MTex *self, void *closure )
 {
-	return PyBool_FromLong( self->mtex->texflag & ((int) closure) );
+	return PyBool_FromLong( self->mtex->texflag & (GET_INT_FROM_POINTER(closure)) );
 }
 
 static int MTex_setFlag( BPy_MTex *self, PyObject *value, void *closure)
@@ -684,9 +684,9 @@
 				"expected a bool");
 
 	if ( value == Py_True )
-		self->mtex->texflag |= (int)closure;
+		self->mtex->texflag |= GET_INT_FROM_POINTER(closure);
 	else
-		self->mtex->texflag &= ~((int) closure);
+		self->mtex->texflag &= ~(GET_INT_FROM_POINTER(closure));
 
 	return 0;
 }
@@ -771,7 +771,7 @@
 
 static PyObject *MTex_getMapToFlag( BPy_MTex *self, void *closure )
 {
-	int flag = (int) closure;
+	int flag = GET_INT_FROM_POINTER(closure);
 
 	if ( self->mtex->mapto & flag )
 	{
@@ -783,7 +783,7 @@
 
 static int MTex_setMapToFlag( BPy_MTex *self, PyObject *value, void *closure)
 {
-	int flag = (int) closure;
+	int flag = GET_INT_FROM_POINTER(closure);
 	int intVal;
 
 	if ( !PyInt_Check( value ) )

Modified: branches/apricot/source/blender/python/api2_2x/Material.c
===================================================================
--- branches/apricot/source/blender/python/api2_2x/Material.c	2008-04-17 21:14:55 UTC (rev 14456)
+++ branches/apricot/source/blender/python/api2_2x/Material.c	2008-04-17 21:15:53 UTC (rev 14457)

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list