diff options
author | Campbell Barton <ideasman42@gmail.com> | 2005-12-15 05:06:37 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2005-12-15 05:06:37 +0300 |
commit | 4a8087db763496acc9dd0b7188557374c4c60322 (patch) | |
tree | b28423aed95de6f604a806b782ffec749a4f94e1 /source/blender/python/api2_2x/Image.c | |
parent | b662fcb694ecdf1312c45b5d5cd8c0f07d955d13 (diff) |
Fixed some warnings from GetCurrent, remaining warnings seem to have no obvious solution
attr = Py_True; // Image.c:1107: warning: dereferencing type-punned pointer will break strict-aliasing rules
Diffstat (limited to 'source/blender/python/api2_2x/Image.c')
-rw-r--r-- | source/blender/python/api2_2x/Image.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/python/api2_2x/Image.c b/source/blender/python/api2_2x/Image.c index ffd129f303a..a6de6d21263 100644 --- a/source/blender/python/api2_2x/Image.c +++ b/source/blender/python/api2_2x/Image.c @@ -100,7 +100,7 @@ returns None if not found.\n"; struct PyMethodDef M_Image_methods[] = { {"New", M_Image_New, METH_VARARGS, M_Image_New_doc}, {"Get", M_Image_Get, METH_VARARGS, M_Image_Get_doc}, - {"GetCurrent", M_Image_GetCurrent, METH_NOARGS, M_Image_GetCurrent_doc}, + {"GetCurrent", ( PyCFunction ) M_Image_GetCurrent, METH_NOARGS, M_Image_GetCurrent_doc}, {"get", M_Image_Get, METH_VARARGS, M_Image_Get_doc}, {"Load", M_Image_Load, METH_VARARGS, M_Image_Load_doc}, {NULL, NULL, 0, NULL} @@ -126,7 +126,7 @@ static PyObject *M_Image_New( PyObject * self, PyObject * args) if( !img ) return ( EXPP_ReturnPyObjError( PyExc_MemoryError, "couldn't create PyObject Image_Type" ) ); - image_changed(img, 0); + // image_changed(img, 0); return Image_CreatePyObject( img ); } @@ -1104,12 +1104,11 @@ static PyObject *Image_getAttr( BPy_Image * self, char *name ) attr = PyInt_FromLong( self->image->animspeed ); else if( strcmp( name, "packed" ) == 0 ) { if (self->image->packedfile) { - //Py_INCREF(Py_True); attr = Py_True; } else { - //Py_INCREF(Py_False); attr = Py_False; } + Py_INCREF(attr); } else if( strcmp( name, "bindcode" ) == 0 ) attr = PyInt_FromLong( self->image->bindcode ); |