diff options
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy.c | 12 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_app.c | 36 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_driver.c | 2 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_interface.c | 12 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 22 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 26 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_util.c | 2 |
7 files changed, 56 insertions, 56 deletions
diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 584ba235e30..1843d0ac93a 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -85,9 +85,9 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec const char *lib; int absolute = 0; - static char *kwlist[] = {"absolute", NULL}; + static const char *kwlist[] = {"absolute", NULL}; - if (!PyArg_ParseTupleAndKeywords(args, kw, "|i:blend_paths", kwlist, &absolute)) + if (!PyArg_ParseTupleAndKeywords(args, kw, "|i:blend_paths", (char **)kwlist, &absolute)) return NULL; for(BLI_bpathIterator_init(&bpi, NULL); !BLI_bpathIterator_isDone(&bpi); BLI_bpathIterator_step(&bpi)) { @@ -132,11 +132,11 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj char *type; char *subdir= NULL; int folder_id; - static char *kwlist[] = {"type", "subdir", NULL}; + static const char *kwlist[] = {"type", "subdir", NULL}; char *path; - if (!PyArg_ParseTupleAndKeywords(args, kw, "s|s:user_resource", kwlist, &type, &subdir)) + if (!PyArg_ParseTupleAndKeywords(args, kw, "s|s:user_resource", (char **)kwlist, &type, &subdir)) return NULL; /* stupid string compare */ @@ -162,9 +162,9 @@ static PyMethodDef meth_bpy_script_paths = {"script_paths", (PyCFunction)bpy_scr static PyMethodDef meth_bpy_blend_paths = {"blend_paths", (PyCFunction)bpy_blend_paths, METH_VARARGS|METH_KEYWORDS, bpy_blend_paths_doc}; static PyMethodDef meth_bpy_user_resource = {"user_resource", (PyCFunction)bpy_user_resource, METH_VARARGS|METH_KEYWORDS, bpy_user_resource_doc}; -static void bpy_import_test(char *modname) +static void bpy_import_test(const char *modname) { - PyObject *mod= PyImport_ImportModuleLevel(modname, NULL, NULL, NULL, 0); + PyObject *mod= PyImport_ImportModuleLevel((char *)modname, NULL, NULL, NULL, 0); if(mod) { Py_DECREF(mod); } diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 8977c82dc7c..21a97462dda 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -48,27 +48,27 @@ extern char build_system[]; static PyTypeObject BlenderAppType; 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"}, - {"background", "Boolean, True when blender is running without a user interface (started with -b)"}, + {(char *)"version", (char *)"The Blender version as a tuple of 3 numbers. eg. (2, 50, 11)"}, + {(char *)"version_string", (char *)"The Blender version formatted as a string"}, + {(char *)"binary_path", (char *)"The location of blenders executable, useful for utilities that spawn new instances"}, + {(char *)"background", (char *)"Boolean, True when blender is running without a user interface (started with -b)"}, /* buildinfo */ - {"build_date", "The date this blender instance was built"}, - {"build_time", "The time this blender instance was built"}, - {"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", ""}, - {"build_system", ""}, + {(char *)"build_date", (char *)"The date this blender instance was built"}, + {(char *)"build_time", (char *)"The time this blender instance was built"}, + {(char *)"build_revision", (char *)"The subversion revision this blender instance was built with"}, + {(char *)"build_platform", (char *)"The platform this blender instance was built for"}, + {(char *)"build_type", (char *)"The type of build (Release, Debug)"}, + {(char *)"build_cflags", (char *)""}, + {(char *)"build_cxxflags", (char *)""}, + {(char *)"build_linkflags", (char *)""}, + {(char *)"build_system", (char *)""}, {0} }; static PyStructSequence_Desc app_info_desc = { - "bpy.app", /* name */ - "This module contains application values that remain unchanged during runtime.", /* doc */ + (char *)"bpy.app", /* name */ + (char *)"This module contains application values that remain unchanged during runtime.", /* doc */ app_info_fields, /* fields */ (sizeof(app_info_fields)/sizeof(PyStructSequence_Field)) - 1 }; @@ -173,9 +173,9 @@ static PyObject *bpy_app_driver_dict_get(PyObject *UNUSED(self), void *UNUSED(cl PyGetSetDef bpy_app_getsets[]= { - {"debug", bpy_app_debug_get, bpy_app_debug_set, "Boolean, set when blender is running in debug mode (started with -d)", NULL}, - {"tempdir", bpy_app_tempdir_get, NULL, "String, the temp directory used by blender (read-only)", NULL}, - {"driver_namespace", bpy_app_driver_dict_get, NULL, "Dictionary for drivers namespace, editable in-place, reset on file load (read-only)", NULL}, + {(char *)"debug", bpy_app_debug_get, bpy_app_debug_set, (char *)"Boolean, set when blender is running in debug mode (started with -d)", NULL}, + {(char *)"tempdir", bpy_app_tempdir_get, NULL, (char *)"String, the temp directory used by blender (read-only)", NULL}, + {(char *)"driver_namespace", bpy_app_driver_dict_get, NULL, (char *)"Dictionary for drivers namespace, editable in-place, reset on file load (read-only)", NULL}, {NULL, NULL, NULL, NULL, NULL} }; diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 6de341311be..e055a8b0bc8 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -63,7 +63,7 @@ int bpy_pydriver_create_dict(void) } /* add bpy to global namespace */ - mod= PyImport_ImportModuleLevel("bpy", NULL, NULL, NULL, 0); + mod= PyImport_ImportModuleLevel((char *)"bpy", NULL, NULL, NULL, 0); if (mod) { PyDict_SetItemString(bpy_pydriver_Dict, "bpy", mod); Py_DECREF(mod); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 3478edb3809..3a049e89031 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -205,12 +205,12 @@ extern PyObject *BPyInit_blf(void); extern PyObject *AUD_initPython(void); static struct _inittab bpy_internal_modules[]= { - {"noise", BPyInit_noise}, - {"mathutils", BPyInit_mathutils}, -// {"mathutils.geometry", BPyInit_mathutils_geometry}, - {"bgl", BPyInit_bgl}, - {"blf", BPyInit_blf}, - {"aud", AUD_initPython}, + {(char *)"noise", BPyInit_noise}, + {(char *)"mathutils", BPyInit_mathutils}, +// {(char *)"mathutils.geometry", BPyInit_mathutils_geometry}, + {(char *)"bgl", BPyInit_bgl}, + {(char *)"blf", BPyInit_blf}, + {(char *)"aud", AUD_initPython}, {NULL, NULL} }; diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 6cf5e8e40c3..b7192f7395b 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -183,8 +183,8 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) BPY_PROPDEF_HEAD(BoolProperty) if(srna) { - static char *kwlist[] = {"attr", "name", "description", "default", "options", "subtype", NULL}; - char *id=NULL, *name="", *description=""; + static const char *kwlist[] = {"attr", "name", "description", "default", "options", "subtype", NULL}; + const char *id=NULL, *name="", *description=""; int id_len; int def=0; PropertyRNA *prop; @@ -229,7 +229,7 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject if(srna) { static const char *kwlist[] = {"attr", "name", "description", "default", "options", "subtype", "size", NULL}; - char *id=NULL, *name="", *description=""; + const char *id=NULL, *name="", *description=""; int id_len; int def[PYRNA_STACK_ARRAY]={0}; int size=3; @@ -286,7 +286,7 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) if(srna) { static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", NULL}; - char *id=NULL, *name="", *description=""; + const char *id=NULL, *name="", *description=""; int id_len; int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def=0; PropertyRNA *prop; @@ -332,7 +332,7 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject if(srna) { static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "options", "subtype", "size", NULL}; - char *id=NULL, *name="", *description=""; + const char *id=NULL, *name="", *description=""; int id_len; int min=INT_MIN, max=INT_MAX, soft_min=INT_MIN, soft_max=INT_MAX, step=1, def[PYRNA_STACK_ARRAY]={0}; int size=3; @@ -392,7 +392,7 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) if(srna) { static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "unit", NULL}; - char *id=NULL, *name="", *description=""; + const char *id=NULL, *name="", *description=""; int id_len; float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def=0.0f; int precision= 2; @@ -446,7 +446,7 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec if(srna) { static const char *kwlist[] = {"attr", "name", "description", "default", "min", "max", "soft_min", "soft_max", "step", "precision", "options", "subtype", "size", NULL}; - char *id=NULL, *name="", *description=""; + const char *id=NULL, *name="", *description=""; int id_len; float min=-FLT_MAX, max=FLT_MAX, soft_min=-FLT_MAX, soft_max=FLT_MAX, step=3, def[PYRNA_STACK_ARRAY]={0.0f}; int precision= 2, size=3; @@ -503,7 +503,7 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw if(srna) { static const char *kwlist[] = {"attr", "name", "description", "default", "maxlen", "options", "subtype", NULL}; - char *id=NULL, *name="", *description="", *def=""; + const char *id=NULL, *name="", *description="", *def=""; int id_len; int maxlen=0; PropertyRNA *prop; @@ -594,7 +594,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) if(srna) { static const char *kwlist[] = {"attr", "items", "name", "description", "default", "options", NULL}; - char *id=NULL, *name="", *description="", *def=""; + const char *id=NULL, *name="", *description="", *def=""; int id_len; int defvalue=0; PyObject *items= Py_None; @@ -662,7 +662,7 @@ static PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *k if(srna) { static const char *kwlist[] = {"attr", "type", "name", "description", "options", NULL}; - char *id=NULL, *name="", *description=""; + const char *id=NULL, *name="", *description=""; int id_len; PropertyRNA *prop; StructRNA *ptype; @@ -706,7 +706,7 @@ static PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject if(srna) { static const char *kwlist[] = {"attr", "type", "name", "description", "options", NULL}; - char *id=NULL, *name="", *description=""; + const char *id=NULL, *name="", *description=""; int id_len; PropertyRNA *prop; StructRNA *ptype; diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 20b8599a651..4265adde7f3 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -595,10 +595,10 @@ static void pyrna_struct_dealloc( BPy_StructRNA *self ) return; } -static char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop) +static const char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop) { EnumPropertyItem *item; - char *result; + const char *result; int free= FALSE; RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free); @@ -621,15 +621,15 @@ static int pyrna_string_to_enum(PyObject *item, PointerRNA *ptr, PropertyRNA *pr char *param= _PyUnicode_AsString(item); if (param==NULL) { - char *enum_str= pyrna_enum_as_string(ptr, prop); + const char *enum_str= pyrna_enum_as_string(ptr, prop); PyErr_Format(PyExc_TypeError, "%.200s expected a string enum type in (%.200s)", error_prefix, enum_str); - MEM_freeN(enum_str); + MEM_freeN((void *)enum_str); return 0; } else { if (!RNA_property_enum_value(BPy_GetContext(), ptr, prop, param, val)) { - char *enum_str= pyrna_enum_as_string(ptr, prop); + const char *enum_str= pyrna_enum_as_string(ptr, prop); PyErr_Format(PyExc_TypeError, "%.200s enum \"%.200s\" not found in (%.200s)", error_prefix, param, enum_str); - MEM_freeN(enum_str); + MEM_freeN((void *)enum_str); return 0; } } @@ -1065,9 +1065,9 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb } } else { - char *enum_str= pyrna_enum_as_string(ptr, prop); + const char *enum_str= pyrna_enum_as_string(ptr, prop); PyErr_Format(PyExc_TypeError, "%.200s %.200s.%.200s expected a string enum or a set of strings in (%.2000s)", error_prefix, RNA_struct_identifier(ptr->type), RNA_property_identifier(prop), enum_str); - MEM_freeN(enum_str); + MEM_freeN((void *)enum_str); return -1; } @@ -2077,7 +2077,7 @@ static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefi static int pyrna_struct_keyframe_parse(PointerRNA *ptr, PyObject *args, PyObject *kw, const char *parse_str, const char *error_prefix, char **path_full, int *index, float *cfra, char **group_name) /* return values */ { - static char *kwlist[] = {"data_path", "index", "frame", "group", NULL}; + static const char *kwlist[] = {"data_path", "index", "frame", "group", NULL}; char *path; /* note, parse_str MUST start with 's|ifs' */ @@ -2925,13 +2925,13 @@ static PyObject *pyrna_struct_get_id_data(BPy_DummyPointerRNA *self) /*****************************************************************************/ static PyGetSetDef pyrna_prop_getseters[] = { - {"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, "The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; static PyGetSetDef pyrna_struct_getseters[] = { - {"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, "The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, + {(char *)"id_data", (getter)pyrna_struct_get_id_data, (setter)NULL, (char *)"The :class:`ID` object this datablock is from or None, (not available for all data types)", NULL}, {NULL,NULL,NULL,NULL,NULL} /* Sentinel */ }; @@ -4367,7 +4367,7 @@ static PyObject* pyrna_srna_ExternalType(StructRNA *srna) PyObject *newclass; if(bpy_types_dict==NULL) { - PyObject *bpy_types= PyImport_ImportModuleLevel("bpy_types", NULL, NULL, NULL, 0); + PyObject *bpy_types= PyImport_ImportModuleLevel((char *)"bpy_types", NULL, NULL, NULL, 0); if(bpy_types==NULL) { PyErr_Print(); @@ -4452,7 +4452,7 @@ static PyObject* pyrna_srna_Subtype(StructRNA *srna) } /* always use O not N when calling, N causes refcount errors */ - newclass = PyObject_CallFunction(metaclass, "s(O){sss()}", idname, py_base, "__module__","bpy.types", "__slots__"); + newclass = PyObject_CallFunction(metaclass, (char *)"s(O){sss()}", idname, py_base, "__module__","bpy.types", "__slots__"); /* newclass will now have 2 ref's, ???, probably 1 is internal since decrefing here segfaults */ diff --git a/source/blender/python/intern/bpy_util.c b/source/blender/python/intern/bpy_util.c index c5d77f85788..1ce3be0a82d 100644 --- a/source/blender/python/intern/bpy_util.c +++ b/source/blender/python/intern/bpy_util.c @@ -201,7 +201,7 @@ int BPy_errors_to_report(ReportList *reports) } /* array utility function */ -int PyC_AsArray(void *array, PyObject *value, int length, PyTypeObject *type, char *error_prefix) +int PyC_AsArray(void *array, PyObject *value, int length, PyTypeObject *type, const char *error_prefix) { PyObject *value_fast; int value_len; |