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.
This commit is contained in:
Campbell Barton
2012-06-11 12:13:41 +00:00
parent 71a7fb6286
commit 5248ec57d9
5 changed files with 62 additions and 38 deletions

View 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)

View File

@@ -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

View 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")

View 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) {

View 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;