diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-09-01 04:46:04 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-09-01 04:46:04 +0400 |
commit | 2924a02a3561eed7899d5087f2a7a6c31529e18f (patch) | |
tree | f7e30878a3492cd0e91e2eaa5c8010ff6f0b930a | |
parent | ce326e20c85bc91471e681fa77f71be528302af3 (diff) |
move strict compiler checks into a header so its easier to manage in one place (pragmas were copied around).
also enable more strict warnings for BLF (which had some incorrect casts).
-rw-r--r-- | source/blender/blenfont/intern/blf_font.c | 45 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_glyph.c | 54 | ||||
-rw-r--r-- | source/blender/blenfont/intern/blf_internal_types.h | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/mask_rasterize.c | 9 | ||||
-rw-r--r-- | source/blender/blenlib/BLI_strict_flags.h | 38 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_ghash.c | 10 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_heap.c | 9 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_memarena.c | 9 | ||||
-rw-r--r-- | source/blender/blenlib/intern/BLI_mempool.c | 15 | ||||
-rw-r--r-- | source/blender/blenlib/intern/edgehash.c | 9 | ||||
-rw-r--r-- | source/blender/blenlib/intern/smallhash.c | 9 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_inline.h | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_operator_api_inline.h | 4 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_bisect_plane.c | 9 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_edgenet.c | 9 |
15 files changed, 106 insertions, 129 deletions
diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index 1e604bd8107..c7f829a3a42 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -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" @@ -59,10 +60,6 @@ #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; } diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index ae8e2d17c54..2a8e91299b4 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -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: diff --git a/source/blender/blenfont/intern/blf_internal_types.h b/source/blender/blenfont/intern/blf_internal_types.h index 096ff50a3ca..c64b7e974e7 100644 --- a/source/blender/blenfont/intern/blf_internal_types.h +++ b/source/blender/blenfont/intern/blf_internal_types.h @@ -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__ */ diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index e5e49763784..874e60936d1 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -82,17 +82,10 @@ #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 index 00000000000..0f41c95a035 --- /dev/null +++ b/source/blender/blenlib/BLI_strict_flags.h @@ -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__ */ diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c index 58c4133fd61..750202c509d 100644 --- a/source/blender/blenlib/intern/BLI_ghash.c +++ b/source/blender/blenlib/intern/BLI_ghash.c @@ -43,16 +43,8 @@ #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, diff --git a/source/blender/blenlib/intern/BLI_heap.c b/source/blender/blenlib/intern/BLI_heap.c index 0aaa3e13b3f..45bdeeedcf9 100644 --- a/source/blender/blenlib/intern/BLI_heap.c +++ b/source/blender/blenlib/intern/BLI_heap.c @@ -34,14 +34,7 @@ #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" /***/ diff --git a/source/blender/blenlib/intern/BLI_memarena.c b/source/blender/blenlib/intern/BLI_memarena.c index 7fe5607a24e..747c2f0c2b7 100644 --- a/source/blender/blenlib/intern/BLI_memarena.c +++ b/source/blender/blenlib/intern/BLI_memarena.c @@ -36,14 +36,7 @@ #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; diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index a4cb335b778..0aeb0896893 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -31,8 +31,12 @@ * 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 */ @@ -40,17 +44,6 @@ #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 */ diff --git a/source/blender/blenlib/intern/edgehash.c b/source/blender/blenlib/intern/edgehash.c index 54ae0d385ef..967b59cf25d 100644 --- a/source/blender/blenlib/intern/edgehash.c +++ b/source/blender/blenlib/intern/edgehash.c @@ -38,14 +38,7 @@ #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[] = { diff --git a/source/blender/blenlib/intern/smallhash.c b/source/blender/blenlib/intern/smallhash.c index 525bb37ae40..7bb0747daaa 100644 --- a/source/blender/blenlib/intern/smallhash.c +++ b/source/blender/blenlib/intern/smallhash.c @@ -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. @@ -43,14 +44,6 @@ #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 *), \ diff --git a/source/blender/bmesh/intern/bmesh_inline.h b/source/blender/bmesh/intern/bmesh_inline.h index 102e9d47ffd..5ac6d7da61b 100644 --- a/source/blender/bmesh/intern/bmesh_inline.h +++ b/source/blender/bmesh/intern/bmesh_inline.h @@ -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) diff --git a/source/blender/bmesh/intern/bmesh_operator_api_inline.h b/source/blender/bmesh/intern/bmesh_operator_api_inline.h index 3a9bf597420..91cd094bf24 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api_inline.h +++ b/source/blender/bmesh/intern/bmesh_operator_api_inline.h @@ -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) diff --git a/source/blender/bmesh/tools/bmesh_bisect_plane.c b/source/blender/bmesh/tools/bmesh_bisect_plane.c index 621b2162c2c..bfe710d9fdd 100644 --- a/source/blender/bmesh/tools/bmesh_bisect_plane.c +++ b/source/blender/bmesh/tools/bmesh_bisect_plane.c @@ -43,18 +43,11 @@ #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 */ diff --git a/source/blender/bmesh/tools/bmesh_edgenet.c b/source/blender/bmesh/tools/bmesh_edgenet.c index 066ccbb0948..14d474fed61 100644 --- a/source/blender/bmesh/tools/bmesh_edgenet.c +++ b/source/blender/bmesh/tools/bmesh_edgenet.c @@ -39,13 +39,8 @@ #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 { |