~ruther/CTU-FEE-B0B35APO-Semestral-project

543a4a3a010e0a20ed430dc3a52cc29afa5483b3 — František Boháček 4 years ago 7f3ff29
fix: add packed attributes to needed structs
1 files changed, 6 insertions(+), 6 deletions(-)

M image-viewer/include/display_utils.h
M image-viewer/include/display_utils.h => image-viewer/include/display_utils.h +6 -6
@@ 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;