forked from bartvdbraak/blender
Get rid of various warnings with gcc under linux
This commit is contained in:
parent
27c42ee062
commit
318a694a25
@ -37,6 +37,7 @@
|
||||
#include "BKE_global.h"
|
||||
#include "BKE_library.h"
|
||||
#include "BKE_image.h"
|
||||
#include "BKE_idprop.h"
|
||||
#include "BIF_drawimage.h"
|
||||
#include "BLI_blenlib.h"
|
||||
#include "DNA_space_types.h" /* FILE_MAXDIR = 160 */
|
||||
|
@ -366,7 +366,7 @@ PyTypeObject Ipo_Type = {
|
||||
NULL, /* printfunc tp_print; */
|
||||
NULL, /* getattrfunc tp_getattr; */
|
||||
NULL, /* setattrfunc tp_setattr; */
|
||||
( reprfunc ) Ipo_compare, /* cmpfunc tp_compare; */
|
||||
( cmpfunc ) Ipo_compare, /* cmpfunc tp_compare; */
|
||||
( reprfunc ) Ipo_repr, /* reprfunc tp_repr; */
|
||||
|
||||
/* Method suites for standard classes */
|
||||
|
@ -45,6 +45,7 @@ struct View3D;
|
||||
#include "BKE_library.h"
|
||||
#include "BKE_scene.h"
|
||||
#include "BKE_font.h"
|
||||
#include "BKE_idprop.h"
|
||||
#include "BLI_blenlib.h" /* only for SceneObSeq_new */
|
||||
#include "BSE_drawview.h" /* for play_anim */
|
||||
#include "BSE_headerbuttons.h" /* for copy_scene */
|
||||
@ -286,7 +287,7 @@ static PyObject *Scene_getAttr( BPy_Scene * self, char *name )
|
||||
|
||||
/* accept both Layer (for compatibility with ob.Layer) and Layers */
|
||||
else if( strncmp( name, "Layer", 5 ) == 0 )
|
||||
attr = PyInt_FromLong( self->scene->lay & (1<<20)-1 );
|
||||
attr = PyInt_FromLong( self->scene->lay & ((1<<20)-1) );
|
||||
/* Layers returns a bitmask, layers returns a list of integers */
|
||||
else if( strcmp( name, "layers") == 0)
|
||||
return Scene_getLayers(self);
|
||||
@ -1296,7 +1297,7 @@ static PyObject *SceneObSeq_add( BPy_SceneObSeq * self, PyObject *pyobj )
|
||||
static PyObject *SceneObSeq_new( BPy_SceneObSeq * self, PyObject *args )
|
||||
{
|
||||
void *data = NULL;
|
||||
short type;
|
||||
short type = OB_EMPTY;
|
||||
struct Object *object;
|
||||
Base *base;
|
||||
PyObject *py_data;
|
||||
@ -1424,7 +1425,7 @@ static PyObject *SceneObSeq_new( BPy_SceneObSeq * self, PyObject *args )
|
||||
|
||||
|
||||
base->object = object; /* link object to the new base */
|
||||
base->lay= object->lay = scene->lay & (1<<20)-1; /* Layer, by default visible*/
|
||||
base->lay= object->lay = scene->lay & ((1<<20)-1); /* Layer, by default visible*/
|
||||
|
||||
base->flag = SELECT;
|
||||
object->id.us = 1; /* we will exist once in this scene */
|
||||
|
@ -113,33 +113,7 @@ static int constantAssSubscript(BPy_constant *self, PyObject *who, PyObject *car
|
||||
{
|
||||
return 0; /* no user assignments allowed */
|
||||
}
|
||||
//------------------------tp_getattr
|
||||
static PyObject *constant_getAttr(BPy_constant * self, char *name)
|
||||
{
|
||||
if(self->dict) {
|
||||
PyObject *v;
|
||||
|
||||
if(!strcmp(name, "__members__"))
|
||||
return PyDict_Keys(self->dict);
|
||||
|
||||
if(!strcmp(name, "__methods__")) {
|
||||
PyObject *value = PyString_FromString ( name );
|
||||
v = PyObject_GenericGetAttr( (PyObject *)self, value );
|
||||
Py_DECREF( value);
|
||||
return v;
|
||||
}
|
||||
|
||||
v = PyDict_GetItemString(self->dict, name);
|
||||
if(v) {
|
||||
return EXPP_incr_ret(v); /* was a borrowed ref */
|
||||
}
|
||||
return (EXPP_ReturnPyObjError(PyExc_AttributeError,
|
||||
"attribute not found"));
|
||||
}
|
||||
return (EXPP_ReturnPyObjError(PyExc_RuntimeError,
|
||||
"constant object lacks a dictionary"));
|
||||
}
|
||||
|
||||
//------------------------tp_getattro
|
||||
static PyObject *constant_getAttro(BPy_constant * self, PyObject *value)
|
||||
{
|
||||
if(self->dict) {
|
||||
@ -212,8 +186,7 @@ PyTypeObject constant_Type = {
|
||||
0, //tp_itemsize
|
||||
(destructor)constant_dealloc, //tp_dealloc
|
||||
0, //tp_print
|
||||
// (getattrfunc)constant_getAttr, //tp_getattr
|
||||
0, //tp_getattr
|
||||
0, //tp_getattr
|
||||
0, //tp_setattr
|
||||
0, //tp_compare
|
||||
(reprfunc) constant_repr, //tp_repr
|
||||
|
@ -645,7 +645,6 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2)
|
||||
|
||||
} else if (MatrixObject_Check(v2)) {
|
||||
float vecCopy[4];
|
||||
double dot;
|
||||
int x,y, size= vec->size;
|
||||
MatrixObject *mat= (MatrixObject*)v2;
|
||||
|
||||
@ -664,11 +663,11 @@ static PyObject *Vector_imul(PyObject * v1, PyObject * v2)
|
||||
|
||||
/*muliplication*/
|
||||
for(x = 0, i = 0; x < mat->colSize; x++) {
|
||||
double dot = 0.0f;
|
||||
for(y = 0; y < mat->rowSize; y++) {
|
||||
dot += mat->matrix[y][x] * vecCopy[y];
|
||||
}
|
||||
vec->vec[i++] = (float)dot;
|
||||
dot = 0.0f;
|
||||
}
|
||||
Py_INCREF( v1 );
|
||||
return v1;
|
||||
|
@ -3155,10 +3155,10 @@ static float isfaceConcave(float fake[4][3])
|
||||
areaB = AreaT3Dfl(fake[1], fake[2], fake[3]) + AreaT3Dfl(fake[3], fake[0], fake[1]);
|
||||
|
||||
if(areaA <= areaB) minarea = areaA;
|
||||
else if(areaB < areaA) minarea = areaB;
|
||||
else minarea = areaB;
|
||||
|
||||
if(areaA >= areaB) maxarea = areaA;
|
||||
else if(areaB > areaA) maxarea = areaB;
|
||||
else maxarea = areaB;
|
||||
|
||||
if(!maxarea) return 1;
|
||||
else return 1 - (minarea / maxarea);
|
||||
|
@ -1121,7 +1121,6 @@ static int add_seq_effect(int type, char *str)
|
||||
int cfra, machine;
|
||||
short mval[2];
|
||||
struct SeqEffectHandle sh;
|
||||
int mode;
|
||||
|
||||
if(G.scene->ed==0) return 0;
|
||||
ed= G.scene->ed;
|
||||
|
Loading…
Reference in New Issue
Block a user