minor fixes
authorCampbell Barton <ideasman42@gmail.com>
Mon, 11 Jun 2012 12:13:41 +0000 (12:13 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 11 Jun 2012 12:13:41 +0000 (12:13 +0000)
- 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.

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

index 191fb61e1b4f593c21f3197f6895ce3aeb6a39dd..5b70110947be116620b116c620a3840baf1c6201 100644 (file)
@@ -1605,6 +1605,20 @@ if(CMAKE_COMPILER_IS_GNUCC)
                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)
index ccb293d7a0e287de42d12a5ba5fd34d7c6b99f4a..924619619204b7eafff675c46a670e4e9c052fd8 100755 (executable)
@@ -61,7 +61,7 @@ if $DO_OUT_HTML ; then
 
        # 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
index bed2a1300a4ed2395b1714b87d7e82e8cadf1511..5962651995b0233ccc0fbedb4ab7930b5215f622 100644 (file)
@@ -1,5 +1,6 @@
 import bpy
 
+
 def main(operator, context):
     space = context.space_data
     node_tree = space.node_tree
@@ -14,7 +15,7 @@ def main(operator, context):
         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")
index 72303a4d6ee5d6bfdd0e1e1be70b055c7c45b076..d02eb2a0b980370119bb2fb927d0cc81d9b02974 100644 (file)
@@ -44,37 +44,38 @@ void MuteNode::reconnect(ExecutionSystem * graph, OutputSocket * output)
                }
        }
        
-       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_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;
+               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;
        }
 
        if (operation) {
index 279fd5d59be99960b15c0e8b5ddc6fccffda7226..1b68c520336e93b7112b00e9280911e4490b418b 100644 (file)
@@ -538,12 +538,16 @@ void IMB_rect_from_float(ImBuf *ibuf)
                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 @@ void IMB_partial_rect_from_float(ImBuf *ibuf, float *buffer, int x, int y, int w
                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;