forked from bartvdbraak/blender
enable type limits warning when compiling with gcc.
This commit is contained in:
parent
4e1afbe7cd
commit
b7826c42df
@ -1977,6 +1977,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull) # C only
|
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_NULL -Wnonnull) # C only
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
|
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
|
||||||
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
|
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
|
||||||
|
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
|
||||||
|
|
||||||
# gcc 4.2 gives annoying warnings on every file with this
|
# gcc 4.2 gives annoying warnings on every file with this
|
||||||
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
|
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
|
||||||
@ -2003,6 +2004,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
|||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self) # needs -Wuninitialized
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_INIT_SELF -Winit-self) # needs -Wuninitialized
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
|
||||||
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
|
||||||
|
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
|
||||||
|
|
||||||
# gcc 4.2 gives annoying warnings on every file with this
|
# gcc 4.2 gives annoying warnings on every file with this
|
||||||
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
|
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
|
||||||
|
@ -48,6 +48,10 @@
|
|||||||
#include "BKE_global.h"
|
#include "BKE_global.h"
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
# pragma GCC diagnostic ignored "-Wtype-limits"
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef _OPENMP
|
#ifdef _OPENMP
|
||||||
# define CLOTH_OPENMP_LIMIT 512
|
# define CLOTH_OPENMP_LIMIT 512
|
||||||
#endif
|
#endif
|
||||||
|
@ -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,
|
/* 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 */
|
* we have to clamp the values or we overrun the buffer and crash */
|
||||||
CLAMP(xi_min, 0, layer->buckets_x - 1);
|
if (xi_min >= layer->buckets_x) xi_min = layer->buckets_x - 1;
|
||||||
CLAMP(xi_max, 0, layer->buckets_x - 1);
|
if (xi_max >= layer->buckets_x) xi_max = layer->buckets_x - 1;
|
||||||
CLAMP(yi_min, 0, layer->buckets_y - 1);
|
if (yi_min >= layer->buckets_y) yi_min = layer->buckets_y - 1;
|
||||||
CLAMP(yi_max, 0, layer->buckets_y - 1);
|
if (yi_max >= layer->buckets_y) yi_max = layer->buckets_y - 1;
|
||||||
|
|
||||||
for (yi = yi_min; yi <= yi_max; yi++) {
|
for (yi = yi_min; yi <= yi_max; yi++) {
|
||||||
unsigned int bucket_index = (layer->buckets_x * yi) + xi_min;
|
unsigned int bucket_index = (layer->buckets_x * yi) + xi_min;
|
||||||
|
@ -561,8 +561,6 @@ static int bmo_mesh_flag_count(BMesh *bm, const char htype, const short oflag,
|
|||||||
BMElemF *ele_f;
|
BMElemF *ele_f;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
BLI_assert((unsigned int)test_for_enabled <= 1);
|
|
||||||
|
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
if (htype & flag_types[i]) {
|
if (htype & flag_types[i]) {
|
||||||
BM_ITER_MESH (ele_f, &iter, bm, iter_types[i]) {
|
BM_ITER_MESH (ele_f, &iter, bm, iter_types[i]) {
|
||||||
@ -937,7 +935,6 @@ static void bmo_slot_buffer_from_flag(BMesh *bm, BMOperator *op,
|
|||||||
int totelement, i = 0;
|
int totelement, i = 0;
|
||||||
|
|
||||||
BLI_assert(op->slots_in == slot_args || op->slots_out == slot_args);
|
BLI_assert(op->slots_in == slot_args || op->slots_out == slot_args);
|
||||||
BLI_assert((unsigned int)test_for_enabled <= 1);
|
|
||||||
|
|
||||||
if (test_for_enabled)
|
if (test_for_enabled)
|
||||||
totelement = BMO_mesh_enabled_flag_count(bm, htype, oflag);
|
totelement = BMO_mesh_enabled_flag_count(bm, htype, oflag);
|
||||||
|
Loading…
Reference in New Issue
Block a user