chiark / gitweb /
tree-wide: use _packed_ macro instead of raw gcc __attribute__
authorLennart Poettering <lennart@poettering.net>
Sun, 8 Mar 2015 23:07:44 +0000 (00:07 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 9 Mar 2015 17:02:22 +0000 (18:02 +0100)
src/shared/efivars.c
src/udev/mtd_probe/mtd_probe.c
src/udev/mtd_probe/mtd_probe.h
src/udev/udev-builtin-usb_id.c

index 4f8a81dcdbe2da504bed9d3e52e2df3f024e9707..c6b45d214b8370627e1339e930a562ec4859b7ec 100644 (file)
@@ -42,7 +42,7 @@ struct boot_option {
         uint32_t attr;
         uint16_t path_len;
         uint16_t title[];
-} __attribute__((packed));
+} _packed_;
 
 struct drive_path {
         uint32_t part_nr;
@@ -51,7 +51,7 @@ struct drive_path {
         char signature[16];
         uint8_t mbr_type;
         uint8_t signature_type;
-} __attribute__((packed));
+} _packed_;
 
 struct device_path {
         uint8_t type;
@@ -61,7 +61,7 @@ struct device_path {
                 uint16_t path[0];
                 struct drive_path drive;
         };
-} __attribute__((packed));
+} _packed_;
 
 bool is_efi_boot(void) {
         return access("/sys/firmware/efi", F_OK) >= 0;
@@ -169,7 +169,7 @@ int efi_set_variable(
         struct var {
                 uint32_t attr;
                 char buf[];
-        } __attribute__((packed)) *buf = NULL;
+        } _packed_ *buf = NULL;
         char *p = NULL;
         int fd = -1;
         int r;
@@ -404,7 +404,7 @@ struct guid {
         uint16_t u2;
         uint16_t u3;
         uint8_t u4[8];
-} __attribute__((packed));
+} _packed_;
 
 static void id128_to_efi_guid(sd_id128_t id, void *guid) {
         struct guid *uuid = guid;
index 13c757bd1cbf94b7affca91b2fedc4a76f74147f..67b750c4b36caca1fbcb70a119508090f9ea6f42 100644 (file)
@@ -16,7 +16,7 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor,
  * Boston, MA  02110-1301  USA
  */
-#include "mtd_probe.h"
+
 #include <stdio.h>
 #include <sys/ioctl.h>
 #include <mtd/mtd-user.h>
@@ -26,6 +26,8 @@
 #include <unistd.h>
 #include <stdlib.h>
 
+#include "mtd_probe.h"
+
 int main(int argc, char** argv)
 {
         int mtd_fd;
index d99be9addcbc91553732e8fe498f2472c9cc72d1..caea5c26938ac8abae91724b5922e20b98926aef 100644 (file)
@@ -21,6 +21,8 @@
 
 #include <mtd/mtd-user.h>
 
+#include "macro.h"
+
 /* Full oob structure as written on the flash */
 struct sm_oob {
         uint32_t reserved;
@@ -30,8 +32,7 @@ struct sm_oob {
         uint8_t ecc2[3];
         uint8_t lba_copy2[2];
         uint8_t ecc1[3];
-} __attribute__((packed));
-
+} _packed_;
 
 /* one sector is always 512 bytes, but it can consist of two nand pages */
 #define SM_SECTOR_SIZE                512
@@ -47,5 +48,4 @@ struct sm_oob {
 #define SM_SMALL_PAGE                 256
 #define SM_SMALL_OOB_SIZE        8
 
-
 void probe_smart_media(int mtd_fd, mtd_info_t *info);
index ab0d96e3772f80db91f839bf04e647e80da9dbde..264ff5d6f7fe8a850204f314421c095cf8af8c65 100644 (file)
@@ -162,7 +162,7 @@ static int dev_if_packed_info(struct udev_device *dev, char *ifs_str, size_t len
                 u_int8_t        bInterfaceSubClass;
                 u_int8_t        bInterfaceProtocol;
                 u_int8_t        iInterface;
-        } __attribute__((packed));
+        } _packed_;
 
         if (asprintf(&filename, "%s/descriptors", udev_device_get_syspath(dev)) < 0)
                 return log_oom();