From f44b54d2a7866033025bd4e99992a72e3a27c428 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 5 Mar 2013 03:17:46 +0000 Subject: patch [#34103] from Lawrence D'Oliveiro (ldo) More use of bool type, necessitating adding inclusion of BLI_utildefines.h, or moving it up in the inclusion order if it was already included, in various places - storage.c: make some variables only used in bli_builddir local to that - storage.c: BLI_file_descriptor_size should allow 0 as a valid file descriptor - path_util.c: make pointers to non-reentrant storage returned from folder routines const, necessitating making variables holding these returned pointers const elsewhere as well - path_util.c: BLI_string_to_utf8 closes iconv context in case of conversion error - blf_lang.c: fill_locales routine now has its own "languages" local variable to construct paths (was stealing internal storage belonging to BLI_get_folder before) --- source/blender/python/intern/bpy.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/python/intern/bpy.c') diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 71f85af8255..be04ee7de9a 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -74,7 +74,7 @@ static PyObject *bpy_script_paths(PyObject *UNUSED(self)) { PyObject *ret = PyTuple_New(2); PyObject *item; - char *path; + const char *path; path = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, NULL); item = PyUnicode_DecodeFSDefault(path ? path : ""); @@ -147,7 +147,7 @@ static PyObject *bpy_user_resource(PyObject *UNUSED(self), PyObject *args, PyObj int folder_id; static const char *kwlist[] = {"type", "subdir", NULL}; - char *path; + const char *path; if (!PyArg_ParseTupleAndKeywords(args, kw, "s|s:user_resource", (char **)kwlist, &type, &subdir)) return NULL; @@ -191,7 +191,7 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj int major = BLENDER_VERSION / 100, minor = BLENDER_VERSION % 100; static const char *kwlist[] = {"type", "major", "minor", NULL}; int folder_id; - char *path; + const char *path; if (!PyArg_ParseTupleAndKeywords(args, kw, "s|ii:resource_path", (char **)kwlist, &type, &major, &minor)) return NULL; @@ -245,7 +245,7 @@ void BPy_init_modules(void) PyObject *mod; /* Needs to be first since this dir is needed for future modules */ - char *modpath = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "modules"); + const char * const modpath = BLI_get_folder(BLENDER_SYSTEM_SCRIPTS, "modules"); if (modpath) { // printf("bpy: found module path '%s'.\n", modpath); PyObject *sys_path = PySys_GetObject("path"); /* borrow */ -- cgit v1.2.3