[Bf-blender-cvs] [4cb051a] temp-startup_blend: tweaks for writing startup.blend

Campbell Barton noreply at git.blender.org
Thu Dec 4 11:04:31 CET 2014


Commit: 4cb051abc5e6622e53685f74b196de9ff56e9112
Author: Campbell Barton
Date:   Thu Dec 4 10:48:31 2014 +0100
Branches: temp-startup_blend
https://developer.blender.org/rB4cb051abc5e6622e53685f74b196de9ff56e9112

tweaks for writing startup.blend

- always calloc
- don't write id-properties

this is to make sure addon settings aren't written by accident, any new data starts out zero'd (no junk bytes)

===================================================================

M	intern/guardedalloc/intern/mallocn.c
M	source/blender/blenloader/intern/writefile.c

===================================================================

diff --git a/intern/guardedalloc/intern/mallocn.c b/intern/guardedalloc/intern/mallocn.c
index a379837..43e4f94 100644
--- a/intern/guardedalloc/intern/mallocn.c
+++ b/intern/guardedalloc/intern/mallocn.c
@@ -106,7 +106,7 @@ void MEM_use_guarded_allocator(void)
 	MEM_reallocN_id = MEM_guarded_reallocN_id;
 	MEM_recallocN_id = MEM_guarded_recallocN_id;
 	MEM_callocN = MEM_guarded_callocN;
-	MEM_mallocN = MEM_guarded_mallocN;
+	MEM_mallocN = MEM_guarded_callocN;
 	MEM_mallocN_aligned = MEM_guarded_mallocN_aligned;
 	MEM_mapallocN = MEM_guarded_mapallocN;
 	MEM_printmemlist_pydict = MEM_guarded_printmemlist_pydict;
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 3dc1fed..20ee008 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -28,6 +28,10 @@
  *  \ingroup blenloader
  */
 
+struct IDProperty;
+void _IDP_WriteProperty(struct IDProperty *prop, void *wd);
+#define IDP_WriteProperty(prop, wd) \
+	{ (void)_IDP_WriteProperty; (void)wd; prop = NULL; } (void)0
 
 /*
  * FILEFORMAT: IFF-style structure  (but not IFF compatible!)
@@ -516,7 +520,6 @@ static void writelist(WriteData *wd, int filecode, const char *structname, ListB
 /* *************** writing some direct data structs used in more code parts **************** */
 /*These functions are used by blender's .blend system for file saving/loading.*/
 void IDP_WriteProperty_OnlyData(IDProperty *prop, void *wd);
-void IDP_WriteProperty(IDProperty *prop, void *wd);
 
 static void IDP_WriteArray(IDProperty *prop, void *wd)
 {
@@ -582,7 +585,7 @@ void IDP_WriteProperty_OnlyData(IDProperty *prop, void *wd)
 	}
 }
 
-void IDP_WriteProperty(IDProperty *prop, void *wd)
+void _IDP_WriteProperty(IDProperty *prop, void *wd)
 {
 	writestruct(wd, DATA, "IDProperty", 1, prop);
 	IDP_WriteProperty_OnlyData(prop, wd);




More information about the Bf-blender-cvs mailing list