[Bf-blender-cvs] [d989d8a] master: CMake: only quiet warnings for generated rna files

Campbell Barton noreply at git.blender.org
Sun Feb 8 05:09:00 CET 2015


Commit: d989d8a37456da5b79b6c3a3d8278888e5f06ad0
Author: Campbell Barton
Date:   Sun Feb 8 14:33:06 2015 +1100
Branches: master
https://developer.blender.org/rBd989d8a37456da5b79b6c3a3d8278888e5f06ad0

CMake: only quiet warnings for generated rna files

also minor warning cleanup

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

M	intern/smoke/intern/spectrum.cpp
M	source/blender/blenkernel/intern/bpath.c
M	source/blender/editors/sculpt_paint/paint_ops.c
M	source/blender/makesrna/intern/CMakeLists.txt
M	source/blender/makesrna/intern/rna_sound_api.c
M	source/blender/makesrna/intern/rna_vfont_api.c
M	source/blender/render/intern/source/bake_api.c

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

diff --git a/intern/smoke/intern/spectrum.cpp b/intern/smoke/intern/spectrum.cpp
index e1c2b4d..15e4d0c 100644
--- a/intern/smoke/intern/spectrum.cpp
+++ b/intern/smoke/intern/spectrum.cpp
@@ -363,7 +363,7 @@ static void spectrum_to_xyz(double (*spec_intens)(double wavelength),
     Calculate, by Planck's radiation law, the emittance of a black body
     of temperature bbTemp at the given wavelength (in metres).  */
 
-double bbTemp = 5000;                 /* Hidden temperature argument
+static double bbTemp = 5000;          /* Hidden temperature argument
                                          to BB_SPECTRUM. */
 static double bb_spectrum(double wavelength)
 {
diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c
index e6bfd5c..fc3c1a2 100644
--- a/source/blender/blenkernel/intern/bpath.c
+++ b/source/blender/blenkernel/intern/bpath.c
@@ -284,7 +284,7 @@ static bool findMissingFiles_visit_cb(void *userdata, char *path_dst, const char
 	filename_new[0] = '\0';
 
 	found = findFileRecursive(filename_new,
-	                          data->searchdir, BLI_path_basename((char *)path_src),
+	                          data->searchdir, BLI_path_basename(path_src),
 	                          &filesize, &recur_depth);
 
 	if (filesize == -1) { /* could not open dir */
@@ -296,7 +296,7 @@ static bool findMissingFiles_visit_cb(void *userdata, char *path_dst, const char
 	else if (found == false) {
 		BKE_reportf(data->reports, RPT_WARNING,
 		            "Could not find '%s' in '%s'",
-		            BLI_path_basename((char *)path_src), data->searchdir);
+		            BLI_path_basename(path_src), data->searchdir);
 		return false;
 	}
 	else {
diff --git a/source/blender/editors/sculpt_paint/paint_ops.c b/source/blender/editors/sculpt_paint/paint_ops.c
index 09c3047..fac1a05 100644
--- a/source/blender/editors/sculpt_paint/paint_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_ops.c
@@ -106,7 +106,7 @@ static int brush_scale_size_exec(bContext *C, wmOperator *op)
 			const int old_size = BKE_brush_size_get(scene, brush);
 			int size = (int)(scalar * old_size);
 
-			if (fabs(old_size - size) < U.pixelsize) {
+			if (abs(old_size - size) < U.pixelsize) {
 				if (scalar > 1) {
 					size += U.pixelsize;
 				}
diff --git a/source/blender/makesrna/intern/CMakeLists.txt b/source/blender/makesrna/intern/CMakeLists.txt
index 6df9e3c..ec82fca 100644
--- a/source/blender/makesrna/intern/CMakeLists.txt
+++ b/source/blender/makesrna/intern/CMakeLists.txt
@@ -28,8 +28,6 @@ if(CMAKE_COMPILER_IS_GNUCC)
 	set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror=implicit-function-declaration")
 endif()
 
-# message(STATUS "Configuring makesrna")
-
 # files rna_access.c rna_define.c makesrna.c intentionally excluded.
 set(DEFSRC
 	rna_ID.c
@@ -128,6 +126,21 @@ set(APISRC
 string(REGEX REPLACE "rna_([a-zA-Z0-9_-]*).c" "${CMAKE_CURRENT_BINARY_DIR}/rna_\\1_gen.c" GENSRC "${DEFSRC}")
 set_source_files_properties(${GENSRC} PROPERTIES GENERATED TRUE)
 
+# --------------------------
+# CFLAGS for Generated Files
+#
+# less strict flags for generated source
+set(GENSRC_CFLAGS)
+if(CMAKE_COMPILER_IS_GNUCC OR (CMAKE_C_COMPILER_ID MATCHES "Clang"))
+	set(GENSRC_CFLAGS "-Wno-missing-prototypes")
+endif()
+
+if(GENSRC_CFLAGS)
+	set_source_files_properties(${GENSRC} PROPERTIES COMPILE_FLAGS "${GENSRC_CFLAGS}")
+endif()
+unset(GENSRC_CFLAGS)
+
+
 set(SRC_RNA_INC
 	../RNA_access.h
 	../RNA_define.h
@@ -316,9 +329,6 @@ add_executable(makesrna ${SRC} ${SRC_RNA_INC} ${SRC_DNA_INC})
 target_link_libraries(makesrna bf_dna)
 target_link_libraries(makesrna bf_dna_blenlib)
 
-# too many warnings with clang
-remove_cc_flag("-Wmissing-prototypes")
-
 # Output rna_*_gen.c
 # note (linux only): with crashes try add this after COMMAND: valgrind --leak-check=full --track-origins=yes
 add_custom_command(
diff --git a/source/blender/makesrna/intern/rna_sound_api.c b/source/blender/makesrna/intern/rna_sound_api.c
index 07b6598..0164daa 100644
--- a/source/blender/makesrna/intern/rna_sound_api.c
+++ b/source/blender/makesrna/intern/rna_sound_api.c
@@ -32,6 +32,8 @@
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
+#include "rna_internal.h"
+
 #ifdef RNA_RUNTIME
 
 #include "BKE_packedFile.h"
diff --git a/source/blender/makesrna/intern/rna_vfont_api.c b/source/blender/makesrna/intern/rna_vfont_api.c
index 6e6c08d..d92e75d 100644
--- a/source/blender/makesrna/intern/rna_vfont_api.c
+++ b/source/blender/makesrna/intern/rna_vfont_api.c
@@ -32,6 +32,8 @@
 #include "RNA_define.h"
 #include "RNA_enum_types.h"
 
+#include "rna_internal.h"
+
 #ifdef RNA_RUNTIME
 
 #include "BKE_packedFile.h"
diff --git a/source/blender/render/intern/source/bake_api.c b/source/blender/render/intern/source/bake_api.c
index 90deac2..48ef291 100644
--- a/source/blender/render/intern/source/bake_api.c
+++ b/source/blender/render/intern/source/bake_api.c
@@ -444,7 +444,7 @@ bool RE_bake_pixels_populate_from_objects(
 	size_t i;
 	int primitive_id;
 	float u, v;
-	float imat_low [4][4];
+	float imat_low[4][4];
 	bool is_cage = me_cage != NULL;
 	bool result = true;




More information about the Bf-blender-cvs mailing list