From 34c64cd1f9ef3a94508f1c7f22ec77fa6e9728ed Mon Sep 17 00:00:00 2001 From: gered Date: Sun, 30 Apr 2023 17:03:36 -0400 Subject: [PATCH] use #[repr(transparent)] for both color types --- ggdt/src/graphics/color.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ggdt/src/graphics/color.rs b/ggdt/src/graphics/color.rs index b8e7e62..23d8eb3 100644 --- a/ggdt/src/graphics/color.rs +++ b/ggdt/src/graphics/color.rs @@ -552,6 +552,7 @@ pub fn tinted_blend_argb_simd(tint: SimdColor4u8, src: SimdColor4u8, dest: SimdC /// Unpacked 32-bit color represented as individual 8-bit color components where the components are in the /// order alpha, red, green, blue. #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] +#[repr(transparent)] pub struct ARGBu8x4(pub simd::u8x4); impl ARGBu8x4 { @@ -686,6 +687,7 @@ impl From for ARGBu8x4 { /// Unpacked 32-bit color represented as individual normalized f32 color components (0.0 to 1.0) where the /// components are in the order alpha, red, green, blue. #[derive(Debug, Copy, Clone, PartialEq, PartialOrd)] +#[repr(transparent)] pub struct ARGBf32x4(pub simd::f32x4); impl ARGBf32x4 {