[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52063] trunk/blender: code cleanup: some warnings and formatting for PyMethodDef's in the BGE.

Campbell Barton ideasman42 at gmail.com
Sat Nov 10 06:42:58 CET 2012


Revision: 52063
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52063
Author:   campbellbarton
Date:     2012-11-10 05:42:50 +0000 (Sat, 10 Nov 2012)
Log Message:
-----------
code cleanup: some warnings and formatting for PyMethodDef's in the BGE.

Modified Paths:
--------------
    trunk/blender/intern/guardedalloc/cpp/mallocn.cpp
    trunk/blender/source/gameengine/Converter/BL_ArmatureChannel.cpp
    trunk/blender/source/gameengine/Converter/BL_ArmatureConstraint.cpp
    trunk/blender/source/gameengine/Converter/BL_ArmatureObject.cpp
    trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
    trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp
    trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
    trunk/blender/source/gameengine/Ketsji/KX_CharacterWrapper.h
    trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp
    trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
    trunk/blender/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
    trunk/blender/source/gameengine/Ketsji/KX_VertexProxy.cpp
    trunk/blender/source/gameengine/VideoTexture/ImageRender.cpp

Modified: trunk/blender/intern/guardedalloc/cpp/mallocn.cpp
===================================================================
--- trunk/blender/intern/guardedalloc/cpp/mallocn.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/intern/guardedalloc/cpp/mallocn.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -28,6 +28,9 @@
 #include <new>
 #include "../MEM_guardedalloc.h"
 
+void *operator new(size_t size, const char *str) throw(std::bad_alloc);
+void *operator new[](size_t size, const char *str) throw(std::bad_alloc);
+
 /* not default but can be used when needing to set a string */
 void *operator new(size_t size, const char *str) throw(std::bad_alloc)
 {

Modified: trunk/blender/source/gameengine/Converter/BL_ArmatureChannel.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ArmatureChannel.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Converter/BL_ArmatureChannel.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -95,7 +95,7 @@
 // PYTHON
 
 PyMethodDef BL_ArmatureChannel::Methods[] = {
-  {NULL,NULL} //Sentinel
+	{NULL,NULL} //Sentinel
 };
 
 // order of definition of attributes, must match Attributes[] array

Modified: trunk/blender/source/gameengine/Converter/BL_ArmatureConstraint.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ArmatureConstraint.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Converter/BL_ArmatureConstraint.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -246,7 +246,7 @@
 // PYTHON
 
 PyMethodDef BL_ArmatureConstraint::Methods[] = {
-  {NULL,NULL} //Sentinel
+	{NULL,NULL} //Sentinel
 };
 
 // order of definition of attributes, must match Attributes[] array

Modified: trunk/blender/source/gameengine/Converter/BL_ArmatureObject.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_ArmatureObject.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Converter/BL_ArmatureObject.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -639,7 +639,6 @@
 };
 
 PyMethodDef BL_ArmatureObject::Methods[] = {
-
 	KX_PYMETHODTABLE_NOARGS(BL_ArmatureObject, update),
 	{NULL,NULL} //Sentinel
 };

Modified: trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Converter/KX_BlenderSceneConverter.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -103,6 +103,7 @@
 #include "KX_MeshProxy.h"
 #include "RAS_MeshObject.h"
 extern "C" {
+	#include "PIL_time.h"
 	#include "BKE_context.h"
 	#include "BLO_readfile.h"
 	#include "BKE_idcode.h"
@@ -957,10 +958,12 @@
 bool KX_BlenderSceneConverter::LinkBlendFile(BlendHandle *bpy_openlib, const char *path, char *group, KX_Scene *scene_merge, char **err_str, short options)
 {
 	Main *main_newlib; /* stored as a dynamic 'main' until we free it */
-	int idcode= BKE_idcode_from_name(group);
+	const int idcode = BKE_idcode_from_name(group);
 	ReportList reports;
 	static char err_local[255];
-	
+
+//	TIMEIT_START(bge_link_blend_file);
+
 	/* only scene and mesh supported right now */
 	if (idcode!=ID_SCE && idcode!=ID_ME &&idcode!=ID_AC) {
 		snprintf(err_local, sizeof(err_local), "invalid ID type given \"%s\"\n", group);
@@ -1059,7 +1062,9 @@
 			}
 		}
 	}
-	
+
+//	TIMEIT_END(bge_link_blend_file);
+
 	return true;
 }
 

Modified: trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp
===================================================================
--- trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -259,7 +259,7 @@
  * PyObjectPlus Methods 	-- Every class, even the abstract one should have a Methods
 ------------------------------*/
 PyMethodDef PyObjectPlus::Methods[] = {
-  {NULL, NULL}		/* Sentinel */
+	{NULL, NULL}		/* Sentinel */
 };
 
 #define BGE_PY_ATTR_INVALID (&(PyObjectPlus::Attributes[0]))

Modified: trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -202,7 +202,7 @@
 };
 
 PyMethodDef SCA_ILogicBrick::Methods[] = {
-  {NULL,NULL} //Sentinel
+	{NULL,NULL} //Sentinel
 };
 
 PyAttributeDef SCA_ILogicBrick::Attributes[] = {

Modified: trunk/blender/source/gameengine/Ketsji/KX_CharacterWrapper.h
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_CharacterWrapper.h	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Ketsji/KX_CharacterWrapper.h	2012-11-10 05:42:50 UTC (rev 52063)
@@ -30,10 +30,6 @@
 
 private:
 	PHY_ICharacter*			 m_character;
-
-#ifdef WITH_CXX_GUARDEDALLOC
-	MEM_CXX_CLASS_ALLOC_FUNCS("GE:KX_CharacterWrapper")
-#endif
 };
 
-#endif //__KX_CHARACTERWRAPPER_H__
+#endif  /* __KX_CHARACTERWRAPPER_H__ */

Modified: trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -70,13 +70,13 @@
 };
 
 PyMethodDef KX_MeshProxy::Methods[] = {
-{"getMaterialName", (PyCFunction)KX_MeshProxy::sPyGetMaterialName,METH_VARARGS},
-{"getTextureName", (PyCFunction)KX_MeshProxy::sPyGetTextureName,METH_VARARGS},
-{"getVertexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetVertexArrayLength,METH_VARARGS},
-{"getVertex", (PyCFunction)KX_MeshProxy::sPyGetVertex,METH_VARARGS},
-{"getPolygon", (PyCFunction)KX_MeshProxy::sPyGetPolygon,METH_VARARGS},
-//{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS},
-  {NULL,NULL} //Sentinel
+	{"getMaterialName", (PyCFunction)KX_MeshProxy::sPyGetMaterialName,METH_VARARGS},
+	{"getTextureName", (PyCFunction)KX_MeshProxy::sPyGetTextureName,METH_VARARGS},
+	{"getVertexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetVertexArrayLength,METH_VARARGS},
+	{"getVertex", (PyCFunction)KX_MeshProxy::sPyGetVertex,METH_VARARGS},
+	{"getPolygon", (PyCFunction)KX_MeshProxy::sPyGetPolygon,METH_VARARGS},
+	//{"getIndexArrayLength", (PyCFunction)KX_MeshProxy::sPyGetIndexArrayLength,METH_VARARGS},
+	{NULL,NULL} //Sentinel
 };
 
 PyAttributeDef KX_MeshProxy::Attributes[] = {

Modified: trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -190,8 +190,8 @@
 };
 
 PyMethodDef KX_SCA_AddObjectActuator::Methods[] = {
-  {"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_NOARGS,"instantAddObject() : immediately add object without delay\n"},
-  {NULL,NULL} //Sentinel
+	{"instantAddObject", (PyCFunction) KX_SCA_AddObjectActuator::sPyInstantAddObject, METH_NOARGS, NULL},
+	{NULL,NULL} //Sentinel
 };
 
 PyAttributeDef KX_SCA_AddObjectActuator::Attributes[] = {

Modified: trunk/blender/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Ketsji/KX_SCA_EndObjectActuator.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -113,7 +113,7 @@
 };
 
 PyMethodDef KX_SCA_EndObjectActuator::Methods[] = {
-  {NULL,NULL} //Sentinel
+	{NULL,NULL} //Sentinel
 };
 
 PyAttributeDef KX_SCA_EndObjectActuator::Attributes[] = {

Modified: trunk/blender/source/gameengine/Ketsji/KX_VertexProxy.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_VertexProxy.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/Ketsji/KX_VertexProxy.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -61,19 +61,19 @@
 };
 
 PyMethodDef KX_VertexProxy::Methods[] = {
-{"getXYZ", (PyCFunction)KX_VertexProxy::sPyGetXYZ,METH_NOARGS},
-{"setXYZ", (PyCFunction)KX_VertexProxy::sPySetXYZ,METH_O},
-{"getUV", (PyCFunction)KX_VertexProxy::sPyGetUV,METH_NOARGS},
-{"setUV", (PyCFunction)KX_VertexProxy::sPySetUV,METH_O},
+	{"getXYZ", (PyCFunction)KX_VertexProxy::sPyGetXYZ,METH_NOARGS},
+	{"setXYZ", (PyCFunction)KX_VertexProxy::sPySetXYZ,METH_O},
+	{"getUV", (PyCFunction)KX_VertexProxy::sPyGetUV,METH_NOARGS},
+	{"setUV", (PyCFunction)KX_VertexProxy::sPySetUV,METH_O},
 
-{"getUV2", (PyCFunction)KX_VertexProxy::sPyGetUV2,METH_NOARGS},
-{"setUV2", (PyCFunction)KX_VertexProxy::sPySetUV2,METH_VARARGS},
+	{"getUV2", (PyCFunction)KX_VertexProxy::sPyGetUV2,METH_NOARGS},
+	{"setUV2", (PyCFunction)KX_VertexProxy::sPySetUV2,METH_VARARGS},
 
-{"getRGBA", (PyCFunction)KX_VertexProxy::sPyGetRGBA,METH_NOARGS},
-{"setRGBA", (PyCFunction)KX_VertexProxy::sPySetRGBA,METH_O},
-{"getNormal", (PyCFunction)KX_VertexProxy::sPyGetNormal,METH_NOARGS},
-{"setNormal", (PyCFunction)KX_VertexProxy::sPySetNormal,METH_O},
-  {NULL,NULL} //Sentinel
+	{"getRGBA", (PyCFunction)KX_VertexProxy::sPyGetRGBA,METH_NOARGS},
+	{"setRGBA", (PyCFunction)KX_VertexProxy::sPySetRGBA,METH_O},
+	{"getNormal", (PyCFunction)KX_VertexProxy::sPyGetNormal,METH_NOARGS},
+	{"setNormal", (PyCFunction)KX_VertexProxy::sPySetNormal,METH_O},
+	{NULL,NULL} //Sentinel
 };
 
 PyAttributeDef KX_VertexProxy::Attributes[] = {

Modified: trunk/blender/source/gameengine/VideoTexture/ImageRender.cpp
===================================================================
--- trunk/blender/source/gameengine/VideoTexture/ImageRender.cpp	2012-11-10 05:03:45 UTC (rev 52062)
+++ trunk/blender/source/gameengine/VideoTexture/ImageRender.cpp	2012-11-10 05:42:50 UTC (rev 52063)
@@ -375,7 +375,7 @@
 static PyGetSetDef imageRenderGetSets[] =
 { 

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list