[Bf-blender-cvs] [bb8a9a6f8b8] master: Fix BLI_array macro so can use BLI_strict_flags.h.

Howard Trickey noreply at git.blender.org
Fri Aug 30 17:42:10 CEST 2019


Commit: bb8a9a6f8b8978fa1bf6567b4f9cd49dc9cf8662
Author: Howard Trickey
Date:   Fri Aug 30 11:25:50 2019 -0400
Branches: master
https://developer.blender.org/rBbb8a9a6f8b8978fa1bf6567b4f9cd49dc9cf8662

Fix BLI_array macro so can use BLI_strict_flags.h.

Was doing int comparision against size_t, so added casts.

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

M	source/blender/blenlib/BLI_array.h

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

diff --git a/source/blender/blenlib/BLI_array.h b/source/blender/blenlib/BLI_array.h
index a61eff7329e..d687838a896 100644
--- a/source/blender/blenlib/BLI_array.h
+++ b/source/blender/blenlib/BLI_array.h
@@ -83,9 +83,9 @@ void _bli_array_grow_func(void **arr_p,
           ((void *)(_##arr##_static) != \
            NULL) && /* don't add _##arr##_len below because it must be zero */ \
           (_bli_array_totalsize_static(arr) >= \
-           _##arr##_len + (num))) ? /* we have an empty array and a static var big enough */ \
+           (size_t)(_##arr##_len + (num)))) ? /* we have an empty array and a static var big enough */ \
              (void)(arr = (void *)_##arr##_static) : /* use existing static array or allocate */ \
-             (LIKELY(_bli_array_totalsize(arr) >= _##arr##_len + (num)) ? \
+             (LIKELY(_bli_array_totalsize(arr) >= (size_t)(_##arr##_len + (num))) ? \
                   (void)0 /* do nothing */ : \
                   _bli_array_grow_func((void **)&(arr), \
                                        _##arr##_static, \



More information about the Bf-blender-cvs mailing list