diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-03-21 19:03:26 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-03-21 19:03:26 +0300 |
commit | 935f10dc45e482061f1af230d3f9a9f878000379 (patch) | |
tree | bd0de96c2cce465391c76a7d62050a903e09612f /source/blender | |
parent | 6ab2d7ad659606cbf2a315ef9a576c364e6ec9bb (diff) |
get rid of warnings, fix for a refcount error
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 8 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_operator.c | 8 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_opwrapper.h | 7 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_util.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_util.h | 5 |
6 files changed, 16 insertions, 18 deletions
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 8f01d60ad4b..7093916310e 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -62,13 +62,13 @@ static PyObject *CreateGlobalDictionary( bContext *C ) { PyMethodDef *ml; static PyMethodDef bpy_prop_meths[] = { - {"FloatProperty", BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, - {"IntProperty", BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, - {"BoolProperty", BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"FloatProperty", (PyCFunction)BPy_FloatProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"IntProperty", (PyCFunction)BPy_IntProperty, METH_VARARGS|METH_KEYWORDS, ""}, + {"BoolProperty", (PyCFunction)BPy_BoolProperty, METH_VARARGS|METH_KEYWORDS, ""}, {NULL, NULL, 0, NULL} }; - for(ml = &bpy_prop_meths; ml->ml_name; ml++) { + for(ml = bpy_prop_meths; ml->ml_name; ml++) { PyDict_SetItemString( dict, ml->ml_name, PyCFunction_New(ml, NULL)); } } diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index b40d4640bcb..02f4723c037 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -192,7 +192,7 @@ static PyObject *pyop_base_call( PyObject * self, PyObject * args, PyObject * k } static PyMethodDef pyop_base_call_meth[] = { - {"__op_call__", pyop_base_call, METH_VARARGS|METH_KEYWORDS, "generic operator calling function"} + {"__op_call__", (PyCFunction)pyop_base_call, METH_VARARGS|METH_KEYWORDS, "generic operator calling function"} }; @@ -252,10 +252,10 @@ static PyObject *pyop_base_rna(PyObject *self, PyObject *pyname) pyrna= (BPy_StructRNA *)pyrna_struct_CreatePyObject(&ptr); /* were not really using &ptr, overwite next */ //pyrna->freeptr= 1; - return pyrna; + return (PyObject *)pyrna; } else { - PyErr_SetString(PyExc_AttributeError, "Operator not found"); + PyErr_Format(PyExc_AttributeError, "Operator \"%s\" not found", name); return NULL; } } @@ -277,5 +277,3 @@ PyObject *BPY_operator_module( bContext *C ) return (PyObject *)PyObject_NEW( BPy_OperatorBase, &pyop_base_Type ); } - - diff --git a/source/blender/python/intern/bpy_opwrapper.h b/source/blender/python/intern/bpy_opwrapper.h index ae607735498..04120a81517 100644 --- a/source/blender/python/intern/bpy_opwrapper.h +++ b/source/blender/python/intern/bpy_opwrapper.h @@ -32,10 +32,3 @@ PyObject *PYOP_wrap_add(PyObject *self, PyObject *args); PyObject *PYOP_wrap_remove(PyObject *self, PyObject *args); #endif - - - - - - - diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 8f08ce6308d..dfa8d8dd968 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1067,7 +1067,7 @@ PyObject* pyrna_struct_Subtype(PointerRNA *ptr) if (ptr->type==NULL) { newclass= NULL; /* Nothing to do */ - } else if ((newclass= BPy_RNA_PYTYPE(ptr->data))) { + } else if ((newclass= (PyObject *)BPy_RNA_PYTYPE(ptr->data))) { Py_INCREF(newclass); } else if ((nameprop = RNA_struct_name_property(ptr))) { /* for now, return the base RNA type rather then a real module */ @@ -1142,7 +1142,7 @@ PyObject *pyrna_struct_CreatePyObject( PointerRNA *ptr ) } if (ptr->type == &RNA_Struct) { /* always return a python subtype from rna struct types */ - PyTypeObject *tp = pyrna_struct_Subtype(ptr); + PyTypeObject *tp = (PyTypeObject *)pyrna_struct_Subtype(ptr); if (tp) { pyrna = (BPy_StructRNA *) tp->tp_alloc(tp, 0); diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index ce307b5d8ac..7979ca9cd37 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -212,6 +212,8 @@ void BPY_getFileAndNum(char **filename, int *lineno) *lineno = (int)PyLong_AsSsize_t(f_lineno); Py_DECREF(f_lineno); } + + Py_DECREF(frame); } /* Would be nice if python had this built in */ diff --git a/source/blender/python/intern/bpy_util.h b/source/blender/python/intern/bpy_util.h index 29e05228e7c..51e13f98a35 100644 --- a/source/blender/python/intern/bpy_util.h +++ b/source/blender/python/intern/bpy_util.h @@ -24,6 +24,9 @@ #include <Python.h> +#ifndef BPY_UTIL_H +#define BPY_UTIL_H + #include "bpy_compat.h" /* for internal use only, so python can interchange a sequence of strings with flags */ @@ -42,3 +45,5 @@ void BPY_getFileAndNum(char **filename, int *lineno); /* own python like utility function */ PyObject *PyObject_GetAttrStringArgs(PyObject *o, Py_ssize_t n, ...); + +#endif |