Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r--source/blender/python/intern/bpy.c10
-rw-r--r--source/blender/python/intern/bpy_app.c66
-rw-r--r--source/blender/python/intern/bpy_array.c10
-rw-r--r--source/blender/python/intern/bpy_interface.c4
-rw-r--r--source/blender/python/intern/bpy_operator.c10
-rw-r--r--source/blender/python/intern/bpy_operator_wrap.c2
-rw-r--r--source/blender/python/intern/bpy_rna.c59
-rw-r--r--source/blender/python/intern/bpy_rna.h2
-rw-r--r--source/blender/python/intern/bpy_rna_callback.c3
9 files changed, 114 insertions, 52 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c
index 69b5faceca0..afcf7e757e6 100644
--- a/source/blender/python/intern/bpy.c
+++ b/source/blender/python/intern/bpy.c
@@ -34,7 +34,9 @@
#include "BLI_path_util.h"
#include "BLI_bpath.h"
-
+
+#include "BKE_utildefines.h"
+
/* external util modules */
#include "../generic/geometry.h"
#include "../generic/bgl.h"
@@ -51,7 +53,7 @@ static char bpy_script_paths_doc[] =
" :return: (system, user) strings will be empty when not found.\n"
" :rtype: tuple of strigs\n";
-PyObject *bpy_script_paths(PyObject *self)
+PyObject *bpy_script_paths(PyObject *UNUSED(self))
{
PyObject *ret= PyTuple_New(2);
char *path;
@@ -73,7 +75,7 @@ static char bpy_blend_paths_doc[] =
" :type absolute: boolean\n"
" :return: path list.\n"
" :rtype: list of strigs\n";
-static PyObject *bpy_blend_paths(PyObject * self, PyObject *args, PyObject *kw)
+static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
{
struct BPathIterator bpi;
PyObject *list = PyList_New(0), *st; /* stupidly big string to be safe */
@@ -124,7 +126,7 @@ static char bpy_user_resource_doc[] =
" :type subdir: string\n"
" :return: a path.\n"
" :rtype: string\n";
-static PyObject *bpy_user_resource(PyObject * self, PyObject *args, PyObject *kw)
+static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObject *kw)
{
char *type;
char *subdir= NULL;
diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c
index 78658a611a3..39494678a12 100644
--- a/source/blender/python/intern/bpy_app.c
+++ b/source/blender/python/intern/bpy_app.c
@@ -26,16 +26,22 @@
#include "BLI_path_util.h"
+#include "BKE_utildefines.h"
#include "BKE_blender.h"
#include "BKE_global.h"
#include "structseq.h"
+#include "../generic/py_capi_utils.h"
+
#ifdef BUILD_DATE
extern char build_date[];
extern char build_time[];
extern char build_rev[];
extern char build_platform[];
extern char build_type[];
+extern char build_cflags[];
+extern char build_cxxflags[];
+extern char build_linkflags[];
#endif
static PyTypeObject BlenderAppType;
@@ -44,7 +50,6 @@ static PyStructSequence_Field app_info_fields[] = {
{"version", "The Blender version as a tuple of 3 numbers. eg. (2, 50, 11)"},
{"version_string", "The Blender version formatted as a string"},
{"binary_path", "The location of blenders executable, useful for utilities that spawn new instances"},
- {"debug", "Boolean, set when blender is running in debug mode (started with -d)"},
{"background", "Boolean, True when blender is running without a user interface (started with -b)"},
/* buildinfo */
@@ -53,6 +58,9 @@ static PyStructSequence_Field app_info_fields[] = {
{"build_revision", "The subversion revision this blender instance was built with"},
{"build_platform", "The platform this blender instance was built for"},
{"build_type", "The type of build (Release, Debug)"},
+ {"build_cflags", ""},
+ {"build_cxxflags", ""},
+ {"build_linkflags", ""},
{0}
};
@@ -85,7 +93,6 @@ static PyObject *make_app_info(void)
SetObjItem(Py_BuildValue("(iii)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION));
SetObjItem(PyUnicode_FromFormat("%d.%02d (sub %d)", BLENDER_VERSION/100, BLENDER_VERSION%100, BLENDER_SUBVERSION));
SetStrItem(bprogname);
- SetObjItem(PyBool_FromLong(G.f & G_DEBUG));
SetObjItem(PyBool_FromLong(G.background));
/* build info */
@@ -95,12 +102,18 @@ static PyObject *make_app_info(void)
SetStrItem(build_rev);
SetStrItem(build_platform);
SetStrItem(build_type);
+ SetStrItem(build_cflags);
+ SetStrItem(build_cxxflags);
+ SetStrItem(build_linkflags);
#else
SetStrItem("Unknown");
SetStrItem("Unknown");
SetStrItem("Unknown");
SetStrItem("Unknown");
SetStrItem("Unknown");
+ SetStrItem("Unknown");
+ SetStrItem("Unknown");
+ SetStrItem("Unknown");
#endif
#undef SetIntItem
@@ -114,10 +127,51 @@ static PyObject *make_app_info(void)
return app_info;
}
+/* a few getsets because it makes sense for them to be in bpy.app even though
+ * they are not static */
+static PyObject *bpy_app_debug_get(PyObject *UNUSED(self), void *UNUSED(closure))
+{
+ return PyBool_FromLong(G.f & G_DEBUG);
+}
+
+static int bpy_app_debug_set(PyObject *UNUSED(self), PyObject *value, void *UNUSED(closure))
+{
+ int param= PyObject_IsTrue(value);
+
+ if(param < 0) {
+ PyErr_SetString(PyExc_TypeError, "bpy.app.debug can only be True/False");
+ return -1;
+ }
+
+ if(param) G.f |= G_DEBUG;
+ else G.f &= ~G_DEBUG;
+
+ return 0;
+}
+
+static PyObject *bpy_app_tempdir_get(PyObject *UNUSED(self), void *UNUSED(closure))
+{
+ extern char btempdir[];
+ return PyC_UnicodeFromByte(btempdir);
+}
+
+PyGetSetDef bpy_app_debug_getset= {"debug", bpy_app_debug_get, bpy_app_debug_set, "Boolean, set when blender is running in debug mode (started with -d)", NULL};
+PyGetSetDef bpy_app_tempdir_getset= {"tempdir", bpy_app_tempdir_get, NULL, "String, the temp directory used by blender (read-only)", NULL};
+
+static void py_struct_seq_getset_init(void)
+{
+ /* tricky dynamic members, not to py-spec! */
+
+ PyDict_SetItemString(BlenderAppType.tp_dict, bpy_app_debug_getset.name, PyDescr_NewGetSet(&BlenderAppType, &bpy_app_debug_getset));
+ PyDict_SetItemString(BlenderAppType.tp_dict, bpy_app_tempdir_getset.name, PyDescr_NewGetSet(&BlenderAppType, &bpy_app_tempdir_getset));
+}
+/* end dynamic bpy.app */
+
+
PyObject *BPY_app_struct(void)
{
PyObject *ret;
-
+
PyStructSequence_InitType(&BlenderAppType, &app_info_desc);
ret= make_app_info();
@@ -125,6 +179,10 @@ PyObject *BPY_app_struct(void)
/* prevent user from creating new instances */
BlenderAppType.tp_init = NULL;
BlenderAppType.tp_new = NULL;
-
+
+ /* kindof a hack ontop of PyStructSequence */
+ py_struct_seq_getset_init();
+
return ret;
}
+
diff --git a/source/blender/python/intern/bpy_array.c b/source/blender/python/intern/bpy_array.c
index 6d971d8708e..d219757b777 100644
--- a/source/blender/python/intern/bpy_array.c
+++ b/source/blender/python/intern/bpy_array.c
@@ -237,7 +237,7 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int
return data;
}
-static int py_to_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix)
+static int py_to_array(PyObject *py, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix)
{
int totdim, dim_size[MAX_ARRAY_DIMENSION];
int totitem;
@@ -358,18 +358,18 @@ static void bool_set_index(PointerRNA *ptr, PropertyRNA *prop, int index, void *
RNA_property_boolean_set_index(ptr, prop, index, *(int*)value);
}
-int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, char *param_data, PyObject *py, const char *error_prefix)
+int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix)
{
int ret;
switch (RNA_property_type(prop)) {
case PROP_FLOAT:
- ret= py_to_array(py, ptr, prop, parms, param_data, py_float_check, "float", sizeof(float), py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix);
+ ret= py_to_array(py, ptr, prop, param_data, py_float_check, "float", sizeof(float), py_to_float, (RNA_SetArrayFunc)RNA_property_float_set_array, error_prefix);
break;
case PROP_INT:
- ret= py_to_array(py, ptr, prop, parms, param_data, py_int_check, "int", sizeof(int), py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix);
+ ret= py_to_array(py, ptr, prop, param_data, py_int_check, "int", sizeof(int), py_to_int, (RNA_SetArrayFunc)RNA_property_int_set_array, error_prefix);
break;
case PROP_BOOLEAN:
- ret= py_to_array(py, ptr, prop, parms, param_data, py_bool_check, "boolean", sizeof(int), py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix);
+ ret= py_to_array(py, ptr, prop, param_data, py_bool_check, "boolean", sizeof(int), py_to_bool, (RNA_SetArrayFunc)RNA_property_boolean_set_array, error_prefix);
break;
default:
PyErr_SetString(PyExc_TypeError, "not an array type");
diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c
index bc79ba94756..3ff0d86b433 100644
--- a/source/blender/python/intern/bpy_interface.c
+++ b/source/blender/python/intern/bpy_interface.c
@@ -43,6 +43,7 @@
#include "BLI_math_base.h"
#include "BLI_string.h"
+#include "BKE_utildefines.h"
#include "BKE_context.h"
#include "BKE_text.h"
#include "BKE_font.h" /* only for utf8towchar */
@@ -104,7 +105,8 @@ void bpy_context_set(bContext *C, PyGILState_STATE *gilstate)
}
}
-void bpy_context_clear(bContext *C, PyGILState_STATE *gilstate)
+/* context should be used but not now because it causes some bugs */
+void bpy_context_clear(bContext *UNUSED(C), PyGILState_STATE *gilstate)
{
py_call_level--;
diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c
index 2b475a57de6..3ffa78dab70 100644
--- a/source/blender/python/intern/bpy_operator.c
+++ b/source/blender/python/intern/bpy_operator.c
@@ -40,7 +40,7 @@
#include "MEM_guardedalloc.h"
#include "BKE_report.h"
-static PyObject *pyop_poll( PyObject * self, PyObject * args)
+static PyObject *pyop_poll(PyObject *UNUSED(self), PyObject *args)
{
wmOperatorType *ot;
char *opname;
@@ -80,7 +80,7 @@ static PyObject *pyop_poll( PyObject * self, PyObject * args)
return ret;
}
-static PyObject *pyop_call( PyObject * self, PyObject * args)
+static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args)
{
wmOperatorType *ot;
int error_val = 0;
@@ -196,7 +196,7 @@ static PyObject *pyop_call( PyObject * self, PyObject * args)
}
-static PyObject *pyop_as_string( PyObject * self, PyObject * args)
+static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args)
{
wmOperatorType *ot;
PointerRNA ptr;
@@ -248,7 +248,7 @@ static PyObject *pyop_as_string( PyObject * self, PyObject * args)
return pybuf;
}
-static PyObject *pyop_dir(PyObject *self)
+static PyObject *pyop_dir(PyObject *UNUSED(self))
{
PyObject *list = PyList_New(0), *name;
wmOperatorType *ot;
@@ -262,7 +262,7 @@ static PyObject *pyop_dir(PyObject *self)
return list;
}
-static PyObject *pyop_getrna(PyObject *self, PyObject *value)
+static PyObject *pyop_getrna(PyObject *UNUSED(self), PyObject *value)
{
wmOperatorType *ot;
PointerRNA ptr;
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c
index 6d16896fb16..fa1aeacbc42 100644
--- a/source/blender/python/intern/bpy_operator_wrap.c
+++ b/source/blender/python/intern/bpy_operator_wrap.c
@@ -84,7 +84,7 @@ void macro_wrapper(wmOperatorType *ot, void *userdata)
operator_properties_init(ot);
}
-PyObject *PYOP_wrap_macro_define(PyObject *self, PyObject *args)
+PyObject *PYOP_wrap_macro_define(PyObject *UNUSED(self), PyObject *args)
{
wmOperatorType *ot;
wmOperatorTypeMacro *otmacro;
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c
index 93106d5400f..a3b0c4739c4 100644
--- a/source/blender/python/intern/bpy_rna.c
+++ b/source/blender/python/intern/bpy_rna.c
@@ -58,7 +58,7 @@
#include "../generic/IDProp.h" /* for IDprop lookups */
#include "../generic/py_capi_utils.h"
-static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, void *data, PyObject *value, const char *error_prefix);
+static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix);
static PyObject *pyrna_prop_array_subscript_slice(BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, int start, int stop, int length);
static Py_ssize_t pyrna_prop_array_length(BPy_PropertyArrayRNA *self);
static Py_ssize_t pyrna_prop_collection_length(BPy_PropertyRNA *self);
@@ -135,7 +135,7 @@ static int mathutils_rna_vector_set(BaseMathObject *bmo, int subtype)
return 1;
}
-static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int subtype, int index)
+static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int UNUSED(subtype), int index)
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
@@ -146,7 +146,7 @@ static int mathutils_rna_vector_get_index(BaseMathObject *bmo, int subtype, int
return 1;
}
-static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int subtype, int index)
+static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int UNUSED(subtype), int index)
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
@@ -176,7 +176,7 @@ Mathutils_Callback mathutils_rna_array_cb = {
/* bpyrna matrix callbacks */
static int mathutils_rna_matrix_cb_index= -1; /* index for our callbacks */
-static int mathutils_rna_matrix_get(BaseMathObject *bmo, int subtype)
+static int mathutils_rna_matrix_get(BaseMathObject *bmo, int UNUSED(subtype))
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
@@ -187,7 +187,7 @@ static int mathutils_rna_matrix_get(BaseMathObject *bmo, int subtype)
return 1;
}
-static int mathutils_rna_matrix_set(BaseMathObject *bmo, int subtype)
+static int mathutils_rna_matrix_set(BaseMathObject *bmo, int UNUSED(subtype))
{
BPy_PropertyRNA *self= (BPy_PropertyRNA *)bmo->cb_user;
@@ -864,7 +864,7 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha
break;
}
} else {
- if (pyrna_py_to_prop(ptr, prop, NULL, NULL, item, error_prefix)) {
+ if (pyrna_py_to_prop(ptr, prop, NULL, item, error_prefix)) {
error_val= -1;
break;
}
@@ -918,7 +918,7 @@ static PyObject *pyrna_func_to_py(BPy_DummyPointerRNA *pyrna, FunctionRNA *func)
-static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, void *data, PyObject *value, const char *error_prefix)
+static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyObject *value, const char *error_prefix)
{
/* XXX hard limits should be checked here */
int type = RNA_property_type(prop);
@@ -941,7 +941,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *p
return -1;
}
/* done getting the length */
- ok= pyrna_py_to_array(ptr, prop, parms, data, value, error_prefix);
+ ok= pyrna_py_to_array(ptr, prop, data, value, error_prefix);
if (!ok) {
/* PyErr_Format(PyExc_AttributeError, "%.200s %s", error_prefix, error_str); */
@@ -964,7 +964,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, ParameterList *p
else
param = PyLong_AsLong( value );
- if( param < 0 || param > 1) {
+ if(param < 0) {
PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected True/False or 0/1", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop));
return -1;
} else {
@@ -1391,7 +1391,7 @@ static PyObject *pyrna_prop_collection_subscript_str(BPy_PropertyRNA *self, cons
}
/* static PyObject *pyrna_prop_array_subscript_str(BPy_PropertyRNA *self, char *keyname) */
-static PyObject *pyrna_prop_collection_subscript_slice(PointerRNA *ptr, PropertyRNA *prop, int start, int stop, int length)
+static PyObject *pyrna_prop_collection_subscript_slice(PointerRNA *ptr, PropertyRNA *prop, int start, int stop)
{
PointerRNA newptr;
PyObject *list = PyList_New(stop - start);
@@ -1513,7 +1513,7 @@ static PyObject *pyrna_prop_collection_subscript(BPy_PropertyRNA *self, PyObject
return PyList_New(0);
}
else if (step == 1) {
- return pyrna_prop_collection_subscript_slice(&self->ptr, self->prop, start, stop, len);
+ return pyrna_prop_collection_subscript_slice(&self->ptr, self->prop, start, stop);
}
else {
PyErr_SetString(PyExc_TypeError, "bpy_prop_collection[slice]: slice steps not supported with rna");
@@ -2431,7 +2431,7 @@ static char pyrna_struct_type_recast_doc[] =
" :return: a new instance of this object with the type initialized again.\n"
" :rtype: subclass of :class:`bpy_struct`";
-static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self, PyObject *args)
+static PyObject *pyrna_struct_type_recast(BPy_StructRNA *self)
{
PointerRNA r_ptr;
RNA_pointer_recast(&self->ptr, &r_ptr);
@@ -2751,7 +2751,7 @@ static int pyrna_struct_setattro( BPy_StructRNA *self, PyObject *pyname, PyObjec
PyErr_SetString(PyExc_AttributeError, "bpy_struct: del not supported");
return -1;
}
- return pyrna_py_to_prop(&self->ptr, prop, NULL, NULL, value, "bpy_struct: item.attr = val:");
+ return pyrna_py_to_prop(&self->ptr, prop, NULL, value, "bpy_struct: item.attr = val:");
}
else {
return PyObject_GenericSetAttr((PyObject *)self, pyname, value);
@@ -2835,7 +2835,7 @@ static int pyrna_prop_collection_setattro( BPy_PropertyRNA *self, PyObject *pyna
else if(RNA_property_collection_type_get(&self->ptr, self->prop, &r_ptr)) {
if ((prop = RNA_struct_find_property(&r_ptr, name))) {
/* pyrna_py_to_prop sets its own exceptions */
- return pyrna_py_to_prop(&r_ptr, prop, NULL, NULL, value, "BPy_PropertyRNA - Attribute (setattr):");
+ return pyrna_py_to_prop(&r_ptr, prop, NULL, value, "BPy_PropertyRNA - Attribute (setattr):");
}
}
@@ -3409,7 +3409,7 @@ static struct PyMethodDef pyrna_prop_collection_idprop_methods[] = {
/* only needed for subtyping, so a new class gets a valid BPy_StructRNA
* todo - also accept useful args */
-static PyObject * pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
+static PyObject * pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) {
BPy_StructRNA *base;
@@ -3432,7 +3432,7 @@ static PyObject * pyrna_struct_new(PyTypeObject *type, PyObject *args, PyObject
/* only needed for subtyping, so a new class gets a valid BPy_StructRNA
* todo - also accept useful args */
-static PyObject * pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *kwds) {
+static PyObject * pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *UNUSED(kwds)) {
BPy_PropertyRNA *base;
@@ -3454,15 +3454,14 @@ static PyObject * pyrna_prop_new(PyTypeObject *type, PyObject *args, PyObject *k
}
}
-PyObject *pyrna_param_to_py(PointerRNA *ptr, ParameterList *parms, PropertyRNA *prop, void *data)
+PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data)
{
PyObject *ret;
int type = RNA_property_type(prop);
int flag = RNA_property_flag(prop);
- int a;
if(RNA_property_array_check(ptr, prop)) {
- int len;
+ int a, len;
if (flag & PROP_DYNAMIC) {
ParameterDynAlloc *data_alloc= data;
@@ -3705,7 +3704,7 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
continue;
}
- err= pyrna_py_to_prop(&funcptr, parm, &parms, iter.data, item, "");
+ err= pyrna_py_to_prop(&funcptr, parm, iter.data, item, "");
if(err!=0) {
/* the error generated isnt that useful, so generate it again with a useful prefix
@@ -3718,7 +3717,7 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
else
snprintf(error_prefix, sizeof(error_prefix), "%s.%s(): error with argument %d, \"%s\" - ", RNA_struct_identifier(self_ptr->type), RNA_function_identifier(self_func), i, parm_id);
- pyrna_py_to_prop(&funcptr, parm, &parms, iter.data, item, error_prefix);
+ pyrna_py_to_prop(&funcptr, parm, iter.data, item, error_prefix);
break;
}
@@ -3823,13 +3822,13 @@ static PyObject * pyrna_func_call(PyObject *self, PyObject *args, PyObject *kw)
flag= RNA_property_flag(parm);
if (flag & PROP_OUTPUT)
- PyTuple_SET_ITEM(ret, i++, pyrna_param_to_py(&funcptr, &parms, parm, iter.data));
+ PyTuple_SET_ITEM(ret, i++, pyrna_param_to_py(&funcptr, parm, iter.data));
}
RNA_parameter_list_end(&iter);
}
else
- ret= pyrna_param_to_py(&funcptr, &parms, pret_single, retdata_single);
+ ret= pyrna_param_to_py(&funcptr, pret_single, retdata_single);
/* possible there is an error in conversion */
if(ret==NULL)
@@ -5013,7 +5012,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun
if(strcmp(identifier, rna_attr) == 0) { \
item= PyObject_GetAttrString(py_class, py_attr); \
if(item && item != Py_None) { \
- if(pyrna_py_to_prop(dummyptr, prop, NULL, NULL, item, "validating class error:") != 0) { \
+ if(pyrna_py_to_prop(dummyptr, prop, NULL, item, "validating class error:") != 0) { \
Py_DECREF(item); \
return -1; \
} \
@@ -5037,7 +5036,7 @@ static int bpy_class_validate(PointerRNA *dummyptr, void *py_data, int *have_fun
else {
Py_DECREF(item); /* no need to keep a ref, the class owns it */
- if(pyrna_py_to_prop(dummyptr, prop, NULL, NULL, item, "validating class error:") != 0)
+ if(pyrna_py_to_prop(dummyptr, prop, NULL, item, "validating class error:") != 0)
return -1;
}
}
@@ -5157,7 +5156,7 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par
continue;
}
- parmitem= pyrna_param_to_py(&funcptr, parms, parm, iter.data);
+ parmitem= pyrna_param_to_py(&funcptr, parm, iter.data);
PyTuple_SET_ITEM(args, i, parmitem);
i++;
}
@@ -5192,7 +5191,7 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par
err= -1;
}
else if(ret_len==1) {
- err= pyrna_py_to_prop(&funcptr, pret_single, parms, retdata_single, ret, "calling class function:");
+ err= pyrna_py_to_prop(&funcptr, pret_single, retdata_single, ret, "calling class function:");
}
else if (ret_len > 1) {
@@ -5215,7 +5214,7 @@ static int bpy_class_call(PointerRNA *ptr, FunctionRNA *func, ParameterList *par
/* only useful for single argument returns, we'll need another list loop for multiple */
if (flag & PROP_OUTPUT) {
- err= pyrna_py_to_prop(&funcptr, parm, parms, iter.data, PyTuple_GET_ITEM(ret, i++), "calling class function:");
+ err= pyrna_py_to_prop(&funcptr, parm, iter.data, PyTuple_GET_ITEM(ret, i++), "calling class function:");
if(err)
break;
}
@@ -5329,7 +5328,7 @@ void pyrna_free_types(void)
* - Should still be fixed - Campbell
* */
-static PyObject *pyrna_basetype_register(PyObject *self, PyObject *py_class)
+static PyObject *pyrna_basetype_register(PyObject *UNUSED(self), PyObject *py_class)
{
bContext *C= NULL;
ReportList reports;
@@ -5426,7 +5425,7 @@ static int pyrna_srna_contains_pointer_prop_srna(StructRNA *srna_props, StructRN
return 0;
}
-static PyObject *pyrna_basetype_unregister(PyObject *self, PyObject *py_class)
+static PyObject *pyrna_basetype_unregister(PyObject *UNUSED(self), PyObject *py_class)
{
bContext *C= NULL;
StructUnregisterFunc unreg;
diff --git a/source/blender/python/intern/bpy_rna.h b/source/blender/python/intern/bpy_rna.h
index 7f750f94242..77b602b6f83 100644
--- a/source/blender/python/intern/bpy_rna.h
+++ b/source/blender/python/intern/bpy_rna.h
@@ -99,7 +99,7 @@ void pyrna_alloc_types(void);
void pyrna_free_types(void);
/* primitive type conversion */
-int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, ParameterList *parms, char *param_data, PyObject *py, const char *error_prefix);
+int pyrna_py_to_array(PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix);
int pyrna_py_to_array_index(PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix);
PyObject *pyrna_array_index(PointerRNA *ptr, PropertyRNA *prop, int index);
diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c
index b2a7511f998..81d6e0cd4da 100644
--- a/source/blender/python/intern/bpy_rna_callback.c
+++ b/source/blender/python/intern/bpy_rna_callback.c
@@ -27,6 +27,7 @@
#include "bpy_util.h"
#include "DNA_screen_types.h"
+#include "BKE_utildefines.h"
#include "BKE_context.h"
#include "ED_space_api.h"
@@ -34,7 +35,7 @@
#define RNA_CAPSULE_ID "RNA_HANDLE"
#define RNA_CAPSULE_ID_INVALID "RNA_HANDLE_REMOVED"
-void cb_region_draw(const bContext *C, ARegion *ar, void *customdata)
+void cb_region_draw(const bContext *C, ARegion *UNUSED(ar), void *customdata)
{
PyObject *cb_func, *cb_args, *result;
PyGILState_STATE gilstate;