Skip to content

Commit

Permalink
fix atomic exchange template deduction (#1035)
Browse files Browse the repository at this point in the history
  • Loading branch information
pca006132 authored Nov 12, 2024
1 parent 66bca6e commit 12b43f5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ struct UpdateProperties {
const int propVert = triProp[tri][i];

auto old = std::atomic_exchange(
reinterpret_cast<std::atomic<uint8_t>*>(&counters[propVert]), 1);
reinterpret_cast<std::atomic<uint8_t>*>(&counters[propVert]),
static_cast<uint8_t>(1));
if (old == 1) return;

for (int p = 0; p < oldNumProp; ++p) {
Expand Down
2 changes: 1 addition & 1 deletion src/smoothing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ Vec<int> Manifold::Impl::VertHalfedge() const {
auto old = std::atomic_exchange(
reinterpret_cast<std::atomic<uint8_t>*>(
&counters[halfedge_[idx].startVert]),
1);
static_cast<uint8_t>(1));
if (old == 1) return;
// arbitrary, last one wins.
vertHalfedge[halfedge_[idx].startVert] = idx;
Expand Down

0 comments on commit 12b43f5

Please sign in to comment.