Skip to content

Commit

Permalink
Merge pull request #1196 from vsg-dev/gcc_13_warning_fixes
Browse files Browse the repository at this point in the history
Renamed ArrayState::clone() to ArrayState::cloneArrayState() to fix gcc 13 warnings.
  • Loading branch information
robertosfield authored May 20, 2024
2 parents b78e18b + 99d5abb commit 967e632
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
24 changes: 12 additions & 12 deletions include/vsg/state/ArrayState.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ namespace vsg
ArrayState(const ArrayState& rhs, const CopyOp& copyop = {});

/// clone self
virtual ref_ptr<ArrayState> clone()
virtual ref_ptr<ArrayState> cloneArrayState()
{
return ArrayState::create(*this);
}

// clone the specified ArrayState
virtual ref_ptr<ArrayState> clone(ref_ptr<ArrayState> arrayState)
virtual ref_ptr<ArrayState> cloneArrayState(ref_ptr<ArrayState> arrayState)
{
return ArrayState::create(*arrayState);
}
Expand Down Expand Up @@ -99,8 +99,8 @@ namespace vsg
NullArrayState();
explicit NullArrayState(const ArrayState& as);

ref_ptr<ArrayState> clone() override;
ref_ptr<ArrayState> clone(ref_ptr<ArrayState> arrayState) override;
ref_ptr<ArrayState> cloneArrayState() override;
ref_ptr<ArrayState> cloneArrayState(ref_ptr<ArrayState> arrayState) override;

using ArrayState::apply;

Expand All @@ -117,8 +117,8 @@ namespace vsg
PositionArrayState(const PositionArrayState& rhs);
explicit PositionArrayState(const ArrayState& rhs);

ref_ptr<ArrayState> clone() override;
ref_ptr<ArrayState> clone(ref_ptr<ArrayState> arrayState) override;
ref_ptr<ArrayState> cloneArrayState() override;
ref_ptr<ArrayState> cloneArrayState(ref_ptr<ArrayState> arrayState) override;

uint32_t position_attribute_location = 4;
AttributeDetails positionAttribute;
Expand All @@ -138,8 +138,8 @@ namespace vsg
DisplacementMapArrayState(const DisplacementMapArrayState& rhs);
explicit DisplacementMapArrayState(const ArrayState& rhs);

ref_ptr<ArrayState> clone() override;
ref_ptr<ArrayState> clone(ref_ptr<ArrayState> arrayState) override;
ref_ptr<ArrayState> cloneArrayState() override;
ref_ptr<ArrayState> cloneArrayState(ref_ptr<ArrayState> arrayState) override;

// binding of displacement map
uint32_t normal_attribute_location = 1;
Expand Down Expand Up @@ -175,8 +175,8 @@ namespace vsg
uint32_t position_attribute_location = 4;
AttributeDetails positionAttribute;

ref_ptr<ArrayState> clone() override;
ref_ptr<ArrayState> clone(ref_ptr<ArrayState> arrayState) override;
ref_ptr<ArrayState> cloneArrayState() override;
ref_ptr<ArrayState> cloneArrayState(ref_ptr<ArrayState> arrayState) override;

void apply(const VertexInputState& vas) override;
ref_ptr<const vec3Array> vertexArray(uint32_t instanceIndex) override;
Expand All @@ -191,8 +191,8 @@ namespace vsg
BillboardArrayState(const BillboardArrayState& rhs);
explicit BillboardArrayState(const ArrayState& rhs);

ref_ptr<ArrayState> clone() override;
ref_ptr<ArrayState> clone(ref_ptr<ArrayState> arrayState) override;
ref_ptr<ArrayState> cloneArrayState() override;
ref_ptr<ArrayState> cloneArrayState(ref_ptr<ArrayState> arrayState) override;

uint32_t position_attribute_location = 4;
AttributeDetails positionAttribute;
Expand Down
20 changes: 10 additions & 10 deletions src/vsg/state/ArrayState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,13 @@ NullArrayState::NullArrayState(const ArrayState& as) :
vertices = {};
}

ref_ptr<ArrayState> NullArrayState::clone()
ref_ptr<ArrayState> NullArrayState::cloneArrayState()
{
return NullArrayState::create(*this);
}

// clone the specified ArrayState
ref_ptr<ArrayState> NullArrayState::clone(ref_ptr<ArrayState> arrayState)
ref_ptr<ArrayState> NullArrayState::cloneArrayState(ref_ptr<ArrayState> arrayState)
{
return NullArrayState::create(*arrayState);
}
Expand Down Expand Up @@ -220,12 +220,12 @@ PositionArrayState::PositionArrayState(const ArrayState& rhs) :
{
}

ref_ptr<ArrayState> PositionArrayState::clone()
ref_ptr<ArrayState> PositionArrayState::cloneArrayState()
{
return PositionArrayState::create(*this);
}

ref_ptr<ArrayState> PositionArrayState::clone(ref_ptr<ArrayState> arrayState)
ref_ptr<ArrayState> PositionArrayState::cloneArrayState(ref_ptr<ArrayState> arrayState)
{
return PositionArrayState::create(*arrayState);
}
Expand Down Expand Up @@ -273,12 +273,12 @@ DisplacementMapArrayState::DisplacementMapArrayState(const ArrayState& rhs) :
{
}

ref_ptr<ArrayState> DisplacementMapArrayState::clone()
ref_ptr<ArrayState> DisplacementMapArrayState::cloneArrayState()
{
return DisplacementMapArrayState::create(*this);
}

ref_ptr<ArrayState> DisplacementMapArrayState::clone(ref_ptr<ArrayState> arrayState)
ref_ptr<ArrayState> DisplacementMapArrayState::cloneArrayState(ref_ptr<ArrayState> arrayState)
{
return DisplacementMapArrayState::create(*arrayState);
}
Expand Down Expand Up @@ -380,12 +380,12 @@ PositionAndDisplacementMapArrayState::PositionAndDisplacementMapArrayState(const
{
}

ref_ptr<ArrayState> PositionAndDisplacementMapArrayState::clone()
ref_ptr<ArrayState> PositionAndDisplacementMapArrayState::cloneArrayState()
{
return PositionAndDisplacementMapArrayState::create(*this);
}

ref_ptr<ArrayState> PositionAndDisplacementMapArrayState::clone(ref_ptr<ArrayState> arrayState)
ref_ptr<ArrayState> PositionAndDisplacementMapArrayState::cloneArrayState(ref_ptr<ArrayState> arrayState)
{
return PositionAndDisplacementMapArrayState::create(*arrayState);
}
Expand Down Expand Up @@ -457,12 +457,12 @@ BillboardArrayState::BillboardArrayState(const ArrayState& rhs) :
{
}

ref_ptr<ArrayState> BillboardArrayState::clone()
ref_ptr<ArrayState> BillboardArrayState::cloneArrayState()
{
return BillboardArrayState::create(*this);
}

ref_ptr<ArrayState> BillboardArrayState::clone(ref_ptr<ArrayState> arrayState)
ref_ptr<ArrayState> BillboardArrayState::cloneArrayState(ref_ptr<ArrayState> arrayState)
{
return BillboardArrayState::create(*arrayState);
}
Expand Down
2 changes: 1 addition & 1 deletion src/vsg/utils/ComputeBounds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void ComputeBounds::apply(const vsg::Object& object)

void ComputeBounds::apply(const StateGroup& stategroup)
{
auto arrayState = stategroup.prototypeArrayState ? stategroup.prototypeArrayState->clone(arrayStateStack.back()) : arrayStateStack.back()->clone();
auto arrayState = stategroup.prototypeArrayState ? stategroup.prototypeArrayState->cloneArrayState(arrayStateStack.back()) : arrayStateStack.back()->cloneArrayState();

for (auto& statecommand : stategroup.stateCommands)
{
Expand Down
2 changes: 1 addition & 1 deletion src/vsg/utils/Intersector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void Intersector::apply(const StateGroup& stategroup)
{
PushPopNode ppn(_nodePath, &stategroup);

auto arrayState = stategroup.prototypeArrayState ? stategroup.prototypeArrayState->clone(arrayStateStack.back()) : arrayStateStack.back()->clone();
auto arrayState = stategroup.prototypeArrayState ? stategroup.prototypeArrayState->cloneArrayState(arrayStateStack.back()) : arrayStateStack.back()->cloneArrayState();

for (auto& statecommand : stategroup.stateCommands)
{
Expand Down

0 comments on commit 967e632

Please sign in to comment.