move strict compiler checks into a header so its easier to manage in one place (pragm...
authorCampbell Barton <ideasman42@gmail.com>
Sun, 1 Sep 2013 00:46:04 +0000 (00:46 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 1 Sep 2013 00:46:04 +0000 (00:46 +0000)
also enable more strict warnings for BLF (which had some incorrect casts).

15 files changed:
source/blender/blenfont/intern/blf_font.c
source/blender/blenfont/intern/blf_glyph.c
source/blender/blenfont/intern/blf_internal_types.h
source/blender/blenkernel/intern/mask_rasterize.c
source/blender/blenlib/BLI_strict_flags.h [new file with mode: 0644]
source/blender/blenlib/intern/BLI_ghash.c
source/blender/blenlib/intern/BLI_heap.c
source/blender/blenlib/intern/BLI_memarena.c
source/blender/blenlib/intern/BLI_mempool.c
source/blender/blenlib/intern/edgehash.c
source/blender/blenlib/intern/smallhash.c
source/blender/bmesh/intern/bmesh_inline.h
source/blender/bmesh/intern/bmesh_operator_api_inline.h
source/blender/bmesh/tools/bmesh_bisect_plane.c
source/blender/bmesh/tools/bmesh_edgenet.c

index 1e604bd810705b6ae8fbae50b5b0108441073ac9..c7f829a3a42462514ff1e49611fbdadb64492ff9 100644 (file)
@@ -50,6 +50,7 @@
 #include "BLI_string_utf8.h"
 #include "BLI_threads.h"
 #include "BLI_linklist.h"  /* linknode */
+#include "BLI_strict_flags.h"
 
 #include "BIF_gl.h"
 #include "BLF_api.h"
 #include "blf_internal_types.h"
 #include "blf_internal.h"
 
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#endif
-
 /* freetype2 handle ONLY for this file!. */
 static FT_Library ft_lib;
 static SpinLock ft_lib_mutex;
@@ -163,7 +160,7 @@ static void blf_font_ensure_ascii_table(FontBLF *font)
                                   _kern_mode,                                           \
                                   &(_delta)) == 0)                                      \
                {                                                                        \
-                       _pen_x += _delta.x >> 6;                                             \
+                       _pen_x += (int)_delta.x >> 6;                                        \
                }                                                                        \
        }                                                                            \
 } (void)0
@@ -194,7 +191,7 @@ void blf_font_draw(FontBLF *font, const char *str, size_t len)
                /* do not return this loop if clipped, we want every character tested */
                blf_glyph_render(font, g, (float)pen_x, (float)pen_y);
 
-               pen_x += g->advance;
+               pen_x += (int)g->advance;
                g_prev = g;
        }
 }
@@ -221,7 +218,7 @@ void blf_font_draw_ascii(FontBLF *font, const char *str, size_t len)
                /* do not return this loop if clipped, we want every character tested */
                blf_glyph_render(font, g, (float)pen_x, (float)pen_y);
 
-               pen_x += g->advance;
+               pen_x += (int)g->advance;
                g_prev = g;
        }
 }
@@ -273,10 +270,11 @@ void blf_font_buffer(FontBLF *font, const char *str)
        /* buffer specific vars */
        FontBufInfoBLF *buf_info = &font->buf_info;
        float b_col_float[4];
-       const unsigned char b_col_char[4] = {buf_info->col[0] * 255,
-                                            buf_info->col[1] * 255,
-                                            buf_info->col[2] * 255,
-                                            buf_info->col[3] * 255};
+       const unsigned char b_col_char[4] = {
+           (unsigned char)(buf_info->col[0] * 255),
+           (unsigned char)(buf_info->col[1] * 255),
+           (unsigned char)(buf_info->col[2] * 255),
+           (unsigned char)(buf_info->col[3] * 255)};
 
        unsigned char *cbuf;
        int chx, chy;
@@ -378,14 +376,15 @@ void blf_font_buffer(FontBLF *font, const char *str)
                                                                cbuf[0] = b_col_char[0];
                                                                cbuf[1] = b_col_char[1];
                                                                cbuf[2] = b_col_char[2];
-                                                               cbuf[3] = (alphatest = ((int)cbuf[3] + (int)b_col_char[3])) < 255 ? alphatest : 255;
+                                                               cbuf[3] = (alphatest = ((int)cbuf[3] + (int)b_col_char[3])) < 255 ?
+                                                                         (unsigned char)(alphatest) : 255;
                                                        }
                                                        else {
-                                                               cbuf[0] = (b_col_char[0] * a) + (cbuf[0] * (1.0f - a));
-                                                               cbuf[1] = (b_col_char[1] * a) + (cbuf[1] * (1.0f - a));
-                                                               cbuf[2] = (b_col_char[2] * a) + (cbuf[2] * (1.0f - a));
-                                                               cbuf[3] = (alphatest = ((int)cbuf[3] + (int)((b_col_float[3] * a) * 255.0f))) <
-                                                                         255 ? alphatest : 255;
+                                                               cbuf[0] = (unsigned char)((b_col_char[0] * a) + (cbuf[0] * (1.0f - a)));
+                                                               cbuf[1] = (unsigned char)((b_col_char[1] * a) + (cbuf[1] * (1.0f - a)));
+                                                               cbuf[2] = (unsigned char)((b_col_char[2] * a) + (cbuf[2] * (1.0f - a)));
+                                                               cbuf[3] = (alphatest = ((int)cbuf[3] + (int)((b_col_float[3] * a) * 255.0f))) < 255 ?
+                                                                         (unsigned char)(alphatest) : 255;
                                                        }
                                                }
                                        }
@@ -398,7 +397,7 @@ void blf_font_buffer(FontBLF *font, const char *str)
                        }
                }
 
-               pen_x += g->advance;
+               pen_x += (int)g->advance;
                g_prev = g;
        }
 }
@@ -433,10 +432,10 @@ void blf_font_boundbox(FontBLF *font, const char *str, rctf *box)
                if (has_kerning)
                        BLF_KERNING_STEP(font, kern_mode, g_prev, g, delta, pen_x);
 
-               gbox.xmin = pen_x;
-               gbox.xmax = pen_x + g->advance;
-               gbox.ymin = g->box.ymin + pen_y;
-               gbox.ymax = g->box.ymax + pen_y;
+               gbox.xmin = (float)pen_x;
+               gbox.xmax = (float)pen_x + g->advance;
+               gbox.ymin = g->box.ymin + (float)pen_y;
+               gbox.ymax = g->box.ymax + (float)pen_y;
 
                if (gbox.xmin < box->xmin) box->xmin = gbox.xmin;
                if (gbox.ymin < box->ymin) box->ymin = gbox.ymin;
@@ -444,7 +443,7 @@ void blf_font_boundbox(FontBLF *font, const char *str, rctf *box)
                if (gbox.xmax > box->xmax) box->xmax = gbox.xmax;
                if (gbox.ymax > box->ymax) box->ymax = gbox.ymax;
 
-               pen_x += g->advance;
+               pen_x += (int)g->advance;
                g_prev = g;
        }
 
index ae8e2d17c54051d84f6ef9ee50777e4bc1e991bc..2a8e91299b44736fb4822aa144055613f0d9e08d 100644 (file)
@@ -56,9 +56,7 @@
 #include "blf_internal_types.h"
 #include "blf_internal.h"
 
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#endif
+#include "BLI_strict_flags.h"
 
 GlyphCacheBLF *blf_glyph_cache_find(FontBLF *font, unsigned int size, unsigned int dpi)
 {
@@ -89,28 +87,28 @@ GlyphCacheBLF *blf_glyph_cache_new(FontBLF *font)
 
        gc->textures = (GLuint *)MEM_mallocN(sizeof(GLuint) * 256, __func__);
        gc->ntex = 256;
-       gc->cur_tex = -1;
+       gc->cur_tex = BLF_CURTEX_UNSET;
        gc->x_offs = 0;
        gc->y_offs = 0;
        gc->pad = 3;
 
-       gc->num_glyphs = font->face->num_glyphs;
-       gc->rem_glyphs = font->face->num_glyphs;
+       gc->num_glyphs = (int)font->face->num_glyphs;
+       gc->rem_glyphs = (int)font->face->num_glyphs;
        gc->ascender = ((float)font->face->size->metrics.ascender) / 64.0f;
        gc->descender = ((float)font->face->size->metrics.descender) / 64.0f;
 
        if (FT_IS_SCALABLE(font->face)) {
-               gc->max_glyph_width = (float)((font->face->bbox.xMax - font->face->bbox.xMin) *
-                                             (((float)font->face->size->metrics.x_ppem) /
-                                              ((float)font->face->units_per_EM)));
+               gc->max_glyph_width = (int)((float)(font->face->bbox.xMax - font->face->bbox.xMin) *
+                                           (((float)font->face->size->metrics.x_ppem) /
+                                            ((float)font->face->units_per_EM)));
 
-               gc->max_glyph_height = (float)((font->face->bbox.yMax - font->face->bbox.yMin) *
-                                              (((float)font->face->size->metrics.y_ppem) /
-                                               ((float)font->face->units_per_EM)));
+               gc->max_glyph_height = (int)((float)(font->face->bbox.yMax - font->face->bbox.yMin) *
+                                            (((float)font->face->size->metrics.y_ppem) /
+                                             ((float)font->face->units_per_EM)));
        }
        else {
-               gc->max_glyph_width = ((float)font->face->size->metrics.max_advance) / 64.0f;
-               gc->max_glyph_height = ((float)font->face->size->metrics.height) / 64.0f;
+               gc->max_glyph_width = (int)(((float)font->face->size->metrics.max_advance) / 64.0f);
+               gc->max_glyph_height = (int)(((float)font->face->size->metrics.height) / 64.0f);
        }
 
        gc->p2_width = 0;
@@ -148,8 +146,8 @@ void blf_glyph_cache_free(GlyphCacheBLF *gc)
                }
        }
 
-       if (gc->cur_tex > -1)
-               glDeleteTextures(gc->cur_tex + 1, gc->textures);
+       if (gc->cur_tex != BLF_CURTEX_UNSET)
+               glDeleteTextures((int)gc->cur_tex + 1, gc->textures);
        MEM_freeN((void *)gc->textures);
        MEM_freeN(gc);
 }
@@ -283,7 +281,7 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
                        /* Font buffer uses only 0 or 1 values, Blender expects full 0..255 range */
                        int i;
                        for (i = 0; i < (g->width * g->height); i++) {
-                               bitmap.buffer[i] = 255 * bitmap.buffer[i];
+                               bitmap.buffer[i] = bitmap.buffer[i] ? 255 : 0;
                        }
                }
 
@@ -292,8 +290,8 @@ GlyphBLF *blf_glyph_add(FontBLF *font, unsigned int index, unsigned int c)
        }
 
        g->advance = ((float)slot->advance.x) / 64.0f;
-       g->pos_x = slot->bitmap_left;
-       g->pos_y = slot->bitmap_top;
+       g->pos_x = (float)slot->bitmap_left;
+       g->pos_y = (float)slot->bitmap_top;
        g->pitch = slot->bitmap.pitch;
 
        FT_Outline_Get_CBox(&(slot->outline), &bbox);
@@ -347,7 +345,7 @@ static void blf_texture5_draw(const float shadow_col[4], float uv[2][2], float x
        
        const float *fp = soft;
        float color[4];
-       int dx, dy;
+       float dx, dy;
 
        color[0] = shadow_col[0];
        color[1] = shadow_col[1];
@@ -372,7 +370,7 @@ static void blf_texture3_draw(const float shadow_col[4], float uv[2][2], float x
 
        const float *fp = soft;
        float color[4];
-       int dx, dy;
+       float dx, dy;
 
        color[0] = shadow_col[0];
        color[1] = shadow_col[1];
@@ -391,10 +389,10 @@ static void blf_texture3_draw(const float shadow_col[4], float uv[2][2], float x
 
 static void blf_glyph_calc_rect(rctf *rect, GlyphBLF *g, float x, float y)
 {
-       rect->xmin = floor(x + g->pos_x);
-       rect->xmax = rect->xmin + g->width;
+       rect->xmin = (float)floor(x + g->pos_x);
+       rect->xmax = rect->xmin + (float)g->width;
        rect->ymin = y + g->pos_y;
-       rect->ymax = y + g->pos_y - g->height;
+       rect->ymax = y + g->pos_y - (float)g->height;
 }
 
 void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
@@ -410,7 +408,7 @@ void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
                if (font->max_tex_size == -1)
                        glGetIntegerv(GL_MAX_TEXTURE_SIZE, (GLint *)&font->max_tex_size);
 
-               if (gc->cur_tex == -1) {
+               if (gc->cur_tex == BLF_CURTEX_UNSET) {
                        blf_glyph_cache_texture(font, gc);
                        gc->x_offs = gc->pad;
                        gc->y_offs = 0;
@@ -458,7 +456,7 @@ void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
                g->uv[1][1] = ((float)(g->yoff + g->height)) / ((float)gc->p2_height);
 
                /* update the x offset for the next glyph. */
-               gc->x_offs += (int)(BLI_rctf_size_x(&g->box) + gc->pad);
+               gc->x_offs += (int)BLI_rctf_size_x(&g->box) + gc->pad;
 
                gc->rem_glyphs--;
                g->build_tex = 1;
@@ -482,7 +480,9 @@ void blf_glyph_render(FontBLF *font, GlyphBLF *g, float x, float y)
 
        if (font->flags & BLF_SHADOW) {
                rctf rect_ofs;
-               blf_glyph_calc_rect(&rect_ofs, g, x + font->shadow_x, y + font->shadow_y);
+               blf_glyph_calc_rect(&rect_ofs, g,
+                                   x + (float)font->shadow_x,
+                                   y + (float)font->shadow_y);
 
                switch (font->shadow) {
                        case 3:
index 096ff50a3ca67f5c83b5cf2ad7a2b4b0eb024f28..c64b7e974e78d1d3a60f721f4d3d3f37a481ceb7 100644 (file)
@@ -54,7 +54,7 @@ typedef struct GlyphCacheBLF {
        unsigned int ntex;
 
        /* and the last texture, aka. the current texture. */
-       int cur_tex;
+       unsigned int cur_tex;
 
        /* like bftgl, we draw every glyph in a big texture, so this is the
         * current position inside the texture.
@@ -235,4 +235,6 @@ typedef struct DirBLF {
        char *path;
 } DirBLF;
 
+#define BLF_CURTEX_UNSET ((unsigned int)-1)
+
 #endif /* __BLF_INTERNAL_TYPES_H__ */
index e5e49763784ca59a970a104b740e6bc1bf450e18..874e60936d1acaad4cf6fb4f50ef8053bee4a410 100644 (file)
 #include "BLI_rect.h"
 #include "BLI_listbase.h"
 #include "BLI_linklist.h"
+#include "BLI_strict_flags.h"
 
 #include "BKE_mask.h"
 
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
-
 /* this is rather and annoying hack, use define to isolate it.
  * problem is caused by scanfill removing edges on us. */
 #define USE_SCANFILL_EDGE_WORKAROUND
diff --git a/source/blender/blenlib/BLI_strict_flags.h b/source/blender/blenlib/BLI_strict_flags.h
new file mode 100644 (file)
index 0000000..0f41c95
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef __BLI_STRICT_FLAGS_H__
+#define __BLI_STRICT_FLAGS_H__
+
+/** \file BLI_strict_flags.h
+ * \ingroup bli
+ * \brief Strict compiler flags for areas of code we want
+ * to ensure don't do conversions without us knowing about it.
+ */
+
+#ifdef __GNUC__
+#  pragma GCC diagnostic error "-Wsign-conversion"
+#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
+#    pragma GCC diagnostic error "-Wsign-compare"
+#    pragma GCC diagnostic error "-Wconversion"
+#  endif
+#endif
+
+#endif  /* __BLI_STRICT_FLAGS_H__ */
index 58c4133fd613153929426160e43c4d5e98d08adb..750202c509d27852614b8e6610d883194119f44d 100644 (file)
 #include "BLI_utildefines.h"
 #include "BLI_mempool.h"
 #include "BLI_ghash.h"
+#include "BLI_strict_flags.h"
 
-/***/
-
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
 
 const unsigned int hashsizes[] = {
        5, 11, 17, 37, 67, 131, 257, 521, 1031, 2053, 4099, 8209, 
index 0aaa3e13b3fcb55888e3dae7a1c6dbe70aa07ec9..45bdeeedcf9fcd4c6f2c122b0d9f8149dbad76b6 100644 (file)
 #include "BLI_utildefines.h"
 #include "BLI_memarena.h"
 #include "BLI_heap.h"
-
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
+#include "BLI_strict_flags.h"
 
 /***/
 
index 7fe5607a24e9ddca01f2b830c69ea6cd18c1b074..747c2f0c2b7e3486b94f6bf0ee8f70aa0ec55f36 100644 (file)
 
 #include "BLI_memarena.h"
 #include "BLI_linklist.h"
-
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
+#include "BLI_strict_flags.h"
 
 struct MemArena {
        unsigned char *curbuf;
index a4cb335b7784cceda336894adbbab5748524dd0b..0aeb0896893a8aa02471b39670723f1363cc9e29 100644 (file)
  * Simple, fast memory allocator for allocating many elements of the same size.
  */
 
+#include <string.h>
+#include <stdlib.h>
+
 #include "BLI_utildefines.h"
 #include "BLI_listbase.h"
+#include "BLI_strict_flags.h"
 
 #include "BLI_mempool.h" /* own include */
 
 
 #include "MEM_guardedalloc.h"
 
-#include <string.h>
-#include <stdlib.h>
-
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
-
 /* note: copied from BLO_blend_defs.h, don't use here because we're in BLI */
 #ifdef __BIG_ENDIAN__
 /* Big Endian */
index 54ae0d385ef1f3c9bab120d3b45828f2582ee828..967b59cf25d771c27025e22ae0122ba2b002e865 100644 (file)
 #include "BLI_utildefines.h"
 #include "BLI_edgehash.h"
 #include "BLI_mempool.h"
-
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
+#include "BLI_strict_flags.h"
 
 /**************inlined code************/
 static const unsigned int _ehash_hashsizes[] = {
index 525bb37ae40d85b346ab4a8b646223d30287bbdd..7bb0747daaa955dfd8e59e65e211c4410a908389 100644 (file)
@@ -31,6 +31,7 @@
 #include "BLI_utildefines.h"
 
 #include "BLI_smallhash.h"
+#include "BLI_strict_flags.h"
 
 /* SMHASH_CELL_UNUSED means this cell is inside a key series,
  * while SMHASH_CELL_FREE means this cell terminates a key series.
 #define SMHASH_CELL_UNUSED  ((void *)0x7FFFFFFF)
 #define SMHASH_CELL_FREE    ((void *)0x7FFFFFFD)
 
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
-
 /* typically this re-assigns 'h' */
 #define SMHASH_NEXT(h, hoff)  ( \
        CHECK_TYPE_INLINE(&(h),    unsigned int *), \
index 102e9d47ffd41c3557f6d16c44bb281d1d3406b8..5ac6d7da61b87622c590e0cbba194caf3360829a 100644 (file)
@@ -56,7 +56,7 @@ BLI_INLINE void _bm_elem_flag_enable(BMHeader *head, const char hflag)
 
 BLI_INLINE void _bm_elem_flag_disable(BMHeader *head, const char hflag)
 {
-       head->hflag &= ~hflag;
+       head->hflag &= (char)~hflag;
 }
 
 BLI_INLINE void _bm_elem_flag_set(BMHeader *head, const char hflag, const int val)
index 3a9bf5974207761ffa91e8a7bf9abd277ff93ad6..91cd094bf2426b488f60bb7beae1d5961df06b63 100644 (file)
@@ -55,13 +55,13 @@ BLI_INLINE void _bmo_elem_flag_enable(BMesh *bm, BMFlagLayer *oflags, const shor
 
 BLI_INLINE void _bmo_elem_flag_disable(BMesh *bm, BMFlagLayer *oflags, const short oflag)
 {
-       oflags[bm->stackdepth - 1].f &= ~oflag;
+       oflags[bm->stackdepth - 1].f &= (short)~oflag;
 }
 
 BLI_INLINE void _bmo_elem_flag_set(BMesh *bm, BMFlagLayer *oflags, const short oflag, int val)
 {
        if (val) oflags[bm->stackdepth - 1].f |= oflag;
-       else     oflags[bm->stackdepth - 1].f &= ~oflag;
+       else     oflags[bm->stackdepth - 1].f &= (short)~oflag;
 }
 
 BLI_INLINE void _bmo_elem_flag_toggle(BMesh *bm, BMFlagLayer *oflags, const short oflag)
index 621b2162c2cc12929403656bdcd0d1e2bcb5ff2a..bfe710d9fddd101c7344da7538dfad1de8e9a577 100644 (file)
 #include "BLI_linklist.h"
 #include "BLI_linklist_stack.h"
 #include "BLI_math.h"
+#include "BLI_strict_flags.h"
 
 #include "bmesh.h"
 #include "bmesh_bisect_plane.h"  /* own include */
 
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
-
 
 /* -------------------------------------------------------------------- */
 /* Math utils */
index 066ccbb09486caac22e0274cee6c43f6a1120b5d..14d474fed61add97f5f13b2d4b619b4916ca8d45 100644 (file)
 #include "bmesh.h"
 #include "bmesh_edgenet.h"  /* own include */
 
-#ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wsign-conversion"
-#  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
-#    pragma GCC diagnostic error "-Wsign-compare"
-#    pragma GCC diagnostic error "-Wconversion"
-#  endif
-#endif
+#include "BLI_strict_flags.h"  /* keep last */
+
 
 /* Data for one end of an edge involved in a bevel */
 typedef struct VertNetInfo {