Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@blender.org>2020-08-07 13:32:45 +0300
committerSybren A. Stüvel <sybren@blender.org>2020-08-07 14:38:06 +0300
commitf453ee7d3ab4be78f7bd0be5aa14d2a281552629 (patch)
tree2ab10475fa4c5b05cf36c6b073a5452feacbba38 /source/blender/compositor/intern
parentfb18e48a84a645a1ef8329f150b223afe0efc7f0 (diff)
Cleanup: Compositor, Clang-Tidy else-after-return fixes
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/compositor` module. No functional changes.
Diffstat (limited to 'source/blender/compositor/intern')
-rw-r--r--source/blender/compositor/intern/COM_CompositorContext.cpp5
-rw-r--r--source/blender/compositor/intern/COM_Converter.cpp10
-rw-r--r--source/blender/compositor/intern/COM_MemoryBuffer.cpp7
-rw-r--r--source/blender/compositor/intern/COM_NodeOperation.cpp51
4 files changed, 34 insertions, 39 deletions
diff --git a/source/blender/compositor/intern/COM_CompositorContext.cpp b/source/blender/compositor/intern/COM_CompositorContext.cpp
index e572fe7c99e..3d55fcba086 100644
--- a/source/blender/compositor/intern/COM_CompositorContext.cpp
+++ b/source/blender/compositor/intern/COM_CompositorContext.cpp
@@ -36,7 +36,6 @@ int CompositorContext::getFramenumber() const
if (this->m_rd) {
return this->m_rd->cfra;
}
- else {
- return -1; /* this should never happen */
- }
+
+ return -1; /* this should never happen */
}
diff --git a/source/blender/compositor/intern/COM_Converter.cpp b/source/blender/compositor/intern/COM_Converter.cpp
index edfeb3a3a04..60676ee42b7 100644
--- a/source/blender/compositor/intern/COM_Converter.cpp
+++ b/source/blender/compositor/intern/COM_Converter.cpp
@@ -416,19 +416,19 @@ NodeOperation *Converter::convertDataType(NodeOperationOutput *from, NodeOperati
if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_COLOR) {
return new ConvertValueToColorOperation();
}
- else if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
+ if (fromDatatype == COM_DT_VALUE && toDatatype == COM_DT_VECTOR) {
return new ConvertValueToVectorOperation();
}
- else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
+ if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VALUE) {
return new ConvertColorToValueOperation();
}
- else if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
+ if (fromDatatype == COM_DT_COLOR && toDatatype == COM_DT_VECTOR) {
return new ConvertColorToVectorOperation();
}
- else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) {
+ if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_VALUE) {
return new ConvertVectorToValueOperation();
}
- else if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
+ if (fromDatatype == COM_DT_VECTOR && toDatatype == COM_DT_COLOR) {
return new ConvertVectorToColorOperation();
}
diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cpp b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
index b958314d1b4..f58d7a768cc 100644
--- a/source/blender/compositor/intern/COM_MemoryBuffer.cpp
+++ b/source/blender/compositor/intern/COM_MemoryBuffer.cpp
@@ -136,10 +136,9 @@ float MemoryBuffer::getMaximumValue(rcti *rect)
delete temp;
return result;
}
- else {
- BLI_assert(0);
- return 0.0f;
- }
+
+ BLI_assert(0);
+ return 0.0f;
}
MemoryBuffer::~MemoryBuffer()
diff --git a/source/blender/compositor/intern/COM_NodeOperation.cpp b/source/blender/compositor/intern/COM_NodeOperation.cpp
index fa4b5a07c65..4e3c5d2df6c 100644
--- a/source/blender/compositor/intern/COM_NodeOperation.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperation.cpp
@@ -145,9 +145,8 @@ NodeOperation *NodeOperation::getInputOperation(unsigned int inputSocketIndex)
if (input && input->isConnected()) {
return &input->getLink()->getOperation();
}
- else {
- return NULL;
- }
+
+ return NULL;
}
void NodeOperation::getConnectedInputSockets(Inputs *sockets)
@@ -168,30 +167,29 @@ bool NodeOperation::determineDependingAreaOfInterest(rcti *input,
BLI_rcti_init(output, input->xmin, input->xmax, input->ymin, input->ymax);
return false;
}
- else {
- rcti tempOutput;
- bool first = true;
- for (int i = 0; i < getNumberOfInputSockets(); i++) {
- NodeOperation *inputOperation = this->getInputOperation(i);
- if (inputOperation &&
- inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
- if (first) {
- output->xmin = tempOutput.xmin;
- output->ymin = tempOutput.ymin;
- output->xmax = tempOutput.xmax;
- output->ymax = tempOutput.ymax;
- first = false;
- }
- else {
- output->xmin = min(output->xmin, tempOutput.xmin);
- output->ymin = min(output->ymin, tempOutput.ymin);
- output->xmax = max(output->xmax, tempOutput.xmax);
- output->ymax = max(output->ymax, tempOutput.ymax);
- }
+
+ rcti tempOutput;
+ bool first = true;
+ for (int i = 0; i < getNumberOfInputSockets(); i++) {
+ NodeOperation *inputOperation = this->getInputOperation(i);
+ if (inputOperation &&
+ inputOperation->determineDependingAreaOfInterest(input, readOperation, &tempOutput)) {
+ if (first) {
+ output->xmin = tempOutput.xmin;
+ output->ymin = tempOutput.ymin;
+ output->xmax = tempOutput.xmax;
+ output->ymax = tempOutput.ymax;
+ first = false;
+ }
+ else {
+ output->xmin = min(output->xmin, tempOutput.xmin);
+ output->ymin = min(output->ymin, tempOutput.ymin);
+ output->xmax = max(output->xmax, tempOutput.xmax);
+ output->ymax = max(output->ymax, tempOutput.ymax);
}
}
- return !first;
}
+ return !first;
}
/*****************
@@ -210,9 +208,8 @@ SocketReader *NodeOperationInput::getReader()
if (isConnected()) {
return &m_link->getOperation();
}
- else {
- return NULL;
- }
+
+ return NULL;
}
void NodeOperationInput::determineResolution(unsigned int resolution[2],