From ab5b95d14846b9bebe6c35f9ff40acf43c74fb20 Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Sat, 18 Sep 2010 19:38:27 +0000 Subject: [PATCH] * Update BGE for change in r32001 * Fix var declaration in bpy_interface.c * Remove forward declarations from py_capi_utils.h: they are unnecessary and break compiles (there were probably many warnings about this during compile with GCC). --- source/blender/python/generic/py_capi_utils.h | 3 --- source/blender/python/intern/bpy_interface.c | 16 +++++++++------- source/gameengine/Ketsji/KX_PythonInit.cpp | 5 +++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/source/blender/python/generic/py_capi_utils.h b/source/blender/python/generic/py_capi_utils.h index ced91fc9a6d..73769c91c76 100644 --- a/source/blender/python/generic/py_capi_utils.h +++ b/source/blender/python/generic/py_capi_utils.h @@ -25,9 +25,6 @@ #ifndef PY_CAPI_UTILS_H #define PY_CAPI_UTILS_H -struct PyObject; -struct PyTypeObject; - void PyC_ObSpit(char *name, PyObject *var); void PyC_LineSpit(void); PyObject * PyC_ExceptionBuffer(void); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 551431a304c..6aaac3cd0e8 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -339,15 +339,17 @@ int BPY_run_python_script( bContext *C, const char *fn, struct Text *text, struc * 'FILE structs for different C libraries can be different and * incompatible'. * So now we load the script file data to a buffer */ - char *pystring; + { + char *pystring; - fclose(fp); + fclose(fp); - pystring= MEM_mallocN(strlen(fn) + 32, "pystring"); - pystring[0]= '\0'; - sprintf(pystring, "exec(open(r'%s').read())", fn); - py_result = PyRun_String( pystring, Py_file_input, py_dict, py_dict ); - MEM_freeN(pystring); + pystring= MEM_mallocN(strlen(fn) + 32, "pystring"); + pystring[0]= '\0'; + sprintf(pystring, "exec(open(r'%s').read())", fn); + py_result = PyRun_String( pystring, Py_file_input, py_dict, py_dict ); + MEM_freeN(pystring); + } #else py_result = PyRun_File(fp, fn, Py_file_input, py_dict, py_dict); fclose(fp); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index 291ac83fd42..3a754f1f466 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -38,6 +38,7 @@ extern "C" { #include "bpy_internal_import.h" /* from the blender python api, but we want to import text too! */ + #include "py_capi_utils.h" #include "mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use. #include "geometry.h" // Blender.Geometry module copied here so the blenderlayer can use. #include "bgl.h" @@ -1920,7 +1921,7 @@ PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecur PyObjectPlus::ClearDeprecationWarning(); - return bpy_namespace_dict_new(NULL); + return PyC_DefaultNameSpace(NULL); } void exitGamePlayerPythonScripting() @@ -1956,7 +1957,7 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev PyObjectPlus::NullDeprecationWarning(); - return bpy_namespace_dict_new(NULL); + return PyC_DefaultNameSpace(NULL); } void exitGamePythonScripting()