dosfstools: switch back to release tarballs, update patches to the latest sent upstream
[openwrt.git] / tools / dosfstools / patches / 0010-Remove-non-standard-int-types.patch
1 From 245d0cce5e77d7465d61bfde91bc79477d5e6fd6 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= <noltari@gmail.com>
3 Date: Thu, 26 Feb 2015 19:22:54 +0100
4 Subject: [PATCH 10/14] Remove non standard int types
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
10 Signed-off-by: Andreas Bombe <aeb@debian.org>
11 ---
12  src/boot.c     |  16 +++----
13  src/common.h   |   2 -
14  src/file.c     |   2 -
15  src/fsck.fat.h | 148 ++++++++++++++++++++++++++++-----------------------------
16  src/io.c       |   1 -
17  src/lfn.c      |  23 ++++-----
18  src/mkfs.fat.c |  95 ++++++++++++++++++------------------
19  7 files changed, 138 insertions(+), 149 deletions(-)
20
21 diff --git a/src/boot.c b/src/boot.c
22 index be7bfb7..0c0918f 100644
23 --- a/src/boot.c
24 +++ b/src/boot.c
25 @@ -25,8 +25,8 @@
26   * by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
27  
28  #include <stdio.h>
29 +#include <stdint.h>
30  #include <string.h>
31 -#include <sys/types.h>
32  #include <stdlib.h>
33  #include <time.h>
34  
35 @@ -45,7 +45,7 @@
36  #define FAT16_THRESHOLD 65525
37  
38  static struct {
39 -    __u8 media;
40 +    uint8_t media;
41      const char *descr;
42  } mediabytes[] = {
43      {
44 @@ -62,7 +62,7 @@ static struct {
45  
46  /* Unaligned fields must first be accessed byte-wise */
47  #define GET_UNALIGNED_W(f)                     \
48 -    ( (__u16)f[0] | ((__u16)f[1]<<8) )
49 +    ( (uint16_t)f[0] | ((uint16_t)f[1]<<8) )
50  
51  static const char *get_media_descr(unsigned char media)
52  {
53 @@ -166,18 +166,18 @@ static void check_backup_boot(DOS_FS * fs, struct boot_sector *b, int lss)
54      fs_read(fs->backupboot_start, sizeof(b2), &b2);
55      if (memcmp(b, &b2, sizeof(b2)) != 0) {
56         /* there are any differences */
57 -       __u8 *p, *q;
58 +       uint8_t *p, *q;
59         int i, pos, first = 1;
60         char buf[20];
61  
62         printf("There are differences between boot sector and its backup.\n");
63         printf("This is mostly harmless. Differences: (offset:original/backup)\n  ");
64         pos = 2;
65 -       for (p = (__u8 *) b, q = (__u8 *) & b2, i = 0; i < sizeof(b2);
66 +       for (p = (uint8_t *) b, q = (uint8_t *) & b2, i = 0; i < sizeof(b2);
67              ++p, ++q, ++i) {
68             if (*p != *q) {
69                 sprintf(buf, "%s%u:%02x/%02x", first ? "" : ", ",
70 -                       (unsigned)(p - (__u8 *) b), *p, *q);
71 +                       (unsigned)(p - (uint8_t *) b), *p, *q);
72                 if (pos + strlen(buf) > 78)
73                     printf("\n  "), pos = 2;
74                 printf("%s", buf);
75 @@ -227,7 +227,7 @@ static void read_fsinfo(DOS_FS * fs, struct boot_sector *b, int lss)
76         if (interactive && get_key("12", "?") == '1') {
77             /* search for a free reserved sector (not boot sector and not
78              * backup boot sector) */
79 -           __u32 s;
80 +           uint32_t s;
81             for (s = 1; s < le16toh(b->reserved); ++s)
82                 if (s != le16toh(b->backup_boot))
83                     break;
84 @@ -425,7 +425,7 @@ void read_boot(DOS_FS * fs)
85      fs->eff_fat_bits = (fs->fat_bits == 32) ? 28 : fs->fat_bits;
86      fs->fat_size = fat_length * logical_sector_size;
87  
88 -    fs->label = calloc(12, sizeof(__u8));
89 +    fs->label = calloc(12, sizeof(uint8_t));
90      if (fs->fat_bits == 12 || fs->fat_bits == 16) {
91         struct boot_sector_16 *b16 = (struct boot_sector_16 *)&b;
92         if (b16->extended_sig == 0x29)
93 diff --git a/src/common.h b/src/common.h
94 index b127f63..c15efb5 100644
95 --- a/src/common.h
96 +++ b/src/common.h
97 @@ -20,8 +20,6 @@
98     can be found in /usr/share/common-licenses/GPL-3 file.
99  */
100  
101 -#include <asm/types.h>
102 -
103  #ifndef _COMMON_H
104  #define _COMMON_H
105  
106 diff --git a/src/file.c b/src/file.c
107 index 30adcde..0b53840 100644
108 --- a/src/file.c
109 +++ b/src/file.c
110 @@ -34,8 +34,6 @@
111  #define _LINUX_STRING_H_       /* hack to avoid inclusion of <linux/string.h> */
112  #define _LINUX_FS_H            /* hack to avoid inclusion of <linux/fs.h> */
113  
114 -#include <asm/types.h>
115 -
116  #include <linux/msdos_fs.h>
117  
118  #include "common.h"
119 diff --git a/src/fsck.fat.h b/src/fsck.fat.h
120 index e5ade5b..27e9d52 100644
121 --- a/src/fsck.fat.h
122 +++ b/src/fsck.fat.h
123 @@ -28,14 +28,10 @@
124  #define _DOSFSCK_H
125  
126  #include <fcntl.h>
127 -#include <sys/types.h>
128  #define _LINUX_STAT_H          /* hack to avoid inclusion of <linux/stat.h> */
129  #define _LINUX_STRING_H_       /* hack to avoid inclusion of <linux/string.h> */
130  #define _LINUX_FS_H            /* hack to avoid inclusion of <linux/fs.h> */
131  
132 -#include <asm/types.h>
133 -#include <asm/byteorder.h>
134 -
135  #include <linux/msdos_fs.h>
136  
137  #include <stddef.h>
138 @@ -49,95 +45,95 @@
139  /* ++roman: Use own definition of boot sector structure -- the kernel headers'
140   * name for it is msdos_boot_sector in 2.0 and fat_boot_sector in 2.1 ... */
141  struct boot_sector {
142 -    __u8 ignored[3];           /* Boot strap short or near jump */
143 -    __u8 system_id[8];         /* Name - can be used to special case
144 +    uint8_t ignored[3];                /* Boot strap short or near jump */
145 +    uint8_t system_id[8];      /* Name - can be used to special case
146                                    partition manager volumes */
147 -    __u8 sector_size[2];       /* bytes per logical sector */
148 -    __u8 cluster_size;         /* sectors/cluster */
149 -    __u16 reserved;            /* reserved sectors */
150 -    __u8 fats;                 /* number of FATs */
151 -    __u8 dir_entries[2];       /* root directory entries */
152 -    __u8 sectors[2];           /* number of sectors */
153 -    __u8 media;                        /* media code (unused) */
154 -    __u16 fat_length;          /* sectors/FAT */
155 -    __u16 secs_track;          /* sectors per track */
156 -    __u16 heads;               /* number of heads */
157 -    __u32 hidden;              /* hidden sectors (unused) */
158 -    __u32 total_sect;          /* number of sectors (if sectors == 0) */
159 +    uint8_t sector_size[2];    /* bytes per logical sector */
160 +    uint8_t cluster_size;      /* sectors/cluster */
161 +    uint16_t reserved;         /* reserved sectors */
162 +    uint8_t fats;              /* number of FATs */
163 +    uint8_t dir_entries[2];    /* root directory entries */
164 +    uint8_t sectors[2];                /* number of sectors */
165 +    uint8_t media;             /* media code (unused) */
166 +    uint16_t fat_length;       /* sectors/FAT */
167 +    uint16_t secs_track;       /* sectors per track */
168 +    uint16_t heads;            /* number of heads */
169 +    uint32_t hidden;           /* hidden sectors (unused) */
170 +    uint32_t total_sect;       /* number of sectors (if sectors == 0) */
171  
172      /* The following fields are only used by FAT32 */
173 -    __u32 fat32_length;                /* sectors/FAT */
174 -    __u16 flags;               /* bit 8: fat mirroring, low 4: active fat */
175 -    __u8 version[2];           /* major, minor filesystem version */
176 -    __u32 root_cluster;                /* first cluster in root directory */
177 -    __u16 info_sector;         /* filesystem info sector */
178 -    __u16 backup_boot;         /* backup boot sector */
179 -    __u8 reserved2[12];                /* Unused */
180 -
181 -    __u8 drive_number;         /* Logical Drive Number */
182 -    __u8 reserved3;            /* Unused */
183 -
184 -    __u8 extended_sig;         /* Extended Signature (0x29) */
185 -    __u32 serial;              /* Serial number */
186 -    __u8 label[11];            /* FS label */
187 -    __u8 fs_type[8];           /* FS Type */
188 +    uint32_t fat32_length;     /* sectors/FAT */
189 +    uint16_t flags;            /* bit 8: fat mirroring, low 4: active fat */
190 +    uint8_t version[2];                /* major, minor filesystem version */
191 +    uint32_t root_cluster;     /* first cluster in root directory */
192 +    uint16_t info_sector;      /* filesystem info sector */
193 +    uint16_t backup_boot;      /* backup boot sector */
194 +    uint8_t reserved2[12];     /* Unused */
195 +
196 +    uint8_t drive_number;      /* Logical Drive Number */
197 +    uint8_t reserved3;         /* Unused */
198 +
199 +    uint8_t extended_sig;      /* Extended Signature (0x29) */
200 +    uint32_t serial;           /* Serial number */
201 +    uint8_t label[11];         /* FS label */
202 +    uint8_t fs_type[8];                /* FS Type */
203  
204      /* fill up to 512 bytes */
205 -    __u8 junk[422];
206 +    uint8_t junk[422];
207  } __attribute__ ((packed));
208  
209  struct boot_sector_16 {
210 -    __u8 ignored[3];           /* Boot strap short or near jump */
211 -    __u8 system_id[8];         /* Name - can be used to special case
212 +    uint8_t ignored[3];                /* Boot strap short or near jump */
213 +    uint8_t system_id[8];      /* Name - can be used to special case
214                                    partition manager volumes */
215 -    __u8 sector_size[2];       /* bytes per logical sector */
216 -    __u8 cluster_size;         /* sectors/cluster */
217 -    __u16 reserved;            /* reserved sectors */
218 -    __u8 fats;                 /* number of FATs */
219 -    __u8 dir_entries[2];       /* root directory entries */
220 -    __u8 sectors[2];           /* number of sectors */
221 -    __u8 media;                        /* media code (unused) */
222 -    __u16 fat_length;          /* sectors/FAT */
223 -    __u16 secs_track;          /* sectors per track */
224 -    __u16 heads;               /* number of heads */
225 -    __u32 hidden;              /* hidden sectors (unused) */
226 -    __u32 total_sect;          /* number of sectors (if sectors == 0) */
227 -
228 -    __u8 drive_number;         /* Logical Drive Number */
229 -    __u8 reserved2;            /* Unused */
230 -
231 -    __u8 extended_sig;         /* Extended Signature (0x29) */
232 -    __u32 serial;              /* Serial number */
233 -    __u8 label[11];            /* FS label */
234 -    __u8 fs_type[8];           /* FS Type */
235 +    uint8_t sector_size[2];    /* bytes per logical sector */
236 +    uint8_t cluster_size;      /* sectors/cluster */
237 +    uint16_t reserved;         /* reserved sectors */
238 +    uint8_t fats;              /* number of FATs */
239 +    uint8_t dir_entries[2];    /* root directory entries */
240 +    uint8_t sectors[2];                /* number of sectors */
241 +    uint8_t media;             /* media code (unused) */
242 +    uint16_t fat_length;       /* sectors/FAT */
243 +    uint16_t secs_track;       /* sectors per track */
244 +    uint16_t heads;            /* number of heads */
245 +    uint32_t hidden;           /* hidden sectors (unused) */
246 +    uint32_t total_sect;       /* number of sectors (if sectors == 0) */
247 +
248 +    uint8_t drive_number;      /* Logical Drive Number */
249 +    uint8_t reserved2;         /* Unused */
250 +
251 +    uint8_t extended_sig;      /* Extended Signature (0x29) */
252 +    uint32_t serial;           /* Serial number */
253 +    uint8_t label[11];         /* FS label */
254 +    uint8_t fs_type[8];                /* FS Type */
255  
256      /* fill up to 512 bytes */
257 -    __u8 junk[450];
258 +    uint8_t junk[450];
259  } __attribute__ ((packed));
260  
261  struct info_sector {
262 -    __u32 magic;               /* Magic for info sector ('RRaA') */
263 -    __u8 junk[0x1dc];
264 -    __u32 reserved1;           /* Nothing as far as I can tell */
265 -    __u32 signature;           /* 0x61417272 ('rrAa') */
266 -    __u32 free_clusters;       /* Free cluster count.  -1 if unknown */
267 -    __u32 next_cluster;                /* Most recently allocated cluster. */
268 -    __u32 reserved2[3];
269 -    __u16 reserved3;
270 -    __u16 boot_sign;
271 +    uint32_t magic;            /* Magic for info sector ('RRaA') */
272 +    uint8_t junk[0x1dc];
273 +    uint32_t reserved1;                /* Nothing as far as I can tell */
274 +    uint32_t signature;                /* 0x61417272 ('rrAa') */
275 +    uint32_t free_clusters;    /* Free cluster count.  -1 if unknown */
276 +    uint32_t next_cluster;     /* Most recently allocated cluster. */
277 +    uint32_t reserved2[3];
278 +    uint16_t reserved3;
279 +    uint16_t boot_sign;
280  };
281  
282  typedef struct {
283 -    __u8 name[8], ext[3];      /* name and extension */
284 -    __u8 attr;                 /* attribute bits */
285 -    __u8 lcase;                        /* Case for base and extension */
286 -    __u8 ctime_ms;             /* Creation time, milliseconds */
287 -    __u16 ctime;               /* Creation time */
288 -    __u16 cdate;               /* Creation date */
289 -    __u16 adate;               /* Last access date */
290 -    __u16 starthi;             /* High 16 bits of cluster in FAT32 */
291 -    __u16 time, date, start;   /* time, date and first cluster */
292 -    __u32 size;                        /* file size (in bytes) */
293 +    uint8_t name[8], ext[3];   /* name and extension */
294 +    uint8_t attr;              /* attribute bits */
295 +    uint8_t lcase;             /* Case for base and extension */
296 +    uint8_t ctime_ms;          /* Creation time, milliseconds */
297 +    uint16_t ctime;            /* Creation time */
298 +    uint16_t cdate;            /* Creation date */
299 +    uint16_t adate;            /* Last access date */
300 +    uint16_t starthi;          /* High 16 bits of cluster in FAT32 */
301 +    uint16_t time, date, start;        /* time, date and first cluster */
302 +    uint32_t size;             /* file size (in bytes) */
303  } __attribute__ ((packed)) DIR_ENT;
304  
305  typedef struct _dos_file {
306 diff --git a/src/io.c b/src/io.c
307 index 3755ba5..450432c 100644
308 --- a/src/io.c
309 +++ b/src/io.c
310 @@ -31,7 +31,6 @@
311   * by Roman Hodek <Roman.Hodek@informatik.uni-erlangen.de> */
312  
313  #define _LARGEFILE64_SOURCE
314 -#include <sys/types.h>
315  #include <stdlib.h>
316  #include <stdio.h>
317  #include <string.h>
318 diff --git a/src/lfn.c b/src/lfn.c
319 index 2e60198..2601172 100644
320 --- a/src/lfn.c
321 +++ b/src/lfn.c
322 @@ -21,6 +21,7 @@
323  */
324  
325  #include <stdio.h>
326 +#include <stdint.h>
327  #include <stdlib.h>
328  #include <string.h>
329  #include <limits.h>
330 @@ -33,14 +34,14 @@
331  #include "file.h"
332  
333  typedef struct {
334 -    __u8 id;                   /* sequence number for slot */
335 -    __u8 name0_4[10];          /* first 5 characters in name */
336 -    __u8 attr;                 /* attribute byte */
337 -    __u8 reserved;             /* always 0 */
338 -    __u8 alias_checksum;       /* checksum for 8.3 alias */
339 -    __u8 name5_10[12];         /* 6 more characters in name */
340 -    __u16 start;               /* starting cluster number, 0 in long slots */
341 -    __u8 name11_12[4];         /* last 2 characters in name */
342 +    uint8_t id;                        /* sequence number for slot */
343 +    uint8_t name0_4[10];       /* first 5 characters in name */
344 +    uint8_t attr;              /* attribute byte */
345 +    uint8_t reserved;          /* always 0 */
346 +    uint8_t alias_checksum;    /* checksum for 8.3 alias */
347 +    uint8_t name5_10[12];      /* 6 more characters in name */
348 +    uint16_t start;            /* starting cluster number, 0 in long slots */
349 +    uint8_t name11_12[4];      /* last 2 characters in name */
350  } LFN_ENT;
351  
352  #define LFN_ID_START   0x40
353 @@ -173,7 +174,7 @@ static void clear_lfn_slots(int start, int end)
354  void lfn_fix_checksum(loff_t from, loff_t to, const char *short_name)
355  {
356      int i;
357 -    __u8 sum;
358 +    uint8_t sum;
359      for (sum = 0, i = 0; i < 11; i++)
360         sum = (((sum & 1) << 7) | ((sum & 0xfe) >> 1)) + short_name[i];
361  
362 @@ -409,7 +410,7 @@ void lfn_add_slot(DIR_ENT * de, loff_t dir_offset)
363  char *lfn_get(DIR_ENT * de, loff_t * lfn_offset)
364  {
365      char *lfn;
366 -    __u8 sum;
367 +    uint8_t sum;
368      int i;
369  
370      *lfn_offset = 0;
371 @@ -453,7 +454,7 @@ char *lfn_get(DIR_ENT * de, loff_t * lfn_offset)
372             return NULL;
373         case '3':
374             for (i = 0; i < lfn_parts; ++i) {
375 -               __u8 id = (lfn_parts - i) | (i == 0 ? LFN_ID_START : 0);
376 +               uint8_t id = (lfn_parts - i) | (i == 0 ? LFN_ID_START : 0);
377                 fs_write(lfn_offsets[i] + offsetof(LFN_ENT, id),
378                          sizeof(id), &id);
379             }
380 diff --git a/src/mkfs.fat.c b/src/mkfs.fat.c
381 index e6f9390..3d1512f 100644
382 --- a/src/mkfs.fat.c
383 +++ b/src/mkfs.fat.c
384 @@ -60,7 +60,6 @@
385  #include <sys/ioctl.h>
386  #include <sys/stat.h>
387  #include <sys/time.h>
388 -#include <sys/types.h>
389  #include <unistd.h>
390  #include <time.h>
391  #include <errno.h>
392 @@ -68,8 +67,6 @@
393  #include <stdint.h>
394  #include <endian.h>
395  
396 -#include <asm/types.h>
397 -
398  /* In earlier versions, an own llseek() was used, but glibc lseek() is
399   * sufficient (or even better :) for 64 bit offsets in the meantime */
400  #define llseek lseek
401 @@ -148,72 +145,72 @@ static inline int cdiv(int a, int b)
402   * alignments */
403  
404  struct msdos_volume_info {
405 -    __u8 drive_number;         /* BIOS drive number */
406 -    __u8 RESERVED;             /* Unused */
407 -    __u8 ext_boot_sign;                /* 0x29 if fields below exist (DOS 3.3+) */
408 -    __u8 volume_id[4];         /* Volume ID number */
409 -    __u8 volume_label[11];     /* Volume label */
410 -    __u8 fs_type[8];           /* Typically FAT12 or FAT16 */
411 +    uint8_t drive_number;      /* BIOS drive number */
412 +    uint8_t RESERVED;          /* Unused */
413 +    uint8_t ext_boot_sign;     /* 0x29 if fields below exist (DOS 3.3+) */
414 +    uint8_t volume_id[4];      /* Volume ID number */
415 +    uint8_t volume_label[11];  /* Volume label */
416 +    uint8_t fs_type[8];                /* Typically FAT12 or FAT16 */
417  } __attribute__ ((packed));
418  
419  struct msdos_boot_sector {
420 -    __u8 boot_jump[3];         /* Boot strap short or near jump */
421 -    __u8 system_id[8];         /* Name - can be used to special case
422 +    uint8_t boot_jump[3];      /* Boot strap short or near jump */
423 +    uint8_t system_id[8];      /* Name - can be used to special case
424                                    partition manager volumes */
425 -    __u8 sector_size[2];       /* bytes per logical sector */
426 -    __u8 cluster_size;         /* sectors/cluster */
427 -    __u16 reserved;            /* reserved sectors */
428 -    __u8 fats;                 /* number of FATs */
429 -    __u8 dir_entries[2];       /* root directory entries */
430 -    __u8 sectors[2];           /* number of sectors */
431 -    __u8 media;                        /* media code (unused) */
432 -    __u16 fat_length;          /* sectors/FAT */
433 -    __u16 secs_track;          /* sectors per track */
434 -    __u16 heads;               /* number of heads */
435 -    __u32 hidden;              /* hidden sectors (unused) */
436 -    __u32 total_sect;          /* number of sectors (if sectors == 0) */
437 +    uint8_t sector_size[2];    /* bytes per logical sector */
438 +    uint8_t cluster_size;      /* sectors/cluster */
439 +    uint16_t reserved;         /* reserved sectors */
440 +    uint8_t fats;              /* number of FATs */
441 +    uint8_t dir_entries[2];    /* root directory entries */
442 +    uint8_t sectors[2];                /* number of sectors */
443 +    uint8_t media;             /* media code (unused) */
444 +    uint16_t fat_length;       /* sectors/FAT */
445 +    uint16_t secs_track;       /* sectors per track */
446 +    uint16_t heads;            /* number of heads */
447 +    uint32_t hidden;           /* hidden sectors (unused) */
448 +    uint32_t total_sect;       /* number of sectors (if sectors == 0) */
449      union {
450         struct {
451             struct msdos_volume_info vi;
452 -           __u8 boot_code[BOOTCODE_SIZE];
453 +           uint8_t boot_code[BOOTCODE_SIZE];
454         } __attribute__ ((packed)) _oldfat;
455         struct {
456 -           __u32 fat32_length; /* sectors/FAT */
457 -           __u16 flags;        /* bit 8: fat mirroring, low 4: active fat */
458 -           __u8 version[2];    /* major, minor filesystem version */
459 -           __u32 root_cluster; /* first cluster in root directory */
460 -           __u16 info_sector;  /* filesystem info sector */
461 -           __u16 backup_boot;  /* backup boot sector */
462 -           __u16 reserved2[6]; /* Unused */
463 +           uint32_t fat32_length;      /* sectors/FAT */
464 +           uint16_t flags;             /* bit 8: fat mirroring, low 4: active fat */
465 +           uint8_t version[2];         /* major, minor filesystem version */
466 +           uint32_t root_cluster;      /* first cluster in root directory */
467 +           uint16_t info_sector;       /* filesystem info sector */
468 +           uint16_t backup_boot;       /* backup boot sector */
469 +           uint16_t reserved2[6];      /* Unused */
470             struct msdos_volume_info vi;
471 -           __u8 boot_code[BOOTCODE_FAT32_SIZE];
472 +           uint8_t boot_code[BOOTCODE_FAT32_SIZE];
473         } __attribute__ ((packed)) _fat32;
474      } __attribute__ ((packed)) fstype;
475 -    __u16 boot_sign;
476 +    uint16_t boot_sign;
477  } __attribute__ ((packed));
478  #define fat32  fstype._fat32
479  #define oldfat fstype._oldfat
480  
481  struct fat32_fsinfo {
482 -    __u32 reserved1;           /* Nothing as far as I can tell */
483 -    __u32 signature;           /* 0x61417272L */
484 -    __u32 free_clusters;       /* Free cluster count.  -1 if unknown */
485 -    __u32 next_cluster;                /* Most recently allocated cluster.
486 +    uint32_t reserved1;                /* Nothing as far as I can tell */
487 +    uint32_t signature;                /* 0x61417272L */
488 +    uint32_t free_clusters;    /* Free cluster count.  -1 if unknown */
489 +    uint32_t next_cluster;     /* Most recently allocated cluster.
490                                  * Unused under Linux. */
491 -    __u32 reserved2[4];
492 +    uint32_t reserved2[4];
493  };
494  
495  struct msdos_dir_entry {
496      char name[8], ext[3];      /* name and extension */
497 -    __u8 attr;                 /* attribute bits */
498 -    __u8 lcase;                        /* Case for base and extension */
499 -    __u8 ctime_ms;             /* Creation time, milliseconds */
500 -    __u16 ctime;               /* Creation time */
501 -    __u16 cdate;               /* Creation date */
502 -    __u16 adate;               /* Last access date */
503 -    __u16 starthi;             /* high 16 bits of first cl. (FAT32) */
504 -    __u16 time, date, start;   /* time, date and first cluster */
505 -    __u32 size;                        /* file size (in bytes) */
506 +    uint8_t attr;              /* attribute bits */
507 +    uint8_t lcase;             /* Case for base and extension */
508 +    uint8_t ctime_ms;          /* Creation time, milliseconds */
509 +    uint16_t ctime;            /* Creation time */
510 +    uint16_t cdate;            /* Creation date */
511 +    uint16_t adate;            /* Last access date */
512 +    uint16_t starthi;          /* high 16 bits of first cl. (FAT32) */
513 +    uint16_t time, date, start;        /* time, date and first cluster */
514 +    uint32_t size;             /* file size (in bytes) */
515  } __attribute__ ((packed));
516  
517  /* The "boot code" we put into the filesystem... it writes a message and
518 @@ -826,7 +823,7 @@ static void setup_tables(void)
519         bs.hidden = htole32(hidden_sectors);
520      else {
521         /* In Atari format, hidden is a 16 bit field */
522 -       __u16 hidden = htole16(hidden_sectors);
523 +       uint16_t hidden = htole16(hidden_sectors);
524         if (hidden_sectors & ~0xffff)
525             die("#hidden doesn't fit in 16bit field of Atari format\n");
526         memcpy(&bs.hidden, &hidden, 2);
527 @@ -1279,7 +1276,7 @@ static void setup_tables(void)
528         info->next_cluster = htole32(2);
529  
530         /* Info sector also must have boot sign */
531 -       *(__u16 *) (info_sector + 0x1fe) = htole16(BOOT_SIGN);
532 +       *(uint16_t *) (info_sector + 0x1fe) = htole16(BOOT_SIGN);
533      }
534  
535      if (!(blank_sector = malloc(sector_size)))
536 -- 
537 1.9.1
538