0010-Remove-non-standard-int-types.patch 20 KB

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