dect
/
libdect
Archived
13
0
Fork 0

libdect: align private storage areas to alignment of uint64_t

Make sure private storage areas are properly aligned even in the presence
of holes.

Signed-off-by: Patrick McHardy <kaber@trash.net>
This commit is contained in:
Patrick McHardy 2010-07-28 02:03:08 +02:00
parent 71920788b8
commit 2aef66006a
5 changed files with 8 additions and 5 deletions

View File

@ -332,7 +332,7 @@ struct dect_call {
enum dect_cc_states state;
struct dect_timer *setup_timer;
struct dect_fd *lu_sap;
uint8_t priv[];
uint8_t priv[] __aligned(__alignof__(uint64_t));
};
#define DECT_CC_SETUP_TIMEOUT 20 /* seconds */

View File

@ -8,6 +8,7 @@
#define _LIBDECT_IO_H
#include <sys/socket.h>
#include <utils.h>
/**
* struct dect_fd - libdect file descriptor
@ -22,7 +23,7 @@ struct dect_fd {
struct dect_fd *, uint32_t);
int fd;
void *data;
uint8_t priv[];
uint8_t priv[] __aligned(__alignof__(uint64_t));
};
extern struct dect_fd *dect_alloc_fd(const struct dect_handle *dh);

View File

@ -372,7 +372,7 @@ struct dect_mm_endpoint {
struct dect_data_link *link;
struct dect_mm_procedure procedure[DECT_TRANSACTION_MAX + 1];
struct dect_mm_procedure *current;
uint8_t priv[];
uint8_t priv[] __aligned(__alignof__(uint64_t));
};
#endif /* _LIBDECT_MM_H */

View File

@ -60,7 +60,7 @@ struct dect_ciss_register_msg {
*/
struct dect_ss_endpoint {
struct dect_transaction transaction;
uint8_t priv[];
uint8_t priv[] __aligned(__alignof__(uint64_t));
};
extern void dect_clss_rcv(struct dect_handle *dh, struct dect_msg_buf *mb);

View File

@ -7,6 +7,8 @@
#ifndef _LIBDECT_TIMER_H
#define _LIBDECT_TIMER_H
#include <utils.h>
struct dect_handle;
enum dect_timer_state {
@ -27,7 +29,7 @@ struct dect_timer {
struct dect_timer *);
void *data;
enum dect_timer_state state;
uint8_t priv[];
uint8_t priv[] __aligned(__alignof__(uint64_t));
};
extern struct dect_timer *dect_alloc_timer(const struct dect_handle *dh);