diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:39:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-07-19 14:39:25 +0400 |
commit | b7826c42df5bc049b93b636b0ef81d5cca8397e4 (patch) | |
tree | 97a442fa7611b709d585aa0b0cdc6e43744adb87 /source/blender/blenkernel | |
parent | 4e1afbe7cd6b9fc26726f39b83a96d0cf60942f5 (diff) |
enable type limits warning when compiling with gcc.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/implicit.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mask_rasterize.c | 8 |
2 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/blenkernel/intern/implicit.c b/source/blender/blenkernel/intern/implicit.c index b9064fe8ba3..c8e18bc3dee 100644 --- a/source/blender/blenkernel/intern/implicit.c +++ b/source/blender/blenkernel/intern/implicit.c @@ -48,6 +48,10 @@ #include "BKE_global.h" +#ifdef __GNUC__ +# pragma GCC diagnostic ignored "-Wtype-limits" +#endif + #ifdef _OPENMP # define CLOTH_OPENMP_LIMIT 512 #endif diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index e68f87211eb..ac48eaa3185 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -496,10 +496,10 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size) /* this should _almost_ never happen but since it can in extreme cases, * we have to clamp the values or we overrun the buffer and crash */ - CLAMP(xi_min, 0, layer->buckets_x - 1); - CLAMP(xi_max, 0, layer->buckets_x - 1); - CLAMP(yi_min, 0, layer->buckets_y - 1); - CLAMP(yi_max, 0, layer->buckets_y - 1); + if (xi_min >= layer->buckets_x) xi_min = layer->buckets_x - 1; + if (xi_max >= layer->buckets_x) xi_max = layer->buckets_x - 1; + if (yi_min >= layer->buckets_y) yi_min = layer->buckets_y - 1; + if (yi_max >= layer->buckets_y) yi_max = layer->buckets_y - 1; for (yi = yi_min; yi <= yi_max; yi++) { unsigned int bucket_index = (layer->buckets_x * yi) + xi_min; |