Add a uint16_t control buffer type, as a union.

Then adapt the code using it. Make putting uint16_t easier in the
buffer. Pleases gcc better.

Signed-off-by: Benjamin Cama <benoar@dolka.fr>
This commit is contained in:
Benjamin Cama 2011-09-25 14:23:24 +02:00
parent 036223c418
commit 639b43bffc
2 changed files with 42 additions and 39 deletions

View file

@ -242,7 +242,10 @@ typedef struct controls // control message
{
struct controls *next; // next in queue
uint16_t length; // length
uint8_t buf[MAXCONTROL];
union {
uint8_t buf[MAXCONTROL];
uint16_t buf16[MAXCONTROL/2];
} __attribute__ ((__transparent_union__));
}
controlt;