123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538 |
- From 245d0cce5e77d7465d61bfde91bc79477d5e6fd6 Mon Sep 17 00:00:00 2001
- From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
- Date: Thu, 26 Feb 2015 19:22:54 +0100
- Subject: [PATCH 10/14] Remove non standard int types
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
- Signed-off-by: Andreas Bombe <aeb@debian.org>
- ---
- src/boot.c | 16 +++----
- src/common.h | 2 -
- src/file.c | 2 -
- src/fsck.fat.h | 148 ++++++++++++++++++++++++++++-----------------------------
- src/io.c | 1 -
- src/lfn.c | 23 ++++-----
- src/mkfs.fat.c | 95 ++++++++++++++++++------------------
- 7 files changed, 138 insertions(+), 149 deletions(-)
- diff --git a/src/boot.c b/src/boot.c
- index be7bfb7..0c0918f 100644
- --- a/src/boot.c
- +++ b/src/boot.c
- @@ -25,8 +25,8 @@
- * by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
-
- #include <stdio.h>
- +#include <stdint.h>
- #include <string.h>
- -#include <sys/types.h>
- #include <stdlib.h>
- #include <time.h>
-
- @@ -45,7 +45,7 @@
- #define FAT16_THRESHOLD 65525
-
- static struct {
- - __u8 media;
- + uint8_t media;
- const char *descr;
- } mediabytes[] = {
- {
- @@ -62,7 +62,7 @@ static struct {
-
- /* Unaligned fields must first be accessed byte-wise */
- #define GET_UNALIGNED_W(f) \
- - ( (__u16)f[0] | ((__u16)f[1]<<8) )
- + ( (uint16_t)f[0] | ((uint16_t)f[1]<<8) )
-
- static const char *get_media_descr(unsigned char media)
- {
- @@ -166,18 +166,18 @@ static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, int lss)
- fs_read(fs->backupboot_start, sizeof(b2), &b2);
- if (memcmp(b, &b2, sizeof(b2)) != 0) {
- /* there are any differences */
- - __u8 *p, *q;
- + uint8_t *p, *q;
- int i, pos, first = 1;
- char buf[20];
-
- printf("There are differences between boot sector and its backup.\n");
- printf("This is mostly harmless. Differences: (offset:original/backup)\n ");
- pos = 2;
- - for (p = (__u8 *) b, q = (__u8 *) & b2, i = 0; i < sizeof(b2);
- + for (p = (uint8_t *) b, q = (uint8_t *) & b2, i = 0; i < sizeof(b2);
- ++p, ++q, ++i) {
- if (*p != *q) {
- sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ",
- - (unsigned)(p - (__u8 *) b), *p, *q);
- + (unsigned)(p - (uint8_t *) b), *p, *q);
- if (pos + strlen(buf) > 78)
- printf("\n "), pos = 2;
- printf("%s", buf);
- @@ -227,7 +227,7 @@ static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, int lss)
- if (interactive && get_key("12", "?") == '1') {
- /* search for a free reserved sector (not boot sector and not
- * backup boot sector) */
- - __u32 s;
- + uint32_t s;
- for (s = 1; s < le16toh(b->reserved); ++s)
- if (s != le16toh(b->backup_boot))
- break;
- @@ -425,7 +425,7 @@ void read_boot(DOS_FS * fs)
- fs->eff_fat_bits = (fs->fat_bits == 32) ? 28 : fs->fat_bits;
- fs->fat_size = fat_length * logical_sector_size;
-
- - fs->label = calloc(12, sizeof(__u8));
- + fs->label = calloc(12, sizeof(uint8_t));
- if (fs->fat_bits == 12 || fs->fat_bits == 16) {
- struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b;
- if (b16->extended_sig == 0x29)
- diff --git a/src/common.h b/src/common.h
- index b127f63..c15efb5 100644
- --- a/src/common.h
- +++ b/src/common.h
- @@ -20,8 +20,6 @@
- can be found in /usr/share/common-licenses/GPL-3 file.
- */
-
- -#include <asm/types.h>
- -
- #ifndef _COMMON_H
- #define _COMMON_H
-
- diff --git a/src/file.c b/src/file.c
- index 30adcde..0b53840 100644
- --- a/src/file.c
- +++ b/src/file.c
- @@ -34,8 +34,6 @@
- #define _LINUX_STRING_H_ /* hack to avoid inclusion of <linux/string.h> */
- #define _LINUX_FS_H /* hack to avoid inclusion of <linux/fs.h> */
-
- -#include <asm/types.h>
- -
- #include <linux/msdos_fs.h>
-
- #include "common.h"
- diff --git a/src/fsck.fat.h b/src/fsck.fat.h
- index e5ade5b..27e9d52 100644
- --- a/src/fsck.fat.h
- +++ b/src/fsck.fat.h
- @@ -28,14 +28,10 @@
- #define _DOSFSCK_H
-
- #include <fcntl.h>
- -#include <sys/types.h>
- #define _LINUX_STAT_H /* hack to avoid inclusion of <linux/stat.h> */
- #define _LINUX_STRING_H_ /* hack to avoid inclusion of <linux/string.h> */
- #define _LINUX_FS_H /* hack to avoid inclusion of <linux/fs.h> */
-
- -#include <asm/types.h>
- -#include <asm/byteorder.h>
- -
- #include <linux/msdos_fs.h>
-
- #include <stddef.h>
- @@ -49,95 +45,95 @@
- /* ++roman: Use own definition of boot sector structure -- the kernel headers'
- * name for it is msdos_boot_sector in 2.0 and fat_boot_sector in 2.1 ... */
- struct boot_sector {
- - __u8 ignored[3]; /* Boot strap short or near jump */
- - __u8 system_id[8]; /* Name - can be used to special case
- + uint8_t ignored[3]; /* Boot strap short or near jump */
- + uint8_t system_id[8]; /* Name - can be used to special case
- partition manager volumes */
- - __u8 sector_size[2]; /* bytes per logical sector */
- - __u8 cluster_size; /* sectors/cluster */
- - __u16 reserved; /* reserved sectors */
- - __u8 fats; /* number of FATs */
- - __u8 dir_entries[2]; /* root directory entries */
- - __u8 sectors[2]; /* number of sectors */
- - __u8 media; /* media code (unused) */
- - __u16 fat_length; /* sectors/FAT */
- - __u16 secs_track; /* sectors per track */
- - __u16 heads; /* number of heads */
- - __u32 hidden; /* hidden sectors (unused) */
- - __u32 total_sect; /* number of sectors (if sectors == 0) */
- + uint8_t sector_size[2]; /* bytes per logical sector */
- + uint8_t cluster_size; /* sectors/cluster */
- + uint16_t reserved; /* reserved sectors */
- + uint8_t fats; /* number of FATs */
- + uint8_t dir_entries[2]; /* root directory entries */
- + uint8_t sectors[2]; /* number of sectors */
- + uint8_t media; /* media code (unused) */
- + uint16_t fat_length; /* sectors/FAT */
- + uint16_t secs_track; /* sectors per track */
- + uint16_t heads; /* number of heads */
- + uint32_t hidden; /* hidden sectors (unused) */
- + uint32_t total_sect; /* number of sectors (if sectors == 0) */
-
- /* The following fields are only used by FAT32 */
- - __u32 fat32_length; /* sectors/FAT */
- - __u16 flags; /* bit 8: fat mirroring, low 4: active fat */
- - __u8 version[2]; /* major, minor filesystem version */
- - __u32 root_cluster; /* first cluster in root directory */
- - __u16 info_sector; /* filesystem info sector */
- - __u16 backup_boot; /* backup boot sector */
- - __u8 reserved2[12]; /* Unused */
- -
- - __u8 drive_number; /* Logical Drive Number */
- - __u8 reserved3; /* Unused */
- -
- - __u8 extended_sig; /* Extended Signature (0x29) */
- - __u32 serial; /* Serial number */
- - __u8 label[11]; /* FS label */
- - __u8 fs_type[8]; /* FS Type */
- + uint32_t fat32_length; /* sectors/FAT */
- + uint16_t flags; /* bit 8: fat mirroring, low 4: active fat */
- + uint8_t version[2]; /* major, minor filesystem version */
- + uint32_t root_cluster; /* first cluster in root directory */
- + uint16_t info_sector; /* filesystem info sector */
- + uint16_t backup_boot; /* backup boot sector */
- + uint8_t reserved2[12]; /* Unused */
- +
- + uint8_t drive_number; /* Logical Drive Number */
- + uint8_t reserved3; /* Unused */
- +
- + uint8_t extended_sig; /* Extended Signature (0x29) */
- + uint32_t serial; /* Serial number */
- + uint8_t label[11]; /* FS label */
- + uint8_t fs_type[8]; /* FS Type */
-
- /* fill up to 512 bytes */
- - __u8 junk[422];
- + uint8_t junk[422];
- } __attribute__ ((packed));
-
- struct boot_sector_16 {
- - __u8 ignored[3]; /* Boot strap short or near jump */
- - __u8 system_id[8]; /* Name - can be used to special case
- + uint8_t ignored[3]; /* Boot strap short or near jump */
- + uint8_t system_id[8]; /* Name - can be used to special case
- partition manager volumes */
- - __u8 sector_size[2]; /* bytes per logical sector */
- - __u8 cluster_size; /* sectors/cluster */
- - __u16 reserved; /* reserved sectors */
- - __u8 fats; /* number of FATs */
- - __u8 dir_entries[2]; /* root directory entries */
- - __u8 sectors[2]; /* number of sectors */
- - __u8 media; /* media code (unused) */
- - __u16 fat_length; /* sectors/FAT */
- - __u16 secs_track; /* sectors per track */
- - __u16 heads; /* number of heads */
- - __u32 hidden; /* hidden sectors (unused) */
- - __u32 total_sect; /* number of sectors (if sectors == 0) */
- -
- - __u8 drive_number; /* Logical Drive Number */
- - __u8 reserved2; /* Unused */
- -
- - __u8 extended_sig; /* Extended Signature (0x29) */
- - __u32 serial; /* Serial number */
- - __u8 label[11]; /* FS label */
- - __u8 fs_type[8]; /* FS Type */
- + uint8_t sector_size[2]; /* bytes per logical sector */
- + uint8_t cluster_size; /* sectors/cluster */
- + uint16_t reserved; /* reserved sectors */
- + uint8_t fats; /* number of FATs */
- + uint8_t dir_entries[2]; /* root directory entries */
- + uint8_t sectors[2]; /* number of sectors */
- + uint8_t media; /* media code (unused) */
- + uint16_t fat_length; /* sectors/FAT */
- + uint16_t secs_track; /* sectors per track */
- + uint16_t heads; /* number of heads */
- + uint32_t hidden; /* hidden sectors (unused) */
- + uint32_t total_sect; /* number of sectors (if sectors == 0) */
- +
- + uint8_t drive_number; /* Logical Drive Number */
- + uint8_t reserved2; /* Unused */
- +
- + uint8_t extended_sig; /* Extended Signature (0x29) */
- + uint32_t serial; /* Serial number */
- + uint8_t label[11]; /* FS label */
- + uint8_t fs_type[8]; /* FS Type */
-
- /* fill up to 512 bytes */
- - __u8 junk[450];
- + uint8_t junk[450];
- } __attribute__ ((packed));
-
- struct info_sector {
- - __u32 magic; /* Magic for info sector ('RRaA') */
- - __u8 junk[0x1dc];
- - __u32 reserved1; /* Nothing as far as I can tell */
- - __u32 signature; /* 0x61417272 ('rrAa') */
- - __u32 free_clusters; /* Free cluster count. -1 if unknown */
- - __u32 next_cluster; /* Most recently allocated cluster. */
- - __u32 reserved2[3];
- - __u16 reserved3;
- - __u16 boot_sign;
- + uint32_t magic; /* Magic for info sector ('RRaA') */
- + uint8_t junk[0x1dc];
- + uint32_t reserved1; /* Nothing as far as I can tell */
- + uint32_t signature; /* 0x61417272 ('rrAa') */
- + uint32_t free_clusters; /* Free cluster count. -1 if unknown */
- + uint32_t next_cluster; /* Most recently allocated cluster. */
- + uint32_t reserved2[3];
- + uint16_t reserved3;
- + uint16_t boot_sign;
- };
-
- typedef struct {
- - __u8 name[8], ext[3]; /* name and extension */
- - __u8 attr; /* attribute bits */
- - __u8 lcase; /* Case for base and extension */
- - __u8 ctime_ms; /* Creation time, milliseconds */
- - __u16 ctime; /* Creation time */
- - __u16 cdate; /* Creation date */
- - __u16 adate; /* Last access date */
- - __u16 starthi; /* High 16 bits of cluster in FAT32 */
- - __u16 time, date, start; /* time, date and first cluster */
- - __u32 size; /* file size (in bytes) */
- + uint8_t name[8], ext[3]; /* name and extension */
- + uint8_t attr; /* attribute bits */
- + uint8_t lcase; /* Case for base and extension */
- + uint8_t ctime_ms; /* Creation time, milliseconds */
- + uint16_t ctime; /* Creation time */
- + uint16_t cdate; /* Creation date */
- + uint16_t adate; /* Last access date */
- + uint16_t starthi; /* High 16 bits of cluster in FAT32 */
- + uint16_t time, date, start; /* time, date and first cluster */
- + uint32_t size; /* file size (in bytes) */
- } __attribute__ ((packed)) DIR_ENT;
-
- typedef struct _dos_file {
- diff --git a/src/io.c b/src/io.c
- index 3755ba5..450432c 100644
- --- a/src/io.c
- +++ b/src/io.c
- @@ -31,7 +31,6 @@
- * by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
-
- #define _LARGEFILE64_SOURCE
- -#include <sys/types.h>
- #include <stdlib.h>
- #include <stdio.h>
- #include <string.h>
- diff --git a/src/lfn.c b/src/lfn.c
- index 2e60198..2601172 100644
- --- a/src/lfn.c
- +++ b/src/lfn.c
- @@ -21,6 +21,7 @@
- */
-
- #include <stdio.h>
- +#include <stdint.h>
- #include <stdlib.h>
- #include <string.h>
- #include <limits.h>
- @@ -33,14 +34,14 @@
- #include "file.h"
-
- typedef struct {
- - __u8 id; /* sequence number for slot */
- - __u8 name0_4[10]; /* first 5 characters in name */
- - __u8 attr; /* attribute byte */
- - __u8 reserved; /* always 0 */
- - __u8 alias_checksum; /* checksum for 8.3 alias */
- - __u8 name5_10[12]; /* 6 more characters in name */
- - __u16 start; /* starting cluster number, 0 in long slots */
- - __u8 name11_12[4]; /* last 2 characters in name */
- + uint8_t id; /* sequence number for slot */
- + uint8_t name0_4[10]; /* first 5 characters in name */
- + uint8_t attr; /* attribute byte */
- + uint8_t reserved; /* always 0 */
- + uint8_t alias_checksum; /* checksum for 8.3 alias */
- + uint8_t name5_10[12]; /* 6 more characters in name */
- + uint16_t start; /* starting cluster number, 0 in long slots */
- + uint8_t name11_12[4]; /* last 2 characters in name */
- } LFN_ENT;
-
- #define LFN_ID_START 0x40
- @@ -173,7 +174,7 @@ static void clear_lfn_slots(int start, int end)
- void lfn_fix_checksum(loff_t from, loff_t to, const char *short_name)
- {
- int i;
- - __u8 sum;
- + uint8_t sum;
- for (sum = 0, i = 0; i < 11; i++)
- sum = (((sum & 1) << 7) | ((sum & 0xfe) >> 1)) + short_name[i];
-
- @@ -409,7 +410,7 @@ void lfn_add_slot(DIR_ENT * de, loff_t dir_offset)
- char *lfn_get(DIR_ENT * de, loff_t * lfn_offset)
- {
- char *lfn;
- - __u8 sum;
- + uint8_t sum;
- int i;
-
- *lfn_offset = 0;
- @@ -453,7 +454,7 @@ char *lfn_get(DIR_ENT * de, loff_t * lfn_offset)
- return NULL;
- case '3':
- for (i = 0; i < lfn_parts; ++i) {
- - __u8 id = (lfn_parts - i) | (i == 0 ? LFN_ID_START : 0);
- + uint8_t id = (lfn_parts - i) | (i == 0 ? LFN_ID_START : 0);
- fs_write(lfn_offsets[i] + offsetof(LFN_ENT, id),
- sizeof(id), &id);
- }
- diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
- index e6f9390..3d1512f 100644
- --- a/src/mkfs.fat.c
- +++ b/src/mkfs.fat.c
- @@ -60,7 +60,6 @@
- #include <sys/ioctl.h>
- #include <sys/stat.h>
- #include <sys/time.h>
- -#include <sys/types.h>
- #include <unistd.h>
- #include <time.h>
- #include <errno.h>
- @@ -68,8 +67,6 @@
- #include <stdint.h>
- #include <endian.h>
-
- -#include <asm/types.h>
- -
- /* In earlier versions, an own llseek() was used, but glibc lseek() is
- * sufficient (or even better :) for 64 bit offsets in the meantime */
- #define llseek lseek
- @@ -148,72 +145,72 @@ static inline int cdiv(int a, int b)
- * alignments */
-
- struct msdos_volume_info {
- - __u8 drive_number; /* BIOS drive number */
- - __u8 RESERVED; /* Unused */
- - __u8 ext_boot_sign; /* 0x29 if fields below exist (DOS 3.3+) */
- - __u8 volume_id[4]; /* Volume ID number */
- - __u8 volume_label[11]; /* Volume label */
- - __u8 fs_type[8]; /* Typically FAT12 or FAT16 */
- + uint8_t drive_number; /* BIOS drive number */
- + uint8_t RESERVED; /* Unused */
- + uint8_t ext_boot_sign; /* 0x29 if fields below exist (DOS 3.3+) */
- + uint8_t volume_id[4]; /* Volume ID number */
- + uint8_t volume_label[11]; /* Volume label */
- + uint8_t fs_type[8]; /* Typically FAT12 or FAT16 */
- } __attribute__ ((packed));
-
- struct msdos_boot_sector {
- - __u8 boot_jump[3]; /* Boot strap short or near jump */
- - __u8 system_id[8]; /* Name - can be used to special case
- + uint8_t boot_jump[3]; /* Boot strap short or near jump */
- + uint8_t system_id[8]; /* Name - can be used to special case
- partition manager volumes */
- - __u8 sector_size[2]; /* bytes per logical sector */
- - __u8 cluster_size; /* sectors/cluster */
- - __u16 reserved; /* reserved sectors */
- - __u8 fats; /* number of FATs */
- - __u8 dir_entries[2]; /* root directory entries */
- - __u8 sectors[2]; /* number of sectors */
- - __u8 media; /* media code (unused) */
- - __u16 fat_length; /* sectors/FAT */
- - __u16 secs_track; /* sectors per track */
- - __u16 heads; /* number of heads */
- - __u32 hidden; /* hidden sectors (unused) */
- - __u32 total_sect; /* number of sectors (if sectors == 0) */
- + uint8_t sector_size[2]; /* bytes per logical sector */
- + uint8_t cluster_size; /* sectors/cluster */
- + uint16_t reserved; /* reserved sectors */
- + uint8_t fats; /* number of FATs */
- + uint8_t dir_entries[2]; /* root directory entries */
- + uint8_t sectors[2]; /* number of sectors */
- + uint8_t media; /* media code (unused) */
- + uint16_t fat_length; /* sectors/FAT */
- + uint16_t secs_track; /* sectors per track */
- + uint16_t heads; /* number of heads */
- + uint32_t hidden; /* hidden sectors (unused) */
- + uint32_t total_sect; /* number of sectors (if sectors == 0) */
- union {
- struct {
- struct msdos_volume_info vi;
- - __u8 boot_code[BOOTCODE_SIZE];
- + uint8_t boot_code[BOOTCODE_SIZE];
- } __attribute__ ((packed)) _oldfat;
- struct {
- - __u32 fat32_length; /* sectors/FAT */
- - __u16 flags; /* bit 8: fat mirroring, low 4: active fat */
- - __u8 version[2]; /* major, minor filesystem version */
- - __u32 root_cluster; /* first cluster in root directory */
- - __u16 info_sector; /* filesystem info sector */
- - __u16 backup_boot; /* backup boot sector */
- - __u16 reserved2[6]; /* Unused */
- + uint32_t fat32_length; /* sectors/FAT */
- + uint16_t flags; /* bit 8: fat mirroring, low 4: active fat */
- + uint8_t version[2]; /* major, minor filesystem version */
- + uint32_t root_cluster; /* first cluster in root directory */
- + uint16_t info_sector; /* filesystem info sector */
- + uint16_t backup_boot; /* backup boot sector */
- + uint16_t reserved2[6]; /* Unused */
- struct msdos_volume_info vi;
- - __u8 boot_code[BOOTCODE_FAT32_SIZE];
- + uint8_t boot_code[BOOTCODE_FAT32_SIZE];
- } __attribute__ ((packed)) _fat32;
- } __attribute__ ((packed)) fstype;
- - __u16 boot_sign;
- + uint16_t boot_sign;
- } __attribute__ ((packed));
- #define fat32 fstype._fat32
- #define oldfat fstype._oldfat
-
- struct fat32_fsinfo {
- - __u32 reserved1; /* Nothing as far as I can tell */
- - __u32 signature; /* 0x61417272L */
- - __u32 free_clusters; /* Free cluster count. -1 if unknown */
- - __u32 next_cluster; /* Most recently allocated cluster.
- + uint32_t reserved1; /* Nothing as far as I can tell */
- + uint32_t signature; /* 0x61417272L */
- + uint32_t free_clusters; /* Free cluster count. -1 if unknown */
- + uint32_t next_cluster; /* Most recently allocated cluster.
- * Unused under Linux. */
- - __u32 reserved2[4];
- + uint32_t reserved2[4];
- };
-
- struct msdos_dir_entry {
- char name[8], ext[3]; /* name and extension */
- - __u8 attr; /* attribute bits */
- - __u8 lcase; /* Case for base and extension */
- - __u8 ctime_ms; /* Creation time, milliseconds */
- - __u16 ctime; /* Creation time */
- - __u16 cdate; /* Creation date */
- - __u16 adate; /* Last access date */
- - __u16 starthi; /* high 16 bits of first cl. (FAT32) */
- - __u16 time, date, start; /* time, date and first cluster */
- - __u32 size; /* file size (in bytes) */
- + uint8_t attr; /* attribute bits */
- + uint8_t lcase; /* Case for base and extension */
- + uint8_t ctime_ms; /* Creation time, milliseconds */
- + uint16_t ctime; /* Creation time */
- + uint16_t cdate; /* Creation date */
- + uint16_t adate; /* Last access date */
- + uint16_t starthi; /* high 16 bits of first cl. (FAT32) */
- + uint16_t time, date, start; /* time, date and first cluster */
- + uint32_t size; /* file size (in bytes) */
- } __attribute__ ((packed));
-
- /* The "boot code" we put into the filesystem... it writes a message and
- @@ -826,7 +823,7 @@ static void setup_tables(void)
- bs.hidden = htole32(hidden_sectors);
- else {
- /* In Atari format, hidden is a 16 bit field */
- - __u16 hidden = htole16(hidden_sectors);
- + uint16_t hidden = htole16(hidden_sectors);
- if (hidden_sectors & ~0xffff)
- die("#hidden doesn't fit in 16bit field of Atari format\n");
- memcpy(&bs.hidden, &hidden, 2);
- @@ -1279,7 +1276,7 @@ static void setup_tables(void)
- info->next_cluster = htole32(2);
-
- /* Info sector also must have boot sign */
- - *(__u16 *) (info_sector + 0x1fe) = htole16(BOOT_SIGN);
- + *(uint16_t *) (info_sector + 0x1fe) = htole16(BOOT_SIGN);
- }
-
- if (!(blank_sector = malloc(sector_size)))
- --
- 1.9.1
|