From ce5c41f0da73ae17df26ec70a2cc21a4d4bf1c61 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Thu, 5 Sep 2019 11:17:23 +0000 Subject: [PATCH] rust: use repr(C) for aligned structs Just a precaution: we want a predictable layout here. --- rust/dvp-ov/src/main.rs | 2 +- rust/glyph-mapping/src/main.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rust/dvp-ov/src/main.rs b/rust/dvp-ov/src/main.rs index 2419bb6..299131a 100644 --- a/rust/dvp-ov/src/main.rs +++ b/rust/dvp-ov/src/main.rs @@ -20,7 +20,7 @@ use k210_shared::soc::dvp::{DVPExt,sccb_addr_len,image_format}; use k210_shared::board::ov2640; /** 64-byte aligned screen RAM */ -#[repr(align(64))] +#[repr(C, align(64))] struct ScreenRAM { pub image: [u32; DISP_PIXELS / 2], } diff --git a/rust/glyph-mapping/src/main.rs b/rust/glyph-mapping/src/main.rs index 0e5af73..f6c91a1 100644 --- a/rust/glyph-mapping/src/main.rs +++ b/rust/glyph-mapping/src/main.rs @@ -22,7 +22,7 @@ use k210_shared::soc::dvp::{DVPExt,sccb_addr_len,image_format}; use k210_shared::board::ov2640; /** 64-byte aligned planar RAM */ -#[repr(align(64))] +#[repr(C, align(64))] struct PlanarScreenRAM { pub r: [u8; DISP_PIXELS], pub g: [u8; DISP_PIXELS],