Skip to content

Commit

Permalink
Fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
linuscu committed Sep 14, 2024
1 parent c6181bc commit 83b8fec
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/nodegraph/include/nodegraph/core/NodeGraphBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion packages/nodegraph/include/nodegraph/core/NodeGraphInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ namespace l::nodegraph {
};

enum class InputBound {
INPUT_DONTCHANGE = 0,
INPUT_UNBOUNDED,
INPUT_0_TO_1,
INPUT_0_TO_2,
Expand Down
7 changes: 3 additions & 4 deletions packages/nodegraph/source/common/core/NodeGraphBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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<int8_t>(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<int8_t>(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++) {
Expand Down
4 changes: 3 additions & 1 deletion packages/nodegraph/source/common/core/NodeGraphInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down

0 comments on commit 83b8fec

Please sign in to comment.