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

Add missing braces #1650

Merged
merged 1 commit into from
Jul 30, 2023
Merged
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
12 changes: 6 additions & 6 deletions nanovdb/nanovdb/NanoVDB.h
Original file line number Diff line number Diff line change
Expand Up @@ -569,14 +569,14 @@ class Rgba8
Rgba8(Rgba8&&) = default;
Rgba8& operator=(Rgba8&&) = default;
Rgba8& operator=(const Rgba8&) = default;
__hostdev__ Rgba8() : mData{0,0,0,0} {static_assert(sizeof(uint32_t) == sizeof(Rgba8),"Unexpected sizeof");}
__hostdev__ Rgba8(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255u) : mData{r, g, b, a} {}
__hostdev__ Rgba8() : mData{{0,0,0,0}} {static_assert(sizeof(uint32_t) == sizeof(Rgba8),"Unexpected sizeof");}
__hostdev__ Rgba8(uint8_t r, uint8_t g, uint8_t b, uint8_t a = 255u) : mData{{r, g, b, a}} {}
explicit __hostdev__ Rgba8(uint8_t v) : Rgba8(v,v,v,v) {}
__hostdev__ Rgba8(float r, float g, float b, float a = 1.0f)
: mData{(uint8_t(0.5f + r * 255.0f)),// round to nearest
(uint8_t(0.5f + g * 255.0f)),// round to nearest
(uint8_t(0.5f + b * 255.0f)),// round to nearest
(uint8_t(0.5f + a * 255.0f))}// round to nearest
: mData{{(uint8_t(0.5f + r * 255.0f)), // round to nearest
(uint8_t(0.5f + g * 255.0f)), // round to nearest
(uint8_t(0.5f + b * 255.0f)), // round to nearest
(uint8_t(0.5f + a * 255.0f))}}// round to nearest
{
}
__hostdev__ bool operator<(const Rgba8& rhs) const { return mData.packed < rhs.mData.packed; }
Expand Down