[Bf-blender-cvs] [0319db1] master: Correct own recent changes broke release builds

Campbell Barton noreply at git.blender.org
Sun Mar 30 11:37:21 CEST 2014


Commit: 0319db10639217a17f77b9d1e16e8e28dca6022e
Author: Campbell Barton
Date:   Sun Mar 30 20:35:59 2014 +1100
https://developer.blender.org/rB0319db10639217a17f77b9d1e16e8e28dca6022e

Correct own recent changes broke release builds

===================================================================

M	source/blender/blenfont/intern/blf_font.c
M	source/blender/blenkernel/intern/mask_rasterize.c
M	source/blender/blenlib/BLI_rand.h
M	source/blender/blenlib/BLI_strict_flags.h
M	source/blender/blenlib/BLI_utildefines.h
M	source/blender/blenlib/intern/rand.c
M	source/blender/blenlib/intern/scanfill.c
M	source/blender/blenlib/intern/scanfill_utils.c
M	source/blender/blenlib/intern/timecode.c

===================================================================

diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c
index ac03502..324d20b 100644
--- a/source/blender/blenfont/intern/blf_font.c
+++ b/source/blender/blenfont/intern/blf_font.c
@@ -55,7 +55,6 @@
 #include "BLI_threads.h"
 #include "BLI_alloca.h"
 #include "BLI_linklist.h"  /* linknode */
-#include "BLI_strict_flags.h"
 
 #include "BIF_gl.h"
 #include "BLF_api.h"
@@ -65,6 +64,8 @@
 #include "blf_internal_types.h"
 #include "blf_internal.h"
 
+#include "BLI_strict_flags.h"
+
 /* freetype2 handle ONLY for this file!. */
 static FT_Library ft_lib;
 static SpinLock ft_lib_mutex;
diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c
index 6aec474..9f05284 100644
--- a/source/blender/blenkernel/intern/mask_rasterize.c
+++ b/source/blender/blenkernel/intern/mask_rasterize.c
@@ -82,10 +82,11 @@
 #include "BLI_rect.h"
 #include "BLI_listbase.h"
 #include "BLI_linklist.h"
-#include "BLI_strict_flags.h"
 
 #include "BKE_mask.h"
 
+#include "BLI_strict_flags.h"
+
 /* 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_rand.h b/source/blender/blenlib/BLI_rand.h
index 011b6ea..045cadb 100644
--- a/source/blender/blenlib/BLI_rand.h
+++ b/source/blender/blenlib/BLI_rand.h
@@ -51,7 +51,7 @@ unsigned int BLI_rng_get_uint(struct RNG *rng);
 double      BLI_rng_get_double(struct RNG *rng);
 float       BLI_rng_get_float(struct RNG *rng);
 void        BLI_rng_get_float_unit_v3(struct RNG *rng, float v[3]);
-void        BLI_rng_shuffle_array(struct RNG *rng, void *data, size_t elem_size, unsigned int elem_tot);
+void        BLI_rng_shuffle_array(struct RNG *rng, void *data, unsigned int elem_size_i, unsigned int elem_tot);
 
 /** Note that skipping is as slow as generating n numbers! */
 void        BLI_rng_skip(struct RNG *rng, int n);
@@ -73,7 +73,7 @@ float	BLI_hash_frand(unsigned int seed);
  * contents. This routine does not use nor modify
  * the state of the BLI random number generator.
  */
-void    BLI_array_randomize(void *data, size_t elem_size, unsigned int elem_tot, unsigned int seed);
+void    BLI_array_randomize(void *data, unsigned int elem_size, unsigned int elem_tot, unsigned int seed);
 
 
 /** Better seed for the random number generator, using noise.c hash[] */
diff --git a/source/blender/blenlib/BLI_strict_flags.h b/source/blender/blenlib/BLI_strict_flags.h
index 908d02e..1d595ff 100644
--- a/source/blender/blenlib/BLI_strict_flags.h
+++ b/source/blender/blenlib/BLI_strict_flags.h
@@ -28,7 +28,6 @@
  */
 
 #ifdef __GNUC__
-#  pragma GCC diagnostic error "-Wpedantic"
 #  pragma GCC diagnostic error "-Wsign-conversion"
 #  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 406  /* gcc4.6+ only */
 #    pragma GCC diagnostic error "-Wsign-compare"
@@ -37,8 +36,12 @@
 #  if (__GNUC__ * 100 + __GNUC_MINOR__) >= 408  /* gcc4.8+ only (behavior changed to ignore globals)*/
 #    pragma GCC diagnostic error "-Wshadow"
 #  endif
-#  ifdef __clang__  /* pedantic causes clang error */
-#    pragma GCC diagnostic ignored "-Wlanguage-extension-token"
+/* pedantic gives too many issues, developers can define this for own use */
+#  ifdef WARN_PEDANTIC
+#    pragma GCC diagnostic error "-Wpedantic"
+#    ifdef __clang__  /* pedantic causes clang error */
+#      pragma GCC diagnostic ignored "-Wlanguage-extension-token"
+#    endif
 #  endif
 #endif
 
diff --git a/source/blender/blenlib/BLI_utildefines.h b/source/blender/blenlib/BLI_utildefines.h
index 46553cc..ef6edda 100644
--- a/source/blender/blenlib/BLI_utildefines.h
+++ b/source/blender/blenlib/BLI_utildefines.h
@@ -458,7 +458,7 @@
 #if (!defined(__cplusplus)) && \
     (!defined(__COVERITY__)) && \
     (defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 406))  /* gcc4.6+ only */
-#  define BLI_STATIC_ASSERT(a, msg) _Static_assert(a, msg);
+#  define BLI_STATIC_ASSERT(a, msg) __extension__ _Static_assert(a, msg);
 #else
    /* TODO msvc, clang */
 #  define BLI_STATIC_ASSERT(a, msg)
diff --git a/source/blender/blenlib/intern/rand.c b/source/blender/blenlib/intern/rand.c
index 0afa4f8..f245fd3 100644
--- a/source/blender/blenlib/intern/rand.c
+++ b/source/blender/blenlib/intern/rand.c
@@ -141,9 +141,9 @@ void BLI_rng_get_float_unit_v3(RNG *rng, float v[3])
 	}
 }
 
-void BLI_rng_shuffle_array(RNG *rng, void *data, size_t elem_size, unsigned int elem_tot)
+void BLI_rng_shuffle_array(RNG *rng, void *data, unsigned int elem_size_i, unsigned int elem_tot)
 {
-	const unsigned int elem_size_i = (unsigned int)elem_size;
+	const size_t elem_size = (unsigned int)elem_size_i;
 	unsigned int i = elem_tot;
 	void *temp;
 
@@ -211,7 +211,7 @@ float BLI_hash_frand(unsigned int seed)
 	return BLI_rng_get_float(&rng);
 }
 
-void BLI_array_randomize(void *data, size_t elem_size, unsigned int elem_tot, unsigned int seed)
+void BLI_array_randomize(void *data, unsigned int elem_size, unsigned int elem_tot, unsigned int seed)
 {
 	RNG rng;
 
diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c
index 0610414..69049b5 100644
--- a/source/blender/blenlib/intern/scanfill.c
+++ b/source/blender/blenlib/intern/scanfill.c
@@ -42,10 +42,11 @@
 #include "BLI_math.h"
 #include "BLI_memarena.h"
 #include "BLI_utildefines.h"
-#include "BLI_strict_flags.h"
 
 #include "BLI_scanfill.h"  /* own include */
 
+#include "BLI_strict_flags.h"
+
 /* local types */
 typedef struct PolyFill {
 	unsigned int edges, verts;
diff --git a/source/blender/blenlib/intern/scanfill_utils.c b/source/blender/blenlib/intern/scanfill_utils.c
index 4bee163..1ece34a 100644
--- a/source/blender/blenlib/intern/scanfill_utils.c
+++ b/source/blender/blenlib/intern/scanfill_utils.c
@@ -35,11 +35,11 @@
 #include "BLI_listbase.h"
 #include "BLI_math.h"
 #include "BLI_utildefines.h"
-#include "BLI_strict_flags.h"
 #include "BLI_ghash.h"
 
 #include "BLI_scanfill.h"  /* own include */
 
+#include "BLI_strict_flags.h"
 
 typedef struct PolyInfo {
 	ScanFillEdge *edge_first, *edge_last;
diff --git a/source/blender/blenlib/intern/timecode.c b/source/blender/blenlib/intern/timecode.c
index cd70374..7b2ac9e 100644
--- a/source/blender/blenlib/intern/timecode.c
+++ b/source/blender/blenlib/intern/timecode.c
@@ -38,10 +38,9 @@
 
 #include "BLI_timecode.h"  /* own include */
 
-#include "BLI_strict_flags.h"
-
 #include "DNA_userdef_types.h"  /* for eTimecodeStyles only */
 
+#include "BLI_strict_flags.h"
 
 /**
  * Generate timecode/frame number string and store in \a str




More information about the Bf-blender-cvs mailing list