[U-Boot] [PATCH] display_buffer: fix misaligned buffer
Wolfgang Denk
wd at denx.de
Wed Sep 8 01:23:35 CEST 2010
Dear Reinhard Meyer,
In message <4C7B7C52.1040606 at emk-elektronik.de> you wrote:
> Reinhard Meyer schrieb:
> >> + uint32_t linebuf[MAX_LINE_LENGTH_BYTES/4 + 1];
> >>> uint32_t *uip = (void*)linebuf;
> >>> uint16_t *usp = (void*)linebuf;
> >>> uint8_t *ucp = (void*)linebuf;
> > I personally prefer this above an attribute. Its disputeable but I prefer
> > to do things with "normal C constructs" where possible.
> Reading this, after it had been sent, a perfect patch
> should make the buffer an union:
>
> union {
> uint32_t ui[MAX.../4+1];
> uint16_t us[MAX.../2+1];
> uint8_t uc[MAX...+1];
> } linebuf;
Sorry, but I do not want to see any of this /4 and /2 stuff.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Pain is a thing of the mind. The mind can be controlled.
-- Spock, "Operation -- Annihilate!" stardate 3287.2
More information about the U-Boot
mailing list