From 83b8fecdff4b607c7a5e52c7039f54e0cdeaef26 Mon Sep 17 00:00:00 2001 From: lnd3 Date: Sat, 14 Sep 2024 15:58:18 +0200 Subject: [PATCH] Fix warnings. --- packages/nodegraph/include/nodegraph/core/NodeGraphBase.h | 2 +- packages/nodegraph/include/nodegraph/core/NodeGraphInput.h | 1 - packages/nodegraph/source/common/core/NodeGraphBase.cpp | 7 +++---- packages/nodegraph/source/common/core/NodeGraphInput.cpp | 4 +++- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/nodegraph/include/nodegraph/core/NodeGraphBase.h b/packages/nodegraph/include/nodegraph/core/NodeGraphBase.h index c1b0cb94..8b2d75c7 100644 --- a/packages/nodegraph/include/nodegraph/core/NodeGraphBase.h +++ b/packages/nodegraph/include/nodegraph/core/NodeGraphBase.h @@ -68,7 +68,7 @@ namespace l::nodegraph { virtual bool SetInput(int8_t inputChannel, float* floatPtr); virtual void SetDefaultOutput(int8_t outputChannel, float constant, int32_t size = 1); - virtual bool SetInputBound(int8_t inputChannel, InputBound bound = InputBound::INPUT_DONTCHANGE, float boundMin = 0.0f, float boundMax = 0.0f); + virtual bool SetInputBound(int8_t inputChannel, InputBound bound = InputBound::INPUT_0_TO_1, float boundMin = 0.0f, float boundMax = 1.0f); virtual bool DetachInput(void* source); virtual bool IsDataConstant(int8_t num); diff --git a/packages/nodegraph/include/nodegraph/core/NodeGraphInput.h b/packages/nodegraph/include/nodegraph/core/NodeGraphInput.h index 213365ef..dbb0b671 100644 --- a/packages/nodegraph/include/nodegraph/core/NodeGraphInput.h +++ b/packages/nodegraph/include/nodegraph/core/NodeGraphInput.h @@ -22,7 +22,6 @@ namespace l::nodegraph { }; enum class InputBound { - INPUT_DONTCHANGE = 0, INPUT_UNBOUNDED, INPUT_0_TO_1, INPUT_0_TO_2, diff --git a/packages/nodegraph/source/common/core/NodeGraphBase.cpp b/packages/nodegraph/source/common/core/NodeGraphBase.cpp index 740735f9..d0976fe8 100644 --- a/packages/nodegraph/source/common/core/NodeGraphBase.cpp +++ b/packages/nodegraph/source/common/core/NodeGraphBase.cpp @@ -207,8 +207,7 @@ namespace l::nodegraph { } auto& input = mInputs.at(inputChannel); - if (bound == InputBound::INPUT_DONTCHANGE) { - }else if (bound == InputBound::INPUT_CUSTOM) { + if (bound == InputBound::INPUT_CUSTOM) { input.mBoundMin = boundMin; input.mBoundMax = boundMax; } @@ -289,12 +288,12 @@ namespace l::nodegraph { } void NodeGraphOp::Reset() { - for (int8_t i = 0; i < mDefaultInData.size(); i++) { + for (int8_t i = 0; i < static_cast(mDefaultInData.size()); i++) { auto& e = mDefaultInData.at(i); mNode->SetInput(i, std::get<0>(e), std::get<1>(e)); mNode->SetInputBound(i, l::nodegraph::InputBound::INPUT_CUSTOM, std::get<2>(e), std::get<3>(e)); } - for (int8_t i = 0; i < mDefaultOutData.size(); i++) { + for (int8_t i = 0; i < static_cast(mDefaultOutData.size()); i++) { auto& e = mDefaultOutData.at(i); auto output = &mNode->GetOutput(i, std::get<1>(e)); for (int32_t j = 0; j < std::get<1>(e);j++) { diff --git a/packages/nodegraph/source/common/core/NodeGraphInput.cpp b/packages/nodegraph/source/common/core/NodeGraphInput.cpp index 80fa6eef..cfd2886d 100644 --- a/packages/nodegraph/source/common/core/NodeGraphInput.cpp +++ b/packages/nodegraph/source/common/core/NodeGraphInput.cpp @@ -19,8 +19,10 @@ namespace l::nodegraph { return { 0.0f, 100.0f }; case InputBound::INPUT_UNBOUNDED: return { -l::math::constants::FLTMAX, l::math::constants::FLTMAX }; + case InputBound::INPUT_CUSTOM: + return { 0.0f, 0.0f }; } - return { -l::math::constants::FLTMAX, l::math::constants::FLTMAX }; + return { 0.0f, 0.0f }; } void NodeGraphInput::Reset() {