From 7ff2fdd3fc588e81c17d9bc9128c860a6e1eff58 Mon Sep 17 00:00:00 2001 From: Alessio Quaglino <102665781+quagla@users.noreply.github.com> Date: Wed, 26 Jul 2023 13:39:58 +0100 Subject: [PATCH] Add missing braces This solves a compile error when using -Wmissing-braces. Signed-off-by: Alessio Quaglino <102665781+quagla@users.noreply.github.com> --- nanovdb/nanovdb/NanoVDB.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nanovdb/nanovdb/NanoVDB.h b/nanovdb/nanovdb/NanoVDB.h index 946cdd03e2..b1fe3ee433 100644 --- a/nanovdb/nanovdb/NanoVDB.h +++ b/nanovdb/nanovdb/NanoVDB.h @@ -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; }