This abstraction layer serves no purpose. Just use
__attribute__((aligned(n))) directly.
14 files changed:
* struct itself may be misaligned. */
#define _packed_attribute __attribute__((packed))
* struct itself may be misaligned. */
#define _packed_attribute __attribute__((packed))
-/* Declare that the annotated variable, or variables of the annotated type, are
- * to be aligned on n-byte boundaries. */
-#define _aligned_attribute(n) __attribute__((aligned(n)))
-
/* Declare that pointers to the annotated type may alias other pointers. */
#define _may_alias_attribute __attribute__((may_alias))
/* Declare that pointers to the annotated type may alias other pointers. */
#define _may_alias_attribute __attribute__((may_alias))
#define DECODE_TABLE(name, num_syms, table_bits, max_codeword_len) \
u16 name[DECODE_TABLE_SIZE((num_syms), (table_bits), \
(max_codeword_len))] \
#define DECODE_TABLE(name, num_syms, table_bits, max_codeword_len) \
u16 name[DECODE_TABLE_SIZE((num_syms), (table_bits), \
(max_codeword_len))] \
- _aligned_attribute(DECODE_TABLE_ALIGNMENT)
+ __attribute__((aligned(DECODE_TABLE_ALIGNMENT)))
/*
* Declare the temporary "working_space" array needed for building the decode
/*
* Declare the temporary "working_space" array needed for building the decode
/* Optional extra data for a WIM inode */
struct wim_inode_extra {
size_t size; /* Size of the extra data in bytes */
/* Optional extra data for a WIM inode */
struct wim_inode_extra {
size_t size; /* Size of the extra data in bytes */
- u8 data[] _aligned_attribute(8); /* The extra data */
+ u8 data[] __attribute__((aligned(8))); /* The extra data */
/* u8 value[0]; */
/* then zero-padded to a 4-byte boundary */
/* u8 value[0]; */
/* then zero-padded to a 4-byte boundary */
-} _aligned_attribute(4);
+} __attribute__((aligned(4)));
static inline size_t
old_xattr_entry_size(const struct wimlib_xattr_entry_old *entry)
static inline size_t
old_xattr_entry_size(const struct wimlib_xattr_entry_old *entry)
* field) after 8-byte alignment, then the remaining space will be a
* variable-length list of tagged metadata items. See tagged_items.c
* for more information. */
* field) after 8-byte alignment, then the remaining space will be a
* variable-length list of tagged metadata items. See tagged_items.c
* for more information. */
- /* u8 tagged_items[] _aligned_attribute(8); */
+ /* u8 tagged_items[] __attribute__((aligned(8))); */
} _packed_attribute;
/* If num_extra_streams != 0, then there are that many extra stream
} _packed_attribute;
/* If num_extra_streams != 0, then there are that many extra stream
int
read_wim_header(WIMStruct *wim, struct wim_header *hdr)
{
int
read_wim_header(WIMStruct *wim, struct wim_header *hdr)
{
- struct wim_header_disk disk_hdr _aligned_attribute(8);
+ struct wim_header_disk disk_hdr __attribute__((aligned(8)));
struct filedes *in_fd = &wim->in_fd;
const tchar *filename = wim->filename;
int ret;
struct filedes *in_fd = &wim->in_fd;
const tchar *filename = wim->filename;
int ret;
write_wim_header(const struct wim_header *hdr, struct filedes *out_fd,
off_t offset)
{
write_wim_header(const struct wim_header *hdr, struct filedes *out_fd,
off_t offset)
{
- struct wim_header_disk disk_hdr _aligned_attribute(8);
+ struct wim_header_disk disk_hdr __attribute__((aligned(8)));
int ret;
disk_hdr.magic = cpu_to_le64(hdr->magic);
int ret;
disk_hdr.magic = cpu_to_le64(hdr->magic);
u8 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS];
u8 delta_state;
u8 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS];
u8 lz_rep_states[LZMS_NUM_LZ_REP_DECISIONS];
u8 delta_state;
u8 delta_rep_states[LZMS_NUM_DELTA_REP_DECISIONS];
-} _aligned_attribute(64);
+} __attribute__((aligned(64)));
/*
* This structure represents a byte position in the preprocessed input data and
/*
* This structure represents a byte position in the preprocessed input data and
* maintained per-position and are only updated occasionally.
*/
struct lzms_adaptive_state state;
* maintained per-position and are only updated occasionally.
*/
struct lzms_adaptive_state state;
-} _aligned_attribute(64);
+} __attribute__((aligned(64)));
/* The main compressor structure */
struct lzms_compressor {
/* The main compressor structure */
struct lzms_compressor {
u32 adjusted_offset_and_mainsym;
#define SEQ_MAINSYM_BITS 10
#define SEQ_MAINSYM_MASK (((u32)1 << SEQ_MAINSYM_BITS) - 1)
u32 adjusted_offset_and_mainsym;
#define SEQ_MAINSYM_BITS 10
#define SEQ_MAINSYM_MASK (((u32)1 << SEQ_MAINSYM_BITS) - 1)
-} _aligned_attribute(8);
+} __attribute__((aligned(8)));
/*
* This structure represents a byte position in the input buffer and a node in
/*
* This structure represents a byte position in the input buffer and a node in
# define OPTIMUM_GAP_MATCH 0x80000000
#endif
# define OPTIMUM_GAP_MATCH 0x80000000
#endif
-} _aligned_attribute(8);
+} __attribute__((aligned(8)));
/* The cost model for near-optimal parsing */
struct lzx_costs {
/* The cost model for near-optimal parsing */
struct lzx_costs {
*/
struct lzx_lru_queue {
u64 R;
*/
struct lzx_lru_queue {
u64 R;
-} _aligned_attribute(8);
+} __attribute__((aligned(8)));
#define LZX_QUEUE_OFFSET_SHIFT 21
#define LZX_QUEUE_OFFSET_MASK (((u64)1 << LZX_QUEUE_OFFSET_SHIFT) - 1)
#define LZX_QUEUE_OFFSET_SHIFT 21
#define LZX_QUEUE_OFFSET_MASK (((u64)1 << LZX_QUEUE_OFFSET_SHIFT) - 1)
* bits of aligned offset blocks */
u8 extra_offset_bits_minus_aligned[LZX_MAX_OFFSET_SLOTS];
* bits of aligned offset blocks */
u8 extra_offset_bits_minus_aligned[LZX_MAX_OFFSET_SLOTS];
-} _aligned_attribute(DECODE_TABLE_ALIGNMENT);
+} __attribute__((aligned(DECODE_TABLE_ALIGNMENT)));
/* Read a Huffman-encoded symbol using the precode. */
static forceinline unsigned
/* Read a Huffman-encoded symbol using the precode. */
static forceinline unsigned
u8 data[0];
/* then zero-padded to an 8-byte boundary */
u8 data[0];
/* then zero-padded to an 8-byte boundary */
-} _aligned_attribute(8);
+} __attribute__((aligned(8)));
/*
* Retrieve from @inode the first metadata item that is tagged with @tag and
/*
* Retrieve from @inode the first metadata item that is tagged with @tag and
/* Security descriptor */
if (randbool()) {
/* Security descriptor */
if (randbool()) {
- char desc[8192] _aligned_attribute(8);
+ char desc[8192] __attribute__((aligned(8)));
size_t size;
size = generate_random_security_descriptor(desc, ctx);
size_t size;
size = generate_random_security_descriptor(desc, ctx);
HANDLE h;
size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) +
(13 * sizeof(wchar_t));
HANDLE h;
size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) +
(13 * sizeof(wchar_t));
- u8 buf[bufsize] _aligned_attribute(8);
+ u8 buf[bufsize] __attribute__((aligned(8)));
bool retried = false;
FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf;
bool retried = false;
FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf;
size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) +
max(dentry->d_short_name_nbytes, sizeof(wchar_t)) +
sizeof(wchar_t);
size_t bufsize = offsetof(FILE_NAME_INFORMATION, FileName) +
max(dentry->d_short_name_nbytes, sizeof(wchar_t)) +
sizeof(wchar_t);
- u8 buf[bufsize] _aligned_attribute(8);
+ u8 buf[bufsize] __attribute__((aligned(8)));
FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf;
NTSTATUS status;
bool tried_to_remove_existing = false;
FILE_NAME_INFORMATION *info = (FILE_NAME_INFORMATION *)buf;
NTSTATUS status;
bool tried_to_remove_existing = false;
if (strm->stream_type == STREAM_TYPE_REPARSE_POINT &&
ctx->common.supported_features.reparse_points)
{
if (strm->stream_type == STREAM_TYPE_REPARSE_POINT &&
ctx->common.supported_features.reparse_points)
{
- u8 buf[REPARSE_DATA_OFFSET] _aligned_attribute(8);
+ u8 buf[REPARSE_DATA_OFFSET] __attribute__((aligned(8)));
struct reparse_buffer_disk *rpbuf =
(struct reparse_buffer_disk *)buf;
complete_reparse_point(rpbuf, inode, 0);
struct reparse_buffer_disk *rpbuf =
(struct reparse_buffer_disk *)buf;
complete_reparse_point(rpbuf, inode, 0);
size_t bufsize = offsetof(FILE_LINK_INFORMATION, FileName) +
ctx->pathbuf.Length + sizeof(wchar_t);
size_t bufsize = offsetof(FILE_LINK_INFORMATION, FileName) +
ctx->pathbuf.Length + sizeof(wchar_t);
- u8 buf[bufsize] _aligned_attribute(8);
+ u8 buf[bufsize] __attribute__((aligned(8)));
FILE_LINK_INFORMATION *info = (FILE_LINK_INFORMATION *)buf;
NTSTATUS status;
FILE_LINK_INFORMATION *info = (FILE_LINK_INFORMATION *)buf;
NTSTATUS status;
u32 len;
const struct wim_xattr_entry *entry;
size_t bufsize = 0;
u32 len;
const struct wim_xattr_entry *entry;
size_t bufsize = 0;
- u8 _buf[1024] _aligned_attribute(4);
+ u8 _buf[1024] __attribute__((aligned(4)));
u8 *buf = _buf;
FILE_FULL_EA_INFORMATION *ea, *ea_prev;
NTSTATUS status;
u8 *buf = _buf;
FILE_FULL_EA_INFORMATION *ea, *ea_prev;
NTSTATUS status;
};
HANDLE h;
NTSTATUS status;
};
HANDLE h;
NTSTATUS status;
- u8 buf[BUFFER_SIZE] _aligned_attribute(8);
+ u8 buf[BUFFER_SIZE] __attribute__((aligned(8)));
u64 bytes_remaining;
int ret;
u64 bytes_remaining;
int ret;
* course has to create its own handle. */
NTSTATUS status;
IO_STATUS_BLOCK iosb;
* course has to create its own handle. */
NTSTATUS status;
IO_STATUS_BLOCK iosb;
- u8 buf[128] _aligned_attribute(8);
+ u8 buf[128] __attribute__((aligned(8)));
const FILE_NAME_INFORMATION *info;
status = NtQueryInformationFile(h, &iosb, buf, sizeof(buf),
const FILE_NAME_INFORMATION *info;
status = NtQueryInformationFile(h, &iosb, buf, sizeof(buf),
struct winnt_scan_ctx *ctx)
{
SECURITY_INFORMATION requestedInformation;
struct winnt_scan_ctx *ctx)
{
SECURITY_INFORMATION requestedInformation;
- u8 _buf[4096] _aligned_attribute(8);
+ u8 _buf[4096] __attribute__((aligned(8)));
u8 *buf;
ULONG bufsize;
ULONG len_needed;
u8 *buf;
ULONG bufsize;
ULONG len_needed;
{
IO_STATUS_BLOCK iosb;
NTSTATUS status;
{
IO_STATUS_BLOCK iosb;
NTSTATUS status;
- u8 _buf[1024] _aligned_attribute(4);
+ u8 _buf[1024] __attribute__((aligned(4)));
u8 *buf = _buf;
const FILE_FULL_EA_INFORMATION *ea;
struct wim_xattr_entry *entry;
u8 *buf = _buf;
const FILE_FULL_EA_INFORMATION *ea;
struct wim_xattr_entry *entry;
struct winnt_scan_ctx *ctx)
{
int ret;
struct winnt_scan_ctx *ctx)
{
int ret;
- u8 _buf[4096] _aligned_attribute(8);
+ u8 _buf[4096] __attribute__((aligned(8)));
u8 *buf;
size_t bufsize;
IO_STATUS_BLOCK iosb;
u8 *buf;
size_t bufsize;
IO_STATUS_BLOCK iosb;
static void
get_volume_information(HANDLE h, struct winnt_scan_ctx *ctx)
{
static void
get_volume_information(HANDLE h, struct winnt_scan_ctx *ctx)
{
- u8 _attr_info[sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 128] _aligned_attribute(8);
+ u8 _attr_info[sizeof(FILE_FS_ATTRIBUTE_INFORMATION) + 128]
+ __attribute__((aligned(8)));
FILE_FS_ATTRIBUTE_INFORMATION *attr_info = (void *)_attr_info;
FILE_FS_VOLUME_INFORMATION vol_info;
struct file_info file_info;
FILE_FS_ATTRIBUTE_INFORMATION *attr_info = (void *)_attr_info;
FILE_FS_VOLUME_INFORMATION vol_info;
struct file_info file_info;
};
DECODE_TABLE_WORKING_SPACE(working_space, XPRESS_NUM_SYMBOLS,
XPRESS_MAX_CODEWORD_LEN);
};
DECODE_TABLE_WORKING_SPACE(working_space, XPRESS_NUM_SYMBOLS,
XPRESS_MAX_CODEWORD_LEN);
-} _aligned_attribute(DECODE_TABLE_ALIGNMENT);
+} __attribute__((aligned(DECODE_TABLE_ALIGNMENT)));
static int
xpress_decompress(const void *restrict compressed_data, size_t compressed_size,
static int
xpress_decompress(const void *restrict compressed_data, size_t compressed_size,