[Bf-blender-cvs] [7a8d3e623de] hair_guides: Make sure MAX_LIBARRAY is large enough (also add a static assert for this).

Lukas Tönne noreply at git.blender.org
Sun Dec 10 11:12:51 CET 2017


Commit: 7a8d3e623deeaea8dceb802ef5f2d1e173166496
Author: Lukas Tönne
Date:   Sun Dec 10 09:57:44 2017 +0000
Branches: hair_guides
https://developer.blender.org/rB7a8d3e623deeaea8dceb802ef5f2d1e173166496

Make sure MAX_LIBARRAY is large enough (also add a static assert for this).

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

M	source/blender/blenkernel/BKE_library.h
M	source/blender/blenkernel/intern/library.c

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

diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h
index f320597ef2d..28a8d626f40 100644
--- a/source/blender/blenkernel/BKE_library.h
+++ b/source/blender/blenkernel/BKE_library.h
@@ -157,7 +157,7 @@ void id_clear_lib_data_ex(struct Main *bmain, struct ID *id, const bool id_in_ma
 
 struct ListBase *which_libbase(struct Main *mainlib, short type);
 
-#define MAX_LIBARRAY    37
+#define MAX_LIBARRAY    38
 int set_listbasepointers(struct Main *main, struct ListBase *lb[MAX_LIBARRAY]);
 
 /* Main API */
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 57dc067b8e2..beff1372027 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -990,6 +990,8 @@ void BKE_main_lib_objects_recalc_all(Main *bmain)
 	DEG_id_type_tag(bmain, ID_OB);
 }
 
+BLI_STATIC_ASSERT(MAX_LIBARRAY == INDEX_ID_NULL + 1, "MAX_LIBARRAY must be large enough for all ID types")
+
 /**
  * puts into array *lb pointers to all the ListBase structs in main,
  * and returns the number of them as the function result. This is useful for



More information about the Bf-blender-cvs mailing list