[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47742] trunk/blender: minor fixes

Campbell Barton ideasman42 at gmail.com
Mon Jun 11 14:13:43 CEST 2012


Revision: 47742
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47742
Author:   campbellbarton
Date:     2012-06-11 12:13:41 +0000 (Mon, 11 Jun 2012)
Log Message:
-----------
minor fixes
- new compositor could use uninitialized var
- profile conversion could use uninitialized var
- set better warnings for clang+cmake.
- remove picky warnings from sphinx doc gen shell script.

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/doc/python_api/sphinx_doc_gen.sh
    trunk/blender/release/scripts/templates/operator_node.py
    trunk/blender/source/blender/compositor/nodes/COM_MuteNode.cpp
    trunk/blender/source/blender/imbuf/intern/divers.c

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2012-06-11 11:54:16 UTC (rev 47741)
+++ trunk/blender/CMakeLists.txt	2012-06-11 12:13:41 UTC (rev 47742)
@@ -1605,6 +1605,20 @@
 		ADD_CHECK_C_COMPILER_FLAG(CC_REMOVE_STRICT_FLAGS C_WARN_NO_ERROR_UNUSED_BUT_SET_VARIABLE -Wno-error=unused-but-set-variable)
 	endif()
 
+elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
+
+	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)
+	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_AUTOLOGICAL_COMPARE -Wno-tautological-compare)
+	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
+	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
+
+	ADD_CHECK_C_COMPILER_FLAG(CXX_WARNINGS C_WARN_ALL -Wall)
+	ADD_CHECK_C_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_AUTOLOGICAL_COMPARE -Wno-tautological-compare)
+	ADD_CHECK_C_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
+	ADD_CHECK_C_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
+	ADD_CHECK_C_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_OVERLOADED_VIRTUAL -Wno-overloaded-virtual)  # we get a lot of these, if its a problem a dev needs to look into it.
+	ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_INVALID_OFFSETOF -Wno-invalid-offsetof)
+
 elseif(CMAKE_C_COMPILER_ID MATCHES "Intel")
 
 	ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_ALL -Wall)

Modified: trunk/blender/doc/python_api/sphinx_doc_gen.sh
===================================================================
--- trunk/blender/doc/python_api/sphinx_doc_gen.sh	2012-06-11 11:54:16 UTC (rev 47741)
+++ trunk/blender/doc/python_api/sphinx_doc_gen.sh	2012-06-11 12:13:41 UTC (rev 47742)
@@ -61,7 +61,7 @@
 
 	# annoying bug in sphinx makes it very slow unless we do this. should report.
 	cd $SPHINXBASE
-	sphinx-build -n -b html sphinx-in sphinx-out
+	sphinx-build -b html sphinx-in sphinx-out
 
 	# XXX, saves space on upload and zip, should move HTML outside
 	# and zip up there, for now this is OK

Modified: trunk/blender/release/scripts/templates/operator_node.py
===================================================================
--- trunk/blender/release/scripts/templates/operator_node.py	2012-06-11 11:54:16 UTC (rev 47741)
+++ trunk/blender/release/scripts/templates/operator_node.py	2012-06-11 12:13:41 UTC (rev 47742)
@@ -1,5 +1,6 @@
 import bpy
 
+
 def main(operator, context):
     space = context.space_data
     node_tree = space.node_tree
@@ -14,7 +15,7 @@
         return
 
     node_other, = node_selected
-    
+
     # now we have 2 nodes to operate on
     if not node_active.inputs:
         operator.report({'ERROR'}, "Active node has no inputs")

Modified: trunk/blender/source/blender/compositor/nodes/COM_MuteNode.cpp
===================================================================
--- trunk/blender/source/blender/compositor/nodes/COM_MuteNode.cpp	2012-06-11 11:54:16 UTC (rev 47741)
+++ trunk/blender/source/blender/compositor/nodes/COM_MuteNode.cpp	2012-06-11 12:13:41 UTC (rev 47742)
@@ -44,38 +44,39 @@
 		}
 	}
 	
-	NodeOperation * operation;
+	NodeOperation *operation;
 	switch (output->getDataType()) {
-	case COM_DT_VALUE:
-	{
-		SetValueOperation *valueoperation = new SetValueOperation();
-		valueoperation->setValue(0.0f);
-		operation = valueoperation;
-		break;
+		case COM_DT_VALUE:
+		{
+			SetValueOperation *valueoperation = new SetValueOperation();
+			valueoperation->setValue(0.0f);
+			operation = valueoperation;
+			break;
+		}
+		case COM_DT_VECTOR:
+		{
+			SetVectorOperation *vectoroperation = new SetVectorOperation();
+			vectoroperation->setX(0.0f);
+			vectoroperation->setY(0.0f);
+			vectoroperation->setW(0.0f);
+			operation = vectoroperation;
+			break;
+		}
+		case COM_DT_COLOR:
+		{
+			SetColorOperation *coloroperation = new SetColorOperation();
+			coloroperation->setChannel1(0.0f);
+			coloroperation->setChannel2(0.0f);
+			coloroperation->setChannel3(0.0f);
+			coloroperation->setChannel4(0.0f);
+			operation = coloroperation;
+			break;
+		}
+			/* quiet warnings */
+		case COM_DT_UNKNOWN:
+			operation = NULL;
+			break;
 	}
-	case COM_DT_VECTOR:
-	{
-		SetVectorOperation *vectoroperation = new SetVectorOperation();
-		vectoroperation->setX(0.0f);
-		vectoroperation->setY(0.0f);
-		vectoroperation->setW(0.0f);
-		operation = vectoroperation;
-		break;
-	}
-	case COM_DT_COLOR:
-	{
-		SetColorOperation *coloroperation = new SetColorOperation();
-		coloroperation->setChannel1(0.0f);
-		coloroperation->setChannel2(0.0f);
-		coloroperation->setChannel3(0.0f);
-		coloroperation->setChannel4(0.0f);
-		operation = coloroperation;
-		break;
-	}
-		/* quiet warnings */
-	case COM_DT_UNKNOWN:
-		break;
-	}
 
 	if (operation) {
 		output->relinkConnections(operation->getOutputSocket(), false);

Modified: trunk/blender/source/blender/imbuf/intern/divers.c
===================================================================
--- trunk/blender/source/blender/imbuf/intern/divers.c	2012-06-11 11:54:16 UTC (rev 47741)
+++ trunk/blender/source/blender/imbuf/intern/divers.c	2012-06-11 12:13:41 UTC (rev 47742)
@@ -538,12 +538,16 @@
 		imb_addrectImBuf(ibuf);
 
 	/* determine profiles */
-	if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
+	if (ibuf->profile == IB_PROFILE_LINEAR_RGB) {
 		profile_from = IB_PROFILE_LINEAR_RGB;
-	else if (ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
+	}
+	else if (ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE)) {
 		profile_from = IB_PROFILE_SRGB;
-	else
+	}
+	else {
+		profile_from = IB_PROFILE_SRGB; /* should never happen */
 		BLI_assert(0);
+	}
 
 	/* do conversion */
 	IMB_buffer_byte_from_float((uchar *)ibuf->rect, ibuf->rect_float,
@@ -571,12 +575,16 @@
 		imb_addrectImBuf(ibuf);
 
 	/* determine profiles */
-	if (ibuf->profile == IB_PROFILE_LINEAR_RGB)
+	if (ibuf->profile == IB_PROFILE_LINEAR_RGB) {
 		profile_from = IB_PROFILE_LINEAR_RGB;
-	else if (ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE))
+	}
+	else if (ELEM(ibuf->profile, IB_PROFILE_SRGB, IB_PROFILE_NONE)) {
 		profile_from = IB_PROFILE_SRGB;
-	else
+	}
+	else {
+		profile_from = IB_PROFILE_SRGB; /* should never happen */
 		BLI_assert(0);
+	}
 
 	/* do conversion */
 	rect_float = ibuf->rect_float + (x + y * ibuf->x) * ibuf->channels;




More information about the Bf-blender-cvs mailing list