Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/geode/basic/cached_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,26 @@
namespace geode
{
template < typename ReturnType >
class CachedValue

Check warning on line 38 in include/geode/basic/cached_value.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/basic/cached_value.hpp:38:11 [cppcoreguidelines-special-member-functions]

class 'CachedValue' defines a copy constructor, a copy assignment operator, a move constructor and a move assignment operator but does not define a destructor
{
public:
template < typename... Args >
using CachedFunction =
typename std::add_pointer< ReturnType( Args... ) >::type;

Check warning on line 43 in include/geode/basic/cached_value.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/basic/cached_value.hpp:43:22 [modernize-type-traits]

use c++14 style type templates

CachedValue() = default;
CachedValue( const CachedValue& other )
{
value_ = other.value_;

Check warning on line 48 in include/geode/basic/cached_value.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/basic/cached_value.hpp:48:13 [cppcoreguidelines-prefer-member-initializer]

'value_' should be initialized in a member initializer of the constructor
computed_ = other.computed_.load();

Check warning on line 49 in include/geode/basic/cached_value.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/basic/cached_value.hpp:49:13 [cppcoreguidelines-prefer-member-initializer]

'computed_' should be initialized in a member initializer of the constructor
}
CachedValue( CachedValue&& other ) noexcept
{
value_ = std::move( other.value_ );

Check warning on line 53 in include/geode/basic/cached_value.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/basic/cached_value.hpp:53:13 [cppcoreguidelines-prefer-member-initializer]

'value_' should be initialized in a member initializer of the constructor
computed_ = other.computed_.load();

Check warning on line 54 in include/geode/basic/cached_value.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/basic/cached_value.hpp:54:13 [cppcoreguidelines-prefer-member-initializer]

'computed_' should be initialized in a member initializer of the constructor
}

CachedValue& operator=( const CachedValue& other )

Check warning on line 57 in include/geode/basic/cached_value.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/basic/cached_value.hpp:57:22 [cert-oop54-cpp]

operator=() does not handle self-assignment properly
{
value_ = other.value_;
computed_ = other.computed_.load();
Expand Down Expand Up @@ -93,7 +93,7 @@
return false;
}

void reset()
void reset() const
{
computed_ = false;
}
Expand All @@ -116,7 +116,7 @@
serializer.ext(
*this, Growable< Archive, CachedValue >{
{ []( Archive& archive, CachedValue& value ) {
bool computed;

Check warning on line 119 in include/geode/basic/cached_value.hpp

View workflow job for this annotation

GitHub Actions / test / tidy

include/geode/basic/cached_value.hpp:119:38 [cppcoreguidelines-init-variables]

variable 'computed' is not initialized
archive.value1b( computed );
value.computed_ = computed;
archive( value.value_ );
Expand Down
1 change: 1 addition & 0 deletions src/geode/mesh/core/solid_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include <geode/mesh/core/solid_mesh.hpp>

#include <stack>

Check warning on line 27 in src/geode/mesh/core/solid_mesh.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/mesh/core/solid_mesh.cpp:27:1 [readability-duplicate-include]

duplicate include

#include <absl/container/flat_hash_set.h>
#include <absl/hash/hash.h>
Expand Down Expand Up @@ -162,7 +162,7 @@
}

template < geode::index_t dimension >
std::tuple< geode::PolyhedraAroundEdge, bool > propagate_around_edge(

Check warning on line 165 in src/geode/mesh/core/solid_mesh.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/mesh/core/solid_mesh.cpp:165:52 [readability-function-cognitive-complexity]

function 'propagate_around_edge' has cognitive complexity of 16 (threshold 10)
const geode::SolidMesh< dimension >& solid,
geode::PolyhedronFacet facet,
const std::array< geode::index_t, 2 >& edge_vertices )
Expand Down Expand Up @@ -441,7 +441,7 @@
public:
explicit Impl( SolidMesh& solid )
: polyhedron_around_vertex_( solid.vertex_attribute_manager()
.template find_or_create_attribute< VariableAttribute,

Check failure on line 444 in src/geode/mesh/core/solid_mesh.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/mesh/core/solid_mesh.cpp:444:59 [clang-diagnostic-error]

use of undeclared identifier 'VariableAttribute'
PolyhedronVertex >( "polyhedron_around_vertex",
PolyhedronVertex{},
{ false, false, false } ) )
Expand Down Expand Up @@ -680,7 +680,7 @@
{
polyhedra_around_vertex_ =
solid.vertex_attribute_manager()
.template find_or_create_attribute< VariableAttribute,

Check failure on line 683 in src/geode/mesh/core/solid_mesh.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/mesh/core/solid_mesh.cpp:683:57 [clang-diagnostic-error]

use of undeclared identifier 'VariableAttribute'
CachedPolyhedra >( POLYHEDRA_AROUND_VERTEX_NAME,
CachedPolyhedra{}, { false, false, false } );
}
Expand All @@ -699,6 +699,7 @@
{
return cached.value();
}
cached.reset();
cached( compute_polyhedra_around_vertex, mesh, vertex_id,
first_polyhedron );
return cached.value();
Expand Down Expand Up @@ -808,9 +809,9 @@

private:
mutable AttributeManager polyhedron_attribute_manager_;
std::shared_ptr< VariableAttribute< PolyhedronVertex > >

Check failure on line 812 in src/geode/mesh/core/solid_mesh.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/mesh/core/solid_mesh.cpp:812:26 [clang-diagnostic-error]

use of undeclared identifier 'VariableAttribute'
polyhedron_around_vertex_;
mutable std::shared_ptr< VariableAttribute< CachedPolyhedra > >

Check failure on line 814 in src/geode/mesh/core/solid_mesh.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/mesh/core/solid_mesh.cpp:814:34 [clang-diagnostic-error]

use of undeclared identifier 'VariableAttribute'
polyhedra_around_vertex_;
mutable std::unique_ptr< SolidEdges< dimension > > edges_;
mutable std::unique_ptr< SolidFacets< dimension > > facets_;
Expand Down
8 changes: 4 additions & 4 deletions src/geode/mesh/core/surface_mesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,13 +537,13 @@ namespace geode
const std::optional< PolygonVertex >& first_polygon ) const
{
const auto& cached = polygons_around_vertex_->value( vertex_id );
if( cached.computed()
&& ( first_polygon
&& absl::c_contains(
cached.value().polygons, first_polygon.value() ) ) )
if( cached.computed() && first_polygon
&& absl::c_contains(
cached.value().polygons, first_polygon.value() ) )
{
return cached.value();
}
cached.reset();
cached( compute_polygons_around_vertex, mesh, vertex_id,
first_polygon );
return cached.value();
Expand Down
Loading