Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix misc #1143

Merged
merged 3 commits into from
Feb 13, 2025
Merged

Fix misc #1143

merged 3 commits into from
Feb 13, 2025

Conversation

pca006132
Copy link
Collaborator

While debugging #1040 I took the time to fix a bunch of -Wextra warnings.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

Attention: Patch coverage is 91.48936% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.76%. Comparing base (447921c) to head (39f3b3d).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
src/hashtable.h 80.00% 2 Missing ⚠️
src/iters.h 77.77% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1143      +/-   ##
==========================================
+ Coverage   91.71%   91.76%   +0.04%     
==========================================
  Files          30       30              
  Lines        5951     5960       +9     
==========================================
+ Hits         5458     5469      +11     
+ Misses        493      491       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -22,7 +23,7 @@ template <typename F, typename Iter>
struct TransformIterator {
private:
Iter iter;
F f;
std::optional<F> f;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is optional so we can use the emplace function to avoid calling the copy assignment operator of f, which doesn't exist for lambdas. They only have copy constructors.

@@ -106,8 +106,7 @@ class VecView {
size_t length = std::numeric_limits<size_t>::max()) {
if (length == std::numeric_limits<size_t>::max())
length = this->size_ - offset;
ASSERT(length >= 0, std::out_of_range("Vec::view out of range"));
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because length is unsigned, it cannot be smaller than 0.

@@ -359,8 +359,8 @@ void AppendPartialEdges(Manifold::Impl &outR, Vec<char> &wholeHalfedgeP,
// reference is now to the endVert instead of the startVert, which is one
// position advanced CCW. This is only valid if this is a retained vert; it
// will be ignored later if the vert is new.
const TriRef forwardRef = {forward ? 0 : 1, -1, faceLeftP};
const TriRef backwardRef = {forward ? 0 : 1, -1, faceRightP};
const TriRef forwardRef = {forward ? 0 : 1, -1, faceLeftP, -1};
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The faceID was never initialized here, so I set it to -1. I think this is fine because we should copy the face IDs later?

Copy link
Owner

@elalish elalish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the cleanup!

@elalish elalish merged commit a857f00 into master Feb 13, 2025
27 checks passed
@elalish elalish deleted the fix-misc branch February 13, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants