dcb56d79a8
BLI: add new 'memory_utils' module with func checking a whole memory chunk is filled of zero,
...
and an helper to ensure all memory of a given structure passed a given member is filled of zero.
2015-10-20 14:44:15 +02:00
b098609186
Fix various compiler warnings.
2015-10-10 17:35:30 +02:00
07fa1b49d9
parenthisize macro args to avoid errors
2015-07-24 15:53:52 +10:00
7851534541
disable ARRAY_SIZE fixed length check for Clang
2015-04-29 01:37:45 +10:00
1f9fe0626f
BLI_utildefines: add MEMSET_STRUCT_OFS macro
2015-04-28 23:15:47 +10:00
56edaf7867
Fix stupid strict flags in math_color_inline.c
...
It was unleashed with recent ghash commit and issue seems to
be the same as fixed in 69065b5b .
2015-03-20 12:25:14 +05:00
0c4fb47edd
BLI_utildefines: correct comment
2015-02-23 16:17:16 +11:00
c26fa67bcd
BLI_utildefines: add pointer offset macro
...
Handy since it keeps the type of the original.
2015-02-23 13:50:12 +11:00
2967253ae4
Fix Windows build.
...
Mighty M$VC never heard of 'strcasecmp' family of functions, it prefers its
own names, as usual...
2015-02-18 12:22:58 +01:00
2af905391d
cleanup: doxy comments
2015-02-14 08:00:41 +11:00
e60259c1cd
Fix for previous commit - since it's for non-debug unused vars, name it UNUSED_VARS_NDEBUG.
...
This commit was proudly crafted by the Commit Rate Raising Committee!
2015-02-11 22:22:40 +01:00
e1bdf5333d
Add new UNUSED_VARS_DEBUG utils, which is NOP in debug build, but tags given vars as unused in non-debug builds.
...
Helps handling cleanly pure-debug variables.
2015-02-11 22:10:09 +01:00
b09563ca8c
Cleanup: fixes for building with recent clang
2015-01-14 05:11:20 +11:00
9fd569a654
PyAPI: add utilities PyTuple_SET_ITEMS, Py_INCREF_RET
...
Setting all values of a tuple is such a common operation that it deserves its own macro.
Also added Py_INCREF_RET to avoid confusing use of comma operator.
2015-01-06 19:09:11 +11:00
3e7e97f127
BMesh: ensure iterator macros assign to valid types
...
note, this is for C++ code which expects a cast, (will be added later)
also add a macro for nop-expressions (EXPR_NOP),
when we never want an expression to be evaluated, but it should still be valid.
2014-12-08 10:54:56 +01:00
08fd38cf52
BLI_utildefines: add UNUSED_VARS() macro
2014-11-24 12:03:25 +01:00
5efd2b7f36
correct another problem with BLI_assert
...
need to use extern C for C++
2014-11-18 10:56:31 +01:00
94f0d18470
BLI_assert: print a backtrace with the error
...
Add BLI_system_backtrace()
2014-11-18 00:20:56 +01:00
832a97f002
Macros: ELEM() can now take 2 args
...
Handy when used indirectly.
2014-11-16 14:29:17 +01:00
988b3d7188
Add utility macros to clamp all elements of 2,3,4 component vectors
2014-11-04 16:31:42 +05:00
a4258d40a1
BLI_utildefines: add SQUARE macro
...
also minor cleanup
2014-10-13 15:36:13 +02:00
21462410ee
Move typecheck macros into own header
2014-09-25 13:07:17 +10:00
bdd515fee2
Macro VA_NARGS, increase max to 64
2014-09-23 20:29:18 +10:00
6b6ea0485f
Macros: replace UNPACK#OP -> UNPACK#_EX, allow suffix
2014-08-05 08:06:19 +10:00
a90e49e40a
Tweaks to macros
2014-08-04 11:43:10 +10:00
a039f2bfc4
Macros: prevent instantiation of args for type checks
...
also make CHECK_TYPE_INLINE more strict
2014-08-04 11:18:33 +10:00
88a0d5ebe8
Make CHECK_TYPE_NONCONST macro portable
...
also replace __typeof -> typeof
2014-08-02 18:08:44 +10:00
7f32cf4605
Prevent macros hiding casts from const pointers
2014-08-01 22:03:03 +10:00
00b29156e0
Defines: replace ELEM3-16 with ELEM(...), that can take varargs
2014-07-20 01:33:40 +10:00
8ad607bbe0
Cleanup: Use more logically constructed ELEM macros
...
- name primary comparison var 'v'
- names remain same when expanded
- no odd mixing of macros, use prev ELEM + extra arg
- use 16, even if not used yet, saves adding more in future
2014-07-19 15:00:09 +10:00
c5ccbacdaa
move STACK_* macros into BLI_stackdefines.h
2014-06-25 00:01:33 +10:00
d19d1b5497
Add MEMCPY_STRUCT_OFS macro for copying values after a struct member
...
use for DM_to_mesh to avoid clobbering the ListBase
2014-06-24 23:50:12 +10:00
77616cbe11
add STACK_REMOVE macro
2014-06-24 22:14:22 +10:00
a82d3f85c6
Correct casts for IS_EQ and other macro tweaks
...
- ensure GET_INT_FROM_POINTER us only used to get values
- rename STACK_POP_ELSE -> STACK_POP_DEFAULT
2014-06-18 14:02:41 +10:00
ecb7905127
Resolve MSVC error
2014-06-14 04:46:37 +10:00
1962e21703
Code cleanup: remove redundant arg from ARRAY_LAST_ITEM
2014-06-14 00:47:11 +10:00
f8278e5479
Correct ARRAY_SIZE macro and make doxy comments consistent
2014-05-19 18:00:20 +10:00
2a49bf35f0
Add ARRAY_SIZE macro to check fixed size arrays
2014-05-18 23:51:59 +10:00
c88e65da61
Code cleanup: comment typos
2014-05-11 16:22:05 +10:00
95b93b5d46
Add BLI_compiler_compat.h to help with portability
2014-05-02 01:14:15 +10:00
2025e4cbb9
Code cleanup: quiet warnings & style
2014-04-13 11:26:31 +10:00
0319db1063
Correct own recent changes broke release builds
2014-03-30 20:35:59 +11:00
c16bd951cd
Enable GCC pedantic warnings with strict flags,
...
also modify MIN/MAX macros to prevent shadowing.
2014-03-30 15:04:20 +11:00
ac07046e55
BMesh: optimize quad_coord, avoid duplicate sqrt calls
2014-03-28 15:25:02 +11:00
3a99fa5d7f
Revert own changes to CLAMP and CLAMPIS, caused T38875
2014-02-28 11:47:02 +11:00
c005fb407b
Util-defines: avoid multiple calculation/access for MIN/MAX macros
2013-12-08 17:29:22 +11:00
f64b3732be
Util Macros: reduce multiple access & conversion for CLAMP/CLAMPIS/ABS
2013-12-07 14:29:27 +11:00
69065b5b2c
Compiler warnings: quiet warnings for gcc4.7x
...
patch from Sergey
2013-12-07 13:21:59 +11:00
5910531318
Math Library: add functions cross_poly_v2, cross_tri_v2
...
also added utility macro for removing elements in the middle of an array
2013-11-30 15:57:16 +11:00
918ad1719f
Transform: improve normal orientation
...
- when 3 verts are selected ensure the normal is flipped on the side of existing vert normals.
also use the most distant 2 verts to define the tangent.
- when 2 vertices are selected, the normal wasn't aligned with the vert normal.
2013-11-28 20:40:14 +11:00