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

refactor: change return type to size_t for cross section vertex/contour count #1106

Merged
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
4 changes: 2 additions & 2 deletions bindings/c/cross.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,11 @@ double manifold_cross_section_area(ManifoldCrossSection *cs) {
return from_c(cs)->Area();
}

int manifold_cross_section_num_vert(ManifoldCrossSection *cs) {
size_t manifold_cross_section_num_vert(ManifoldCrossSection *cs) {
return from_c(cs)->NumVert();
}

int manifold_cross_section_num_contour(ManifoldCrossSection *cs) {
size_t manifold_cross_section_num_contour(ManifoldCrossSection *cs) {
return from_c(cs)->NumContour();
}

Expand Down
4 changes: 2 additions & 2 deletions bindings/c/include/manifold/manifoldc.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,8 @@ ManifoldCrossSection *manifold_cross_section_offset(
// CrossSection Info

double manifold_cross_section_area(ManifoldCrossSection *cs);
int manifold_cross_section_num_vert(ManifoldCrossSection *cs);
int manifold_cross_section_num_contour(ManifoldCrossSection *cs);
size_t manifold_cross_section_num_vert(ManifoldCrossSection *cs);
size_t manifold_cross_section_num_contour(ManifoldCrossSection *cs);
int manifold_cross_section_is_empty(ManifoldCrossSection *cs);
ManifoldRect *manifold_cross_section_bounds(void *mem,
ManifoldCrossSection *cs);
Expand Down
4 changes: 2 additions & 2 deletions include/manifold/cross_section.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ class CrossSection {
*/
///@{
bool IsEmpty() const;
int NumVert() const;
int NumContour() const;
size_t NumVert() const;
size_t NumContour() const;
Rect Bounds() const;
double Area() const;
///@}
Expand Down
6 changes: 3 additions & 3 deletions src/cross_section/cross_section.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -740,8 +740,8 @@ double CrossSection::Area() const { return C2::Area(GetPaths()->paths_); }
/**
* Return the number of vertices in the CrossSection.
*/
int CrossSection::NumVert() const {
int n = 0;
size_t CrossSection::NumVert() const {
size_t n = 0;
auto paths = GetPaths()->paths_;
for (auto p : paths) {
n += p.size();
Expand All @@ -753,7 +753,7 @@ int CrossSection::NumVert() const {
* Return the number of contours (both outer and inner paths) in the
* CrossSection.
*/
int CrossSection::NumContour() const { return GetPaths()->paths_.size(); }
size_t CrossSection::NumContour() const { return GetPaths()->paths_.size(); }

/**
* Does the CrossSection contain any contours?
Expand Down
Loading