From 543a4a3a010e0a20ed430dc3a52cc29afa5483b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Wed, 16 Jun 2021 12:54:08 +0200 Subject: [PATCH] fix: add packed attributes to needed structs --- image-viewer/include/display_utils.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/image-viewer/include/display_utils.h b/image-viewer/include/display_utils.h index 4f1484d83e258db27ed6bf72ceeb94608df6c891..903e4d440bae0417d1a357238f0b73a98711df5c 100644 --- a/image-viewer/include/display_utils.h +++ b/image-viewer/include/display_utils.h @@ -13,24 +13,24 @@ typedef union { struct { - uint8_t r : 5; - uint8_t g : 6; uint8_t b : 5; - } fields; + uint8_t g : 6; + uint8_t r : 5; + } __attribute__((__packed__)) fields; uint16_t bits; -} display_pixel_t; +} __attribute__((__packed__)) display_pixel_t; typedef struct { uint8_t red; uint8_t green; uint8_t blue; -} raw_pixel_onebit_t; +} __attribute__((__packed__)) raw_pixel_onebit_t; typedef struct { uint16_t red; uint16_t green; uint16_t blue; -} raw_pixel_t; +} __attribute__((__packed__)) raw_pixel_t; typedef struct { void* base_address;