Commit Graph

86 Commits

Author SHA1 Message Date
80de3192a7 attempt to quiet warnings for gcc4.2 2013-03-13 15:41:14 +00:00
660be3da39 use gcc warning -Wredundant-decls, exposes some odd/duplicate declarations which have been removed. 2013-03-11 20:27:38 +00:00
917252175d internal: increase error threshold for normalize assert since normals converted from shorts are not always exactly unit length. 2013-02-19 14:14:37 +00:00
f784856906 make asserts that check for unit length vectors into a macro.
this was really not nice logic to try to fit into an assert.
2013-02-19 13:15:34 +00:00
08bc601aa5 Fix warnings about undefined _POSIX_C_SOURCE with gcc 4.2 on Mac. 2013-01-25 13:51:49 +00:00
c411cde415 header cleanup, include BLI before BKE, also use bool for ntreeShaderExecTree 2013-01-24 21:57:13 +00:00
7539009d5b Do not redefine math functions for floats if compiler complies with C99 or POSIX.1-2001
This is useful for gcc which does not define sqrtf/powf/... functions with preprocessor and therefore always used sqrt/pow/...
Float functions are generally 20-50% faster than their equivalents for double type.
2013-01-24 20:54:12 +00:00
69b88cf719 Patch [#33196] Warning Fixes 11-16-2012
* MEM_CacheLimitier - Size type to int conversion, should be safe for now (doing my best Bill Gates 640k impression)
* OpenNL CMakeLists.txt - MSVC and GCC have slightly different ways to remove definitions (DEBUG) without the compiler complaining
* BLI_math inlines - The include guard name and inline option macro name should be different. Suppressed warning about not exporting any symbols from inline math library
* BLI string / utf8 - Fixed some inconsistencies between declarations and definitions
* nodes - node_composite_util is apparently not used unless you enable the legacy compositor, so it should not be compiled in that case.

Leaving out changes to BLI_fileops for now, need to do more testing.
2012-11-23 15:12:13 +00:00
f70d2c65d8 rename api functions...
- minf, maxf, mini, maxi --> min_ff, max_ff, min_ii, max_ii
2012-10-23 13:28:22 +00:00
25c96bc9f3 code cleanup: remove unused macros, commet some which may be useful later - or good to keep for completeness. quieted some warnings and add flags -Wmissing-include-dirs and -Wno-div-by-zero to cmake/gcc 2012-09-20 01:02:39 +00:00
a9f10b6bc2 style cleanup 2012-09-08 06:40:03 +00:00
a3c4b0f47d make SWAP macros typesafe using CHECK_TYPE macro.
Its unlikely you want to do short -> int, int -> float etc, conversion during swapping (if its needed we could have a non type checking macro).

Double that the optimized assembler outbut using SWAP() remains unchanged from before.

This exposed quite a few places where redundant type conversion was going on.

Also remove curve.c's swapdata() and replace its use with swap_v3_v3()
2012-08-25 20:16:08 +00:00
ceea98be2f math lib changes from tomato 2012-05-31 11:57:09 +00:00
2ab62ce126 code cleanup: defines with braces - end with '(void)0' so callers must end with ';' like normal function.
... without this some editors dont parse the source so well.
2012-05-27 12:21:13 +00:00
9892736206 code cleanup: header cleanup and remove some duplicate defines. 2012-05-12 20:39:39 +00:00
4f19c1a995 spelling cleanup 2012-03-18 07:38:51 +00:00
2b7ca2304a unify include guard defines, __$FILENAME__
without the underscores these clogged up the namespace for autocompleation which was annoying.
2012-02-17 18:59:41 +00:00
2253b63c97 static functions for getting power of 2 values were being copied about too much, add to the BLI_math api.
- is_power_of_2_i
- power_of_2_min_i
- power_of_2_max_i
2011-12-16 09:25:07 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
87c2842630 Patch #27842: build fix for solaris, missing finite(). Patch by A. Hettinger. 2011-07-05 19:04:38 +00:00
Nathan Letwory
71e80f606c Remove #ifdef __cplusplus, as it caused C2732 (differences in linkage). Compiles and runs fine without. 2011-02-18 14:50:49 +00:00
Nathan Letwory
d9bca3d491 declare round() and copysign() when on windows. Implementations for them already where in math_base.c 2011-02-18 14:22:46 +00:00
Nathan Letwory
b97ad119b9 doxygen: add blenlib under core as module. 2011-02-18 13:58:08 +00:00
86bbab7de5 remove/comment unused defines. 2011-01-15 16:14:57 +00:00
Nathan Letwory
6540bb1375 Add some missing const's 2010-10-22 10:17:55 +00:00
Nathan Letwory
380929624c Move MAXFLOAT to BLI_math_base.h 2010-10-14 09:31:14 +00:00
0d3f0ff08e Fix #23901: displace node not working with negative values. 2010-09-25 11:30:46 +00:00
30a7c6d281 Merge a few small blenlib changes from the render25 branch:
* define for missing hypotf on msvc.
* svd_m4 and pseudoinverse_m4_m4 functions.
* small tweak to perlin noise, use static function instead of macro.
* BLI_linklist_find and BLI_linklist_insert_after functions.
* MALWAYS_INLINE define to force inlining.
2010-06-22 15:20:06 +00:00
42a0ef4dcf OK, compiling doesn't mean it runs, now it should really be fixed, as I don't use NAN directly anymore. 2010-03-21 00:04:50 +00:00
b06cdb3dd7 Finally, this should really fix the msvc and old ubuntu compiler problems with NAN and finite. 2010-03-20 23:36:08 +00:00
d904da1d03 Yet another try to get NaN working on MSVC. 2010-03-20 20:00:15 +00:00
b6a111a6db Hopefully another fix for MSVC... 2010-03-20 19:51:38 +00:00
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
8ec59c7c68 Math Lib:
* inline some more functions, from math_base and math_vector
* also made some changes to the way inline is done so it can
  work for more than one file
* reflect_v3_v3v3 requires input vectors to be normalized now.
* added rgb_to_grayscale
* added zero_v4, copy_v4_v4, swap_v4_v4, is_one_v3
* added box_clip_bounds_m4 to clip a bounding box against a
  projection matrix
2010-01-22 11:10:24 +00:00
d98093a91a - added a new math function double_round, useful for rounding a number to a number of decimal places.
- added Mathutils vector method, vec.asTuple(round), since this is tedious in python and fairly common task.
2009-11-29 22:42:33 +00:00
60ea745613 Math Lib Reorganization
* New header and source files.
* Still need a few tweaks before switching code to use them.
2009-11-09 22:42:41 +00:00