Commit Graph

87 Commits

Author SHA1 Message Date
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
aaa99106fe make IS_EQ and IS_EQF typecheck args 2013-11-10 14:13:26 +00:00
35b61a7512 Move GCC attributes into a centraized defines
Instead of having ifdef __GNUC__ all over the headers
to use special compiler's hints use a special file where
all things like this are concentrated.

Makes code easier to follow and allows to manage special
attributes in more efficient way.

Thanks Campbell for review!
2013-09-01 15:01:15 +00:00
9d4bf6b37b change CHECK_TYPE_INLINE macro not to add the pointer in the macro. 2013-08-17 04:48:34 +00:00
ea95a78b0b skip BLI_STATIC_ASSERT for Coverity builds (caused parse error) 2013-08-03 13:08:51 +00:00
60acf217f8 fix for editmesh transform connected,
the distance checks could get into a feedback loop so that the result depended on the order of verts/edges.

now you can randomize vert/edge/faces and get exactly the same results.

also made some internal improvements,
- used fixed sized arrays (no need to realloc).
- use vertex tag flags rather then a visit-hash.
- remove 'tots' array that did nothing (not sure why it was added).
2013-06-17 16:55:05 +00:00
1fe21f29ec utility function for calculating smooth groups from sharp edges: BKE_mesh_calc_smoothgroups 2013-06-14 08:28:27 +00:00
b5cb9e8810 add BLI_sys_types.h 2013-05-28 19:42:19 +00:00
a70fa65592 optimize mirror merging, remove array reallocation, replace with fixed size arrays. 2013-05-27 20:11:12 +00:00
1014dbaea1 bmesh: replace BLI_array reallocs with alloca, also don't check all faces for connecting verts. 2013-05-25 23:34:25 +00:00
40535f5ef3 bmesh recalculate normals - remove BLI_array reallocation, the max size of the array is known.
replace with STACK_* macros (moved to BLI_utildefines.h).
2013-05-12 12:23:44 +00:00
7fac200080 remove unused define CLAMPTEST, move INPR to
collision_compute_barycentric(), only place its used.
2013-05-08 12:56:02 +00:00
3bbf11761a make rna layer access less cryptic by using ARRAY_HAS_ITEM(), modified this to use unsigned offset. 2013-05-01 22:39:34 +00:00
d119b5b197 remove negated string macros from BLI_utildefines.h, were unused and can just use !STREQ(...) 2013-04-23 16:27:45 +00:00
f9f7070336 add STREQ macro (commonly used macro like CLAMP, MAX2, STRINGIFY). Use for some areas of the python api, bmesh. 2013-03-10 06:18:03 +00:00
e93068ad78 ruler arc draw clamps to line length and simplify projection. 2013-03-07 16:12:36 +00:00
f44b54d2a7 patch [#34103]
from Lawrence D'Oliveiro (ldo)

More use of bool type, necessitating adding inclusion of BLI_utildefines.h, or moving it up in the inclusion order if it was already included, in various places
- storage.c: make some variables only used in bli_builddir local to that
- storage.c: BLI_file_descriptor_size should allow 0 as a valid file descriptor
- path_util.c: make pointers to non-reentrant storage returned from folder routines const, necessitating making variables holding these returned pointers const elsewhere as well
- path_util.c: BLI_string_to_utf8 closes iconv context in case of conversion error
-  blf_lang.c: fill_locales routine now has its own "languages" local variable to construct paths (was stealing internal storage belonging to BLI_get_folder before)
2013-03-05 03:17:46 +00:00
c6642b8ec8 enable triangulation with collada, disable BLI_STATIC_ASSERT for C++. 2013-03-03 01:24:09 +00:00
95b28a65f3 Cleanup: happily remove no-more-used PY_TRANSLATE RNA prop flag, and related code (just realized that flag value was wrong, probably own typo in a previous commit :/ ).
That "trick" was nice when introduced, but it became kind of a pita since we added translation contexts...
2013-02-08 15:16:57 +00:00
3a4c317b87 Fix UI translation partly missing in scons builds (reported by Leon Cheung and Gabriel Gazzán on ML, and lockal on IRC, thanks).
The problem is that, when HAVE__BOOL is not defined (as it is the case in scons currently), BLI_utildefines.h defines bool as a standard type. Was using signed char, which makes eg "bool foo = 1024" be false (overflow)! Especially nasty when using bitflags (think we have been lucky to not have worse bugs because of that)!

So changed fallback bool type to unsigned int.
2013-01-31 14:25:07 +00:00
92481161d6 BLI_assert uses printf so stdio.h should be included instead of relying on it to be included by other headers accidentally 2013-01-06 09:24:45 +00:00
6ea766be0e Intent to fix windows not compiling after r53480.
Looks like _Bool is also a type in std (at least with msvc), so the 'typdef bool _Bool;' generates a name collision... Now using _BLI_Bool as placeholder instead.
2013-01-01 18:18:45 +00:00
80ff313495 patch [#33331] Time To Start Moving To Stdbool
by Lawrence D'Oliveiro (ldo)

so BKE_utildefines.h allows use of C99's bool type and true/false.

currently scons wont try to use stdbool.h, and works as if its never found.
2013-01-01 12:47:58 +00:00
42dc0dc5ef Fix #33226: error loading .blend files with different endian on Mac. The cause
was wrong inline and pure attributes on the endian switch function.
2012-11-26 20:37:04 +00:00
e2fe7751d6 code cleanup: replace most DO_MINMAX2 -> minmax_v2v2_v2
also add UNPACK macros's. handy for printing vectors for eg.
2012-11-15 22:20:18 +00:00
9c2d72a27d comment testing typechecking code, was causing issues on gcc 4.4 for some reason. 2012-10-27 15:08:40 +00:00
9fc95bd7ee use min/max inline functions where MIN2/MAX2 were doing type conversion. 2012-10-27 11:18:54 +00:00
95ddd19d13 fix for build error in own commit with non gcc compilers. (and remove invalid comment) 2012-10-25 07:53:11 +00:00
9e6d27bbf0 add BLI_STATIC_ASSERT macro. 2012-10-25 04:44:46 +00:00
436bbdfd24 style cleanup: use more const's in BLI_heap & dpx/cineon style cleanup 2012-10-22 13:00:02 +00:00
a4b2783169 small optimization for BLI_heap(), give some speedup in decimeter.
- use unsigned ints only (where mixing signed/unsigned)
- turn heap_swap into an inline function, add SWAP_TVAL macro to swap values using a temp value as storage.
- added type checking SHIFT3/4 macros

also style cleanup for CTR_Map
2012-10-22 03:25:53 +00:00
cb634b9100 Google Summer of Code project: "Smoke Simulator Improvements & Fire".
Documentation & Test blend files:
------------------
http://wiki.blender.org/index.php/User:MiikaH/GSoC-2012-Smoke-Simulator-Improvements

Credits:
------------------
Miika Hamalainen (MiikaH): Student / Main programmer

Daniel Genrich (Genscher): Mentor / Programmer of merged patches from Smoke2 branch
Google: For Google Summer of Code 2012
2012-10-10 13:18:07 +00:00
97d4fb4161 code cleanup: make header defines more consistent, JOYSENSOR header guard had a typo too. 2012-10-09 13:36:42 +00:00
2e81400b77 minor edit to type checking macro to avoid clangs static checker tagging the var as possibly NULL. 2012-10-07 23:58:57 +00:00
1a9f930514 add type checking for more error prone macros. 2012-10-07 07:27:09 +00:00
a9f10b6bc2 style cleanup 2012-09-08 06:40:03 +00:00
d248f94cf8 add endian switch functions to replace macros SWITCH_INT/LONG/SHORT, with BLI_endian_switch_int32/int64/float/double... 2012-09-03 07:37:38 +00:00