Commit Graph

58 Commits

Author SHA1 Message Date
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
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
0107385f7f code cleanup: ensure macros require ';' endings 2012-08-08 21:20:10 +00:00
9e09005e49 add is_quad_convex_v2(), SET_UINT_IN_POINTER, GET_UINT_FROM_POINTER macros & some minor edits. 2012-07-14 00:33:58 +00:00
47826118d1 style cleanup: also fix for TIMEIT macro 2012-05-28 18:12:08 +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
343edf2722 style cleanup: function calls & whitespace. 2012-04-29 17:11:40 +00:00
711d7539e0 style cleanup: for creator.c & more useful assert message (file:line) 2012-03-28 05:09:50 +00:00
b6c2f9ddab style cleanup: enforce macros using a semicolon. 2012-03-22 01:35:13 +00:00
9dd0c4c232 rename define BM_INLINE -> BLI_INLINE to avoid confusion with bmesh defines. 2012-03-20 08:42:26 +00:00
89a963fb7f style cleanup: comment blocks 2012-03-09 18:28:30 +00:00
dfdfa3d51b code cleanup: replace macros VECCOPY, VECADD, VECSUB, INPR - with BLI_math funcs.
added copy float/double funcs: copy_v3fl_v3db(), copy_v3db_v3fl(). 2d & 4d too.
2012-03-09 06:04:17 +00:00
6bc7c30b93 fix for build error with non debug builds from last commit. 2012-02-26 17:24:04 +00:00
61596d5bb3 patch [#30227] Various MSVC (32-bit) Warning and Typo Fixes
made some small edits
- removed changes to AVI reading since the data types are apart of the format spec.
- absf -> abs for a double value in render code.
2012-02-17 19:21:47 +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
545dc90a7f Fix regressions in the color management / dither patch. 2012-01-10 14:24:18 +00:00
4487103e61 Color:
* Accelerated sRGB <=> linear conversion using lookup table, this can speed up
  loading of images in the compositor and simple renders quite a bit.
* Dithering now uses the Floyd-Steinberg algorithm. Previously it would simply
  randomize each pixel slightly, adding noise, now that should be reduced.

Patch #29309 by David M.
2012-01-08 13:55:53 +00:00
85a97f64a7 add UNLIKELY / LIKELY util defines to help optimize iterators that are called a lot, only defined for gcc at the moment.
also some cmake formatting edits.
2011-12-29 01:46:58 +00:00
d0aa012b0a change BLI_assert() so it can be included in other defines. 2011-12-19 03:06:44 +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
19f79f73a8 BLI_utildefine minor edits
- removed AVG2, was only used once.
- remove unused LONGCOPY define.
- removed BLI_STRUCT_OFFSET, was only used once, replce with offsetof
- formatting edits, split some macros over multiple lines.
2011-10-22 03:39:13 +00:00
4512f10db9 misc edits
- rename define DISABLE_SDL --> WITH_SDL (which was already used in some places)
- blenders interation preset was using orbit rather then turntable 3d view preference (different from factory defaults).
- tagged some unused rna args.
2011-10-20 00:19:21 +00:00
83a2f02a78 cleanup endian handling
- define __BIG_ENDIAN__ or __LITTLE_ENDIAN__ with cmake & scons.
- ENDIAN_ORDER is now a define rather than a global short.
- replace checks like this with single ifdef: #if defined(__sgi) || defined (__sparc) || defined (__sparc__) || defined (__PPC__) || defined (__ppc__) || defined (__hppa__) || defined (__BIG_ENDIAN__)
- remove BKE_endian.h which isn't used
2011-09-19 08:02:17 +00:00
a59ba9a519 - turn RNA_warning into a macro which includes the function name (was being written in manually but had incorrect func names in places).
- add __func__ define to BLI_utildefines.h for MSVC.
2011-09-09 01:29:53 +00:00
2311e624d7 eek F4TOCHAR4 was assigning alpha twice too!, tsk tsk. 2011-08-27 01:24:05 +00:00
7c02ca7e8c F3TOCHAR4 macro was assigning the same value twice (setting the alpha, then overwriting with 255). 2011-08-27 01:20:55 +00:00
ae884d2e54 Code cleanup: add UNUSED_FUNCTION macro to avoid warning messages about unused
functions.
2011-08-15 16:18:04 +00:00
b481524fde fix for float projection painting, now updating correctly.
This fix also allows for partial update of the image, speeding up painting. 
The different code path implemented will be used to upload high resolution images to OpenGL when onion branch is merged.
Due to conversion of float textures to/from sRGB, corrections made to brush color sampling to take account of the image profile. This is not 100% correct yet as texture images used for projection painting strokes are not converted to/from sRGB yet(This has been decided due to loss of precision for 8-bit formats). It will have to do for now, though.

last-minute update, exr image loading is broken, will fix asap
2011-06-06 22:10:05 +00:00
0298d223cc quiet various warnings, also disable -Wdouble-promotion with cmake since it gives warnings with variable length args. 2011-04-03 10:04:16 +00:00