Commit 541dc0d4 authored by Stefan Weil's avatar Stefan Weil Committed by Blue Swirl
Browse files

Use new macro QEMU_PACKED for packed structures



Most changes were made using these commands:

git grep -la '__attribute__((packed))'|xargs perl -pi -e 's/__attribute__\(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((packed))'|xargs perl -pi -e 's/__attribute__ \(\(packed\)\)/QEMU_PACKED/'
git grep -la '__attribute__((__packed__))'|xargs perl -pi -e 's/__attribute__\(\(__packed__\)\)/QEMU_PACKED/'
git grep -la '__attribute__ ((__packed__))'|xargs perl -pi -e 's/__attribute__ \(\(__packed__\)\)/QEMU_PACKED/'
git grep -la '__attribute((packed))'|xargs perl -pi -e 's/__attribute\(\(packed\)\)/QEMU_PACKED/'

Whitespace in linux-user/syscall_defs.h was fixed manually
to avoid warnings from scripts/checkpatch.pl.

Manual changes were also applied to hw/pc.c.

I did not fix indentation with tabs in block/vvfat.c.
The patch will show 4 errors with scripts/checkpatch.pl.

Signed-off-by: default avatarStefan Weil <weil@mail.berlios.de>
Signed-off-by: default avatarBlue Swirl <blauwirbel@gmail.com>
parent 0f7fdd34
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -151,7 +151,7 @@ struct external_lineno {
#define E_FILNMLEN	14	/* # characters in a file name		*/
#define E_DIMNUM	4	/* # array dimensions in auxiliary entry */

struct __attribute__((packed)) external_syment
struct QEMU_PACKED external_syment
{
  union {
    char e_name[E_SYMNMLEN];
+1 −1
Original line number Diff line number Diff line
@@ -1327,7 +1327,7 @@ struct partition {
        uint8_t end_cyl;            /* end cylinder */
        uint32_t start_sect;        /* starting sector counting from 0 */
        uint32_t nr_sects;          /* nr of sectors in partition */
} __attribute__((packed));
} QEMU_PACKED;

/* try to guess the disk logical geometry from the MSDOS partition table. Return 0 if OK, -1 if could not guess */
static int guess_disk_lchs(BlockDriverState *bs,
+1 −1
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ struct parallels_header {
    uint32_t catalog_entries;
    uint32_t nb_sectors;
    char padding[24];
} __attribute__((packed));
} QEMU_PACKED;

typedef struct BDRVParallelsState {

+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
#include "block_int.h"
#include "block/qcow2.h"

typedef struct __attribute__((packed)) QCowSnapshotHeader {
typedef struct QEMU_PACKED QCowSnapshotHeader {
    /* header is 8 byte aligned */
    uint64_t l1_table_offset;

+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ typedef struct {
    int64_t grain_offset;
    char filler[1];
    char check_bytes[4];
} __attribute__((packed)) VMDK4Header;
} QEMU_PACKED VMDK4Header;

#define L2_CACHE_SIZE 16

Loading