From: Eric Andersen Date: Mon, 3 Sep 2001 19:34:29 +0000 (-0000) Subject: Patch from Laurence Anderson to use more standard typing X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2fd475509ac3bba217e3aee3766de089336aecdb;p=oweals%2Fbusybox.git Patch from Laurence Anderson to use more standard typing --- diff --git a/busybox/archival/rpm2cpio.c b/busybox/archival/rpm2cpio.c index 45c3ffb17..8d639d6ad 100644 --- a/busybox/archival/rpm2cpio.c +++ b/busybox/archival/rpm2cpio.c @@ -26,27 +26,23 @@ #define RPM_MAGIC "\355\253\356\333" #define RPM_HEADER_MAGIC "\216\255\350" -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; - struct rpm_lead { unsigned char magic[4]; - u8 major, minor; - u16 type; - u16 archnum; + u_int8_t major, minor; + u_int16_t type; + u_int16_t archnum; char name[66]; - u16 osnum; - u16 signature_type; + u_int16_t osnum; + u_int16_t signature_type; char reserved[16]; }; struct rpm_header { char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */ - u8 version; /* 1 byte version number */ - u32 reserved; /* 4 bytes reserved */ - u32 entries; /* Number of entries in header (4 bytes) */ - u32 size; /* Size of store (4 bytes) */ + u_int8_t version; /* 1 byte version number */ + u_int32_t reserved; /* 4 bytes reserved */ + u_int32_t entries; /* Number of entries in header (4 bytes) */ + u_int32_t size; /* Size of store (4 bytes) */ }; void skip_header(FILE *rpmfile) diff --git a/busybox/fbset.c b/busybox/fbset.c index 41c7f9796..5ccd80e79 100644 --- a/busybox/fbset.c +++ b/busybox/fbset.c @@ -85,7 +85,7 @@ static unsigned int g_options = 0; /* Stuff stolen from the kernel's fb.h */ static const int FBIOGET_VSCREENINFO = 0x4600; static const int FBIOPUT_VSCREENINFO = 0x4601; -#define __u32 unsigned int +#define __u32 u_int32_t struct fb_bitfield { __u32 offset; /* beginning of bitfield */ __u32 length; /* length of bitfield */ diff --git a/busybox/fsck_minix.c b/busybox/fsck_minix.c index a2421fc34..952968d85 100644 --- a/busybox/fsck_minix.c +++ b/busybox/fsck_minix.c @@ -98,12 +98,6 @@ #include #include "busybox.h" - - typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; - - static const int MINIX_ROOT_INO = 1; static const int MINIX_LINK_MAX = 250; static const int MINIX2_LINK_MAX = 65530; @@ -130,13 +124,13 @@ static const int MINIX_V2 = 0x0002; /* minix V2 fs */ * Note the 8-bit gid and atime and ctime. */ struct minix_inode { - u16 i_mode; - u16 i_uid; - u32 i_size; - u32 i_time; - u8 i_gid; - u8 i_nlinks; - u16 i_zone[9]; + u_int16_t i_mode; + u_int16_t i_uid; + u_int32_t i_size; + u_int32_t i_time; + u_int8_t i_gid; + u_int8_t i_nlinks; + u_int16_t i_zone[9]; }; /* @@ -146,35 +140,35 @@ struct minix_inode { * now 16-bit. The inode is now 64 bytes instead of 32. */ struct minix2_inode { - u16 i_mode; - u16 i_nlinks; - u16 i_uid; - u16 i_gid; - u32 i_size; - u32 i_atime; - u32 i_mtime; - u32 i_ctime; - u32 i_zone[10]; + u_int16_t i_mode; + u_int16_t i_nlinks; + u_int16_t i_uid; + u_int16_t i_gid; + u_int32_t i_size; + u_int32_t i_atime; + u_int32_t i_mtime; + u_int32_t i_ctime; + u_int32_t i_zone[10]; }; /* * minix super-block data on disk */ struct minix_super_block { - u16 s_ninodes; - u16 s_nzones; - u16 s_imap_blocks; - u16 s_zmap_blocks; - u16 s_firstdatazone; - u16 s_log_zone_size; - u32 s_max_size; - u16 s_magic; - u16 s_state; - u32 s_zones; + u_int16_t s_ninodes; + u_int16_t s_nzones; + u_int16_t s_imap_blocks; + u_int16_t s_zmap_blocks; + u_int16_t s_firstdatazone; + u_int16_t s_log_zone_size; + u_int32_t s_max_size; + u_int16_t s_magic; + u_int16_t s_state; + u_int32_t s_zones; }; struct minix_dir_entry { - u16 inode; + u_int16_t inode; char name[0]; }; diff --git a/busybox/mkfs_minix.c b/busybox/mkfs_minix.c index 70374eae9..ccc0e85d7 100644 --- a/busybox/mkfs_minix.c +++ b/busybox/mkfs_minix.c @@ -76,12 +76,6 @@ #include #include "busybox.h" - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; - - #define MINIX_ROOT_INO 1 #define MINIX_LINK_MAX 250 #define MINIX2_LINK_MAX 65530 @@ -108,13 +102,13 @@ typedef unsigned int u32; * Note the 8-bit gid and atime and ctime. */ struct minix_inode { - u16 i_mode; - u16 i_uid; - u32 i_size; - u32 i_time; - u8 i_gid; - u8 i_nlinks; - u16 i_zone[9]; + u_int16_t i_mode; + u_int16_t i_uid; + u_int32_t i_size; + u_int32_t i_time; + u_int8_t i_gid; + u_int8_t i_nlinks; + u_int16_t i_zone[9]; }; /* @@ -124,35 +118,35 @@ struct minix_inode { * now 16-bit. The inode is now 64 bytes instead of 32. */ struct minix2_inode { - u16 i_mode; - u16 i_nlinks; - u16 i_uid; - u16 i_gid; - u32 i_size; - u32 i_atime; - u32 i_mtime; - u32 i_ctime; - u32 i_zone[10]; + u_int16_t i_mode; + u_int16_t i_nlinks; + u_int16_t i_uid; + u_int16_t i_gid; + u_int32_t i_size; + u_int32_t i_atime; + u_int32_t i_mtime; + u_int32_t i_ctime; + u_int32_t i_zone[10]; }; /* * minix super-block data on disk */ struct minix_super_block { - u16 s_ninodes; - u16 s_nzones; - u16 s_imap_blocks; - u16 s_zmap_blocks; - u16 s_firstdatazone; - u16 s_log_zone_size; - u32 s_max_size; - u16 s_magic; - u16 s_state; - u32 s_zones; + u_int16_t s_ninodes; + u_int16_t s_nzones; + u_int16_t s_imap_blocks; + u_int16_t s_zmap_blocks; + u_int16_t s_firstdatazone; + u_int16_t s_log_zone_size; + u_int32_t s_max_size; + u_int16_t s_magic; + u_int16_t s_state; + u_int32_t s_zones; }; struct minix_dir_entry { - u16 inode; + u_int16_t inode; char name[0]; }; diff --git a/busybox/rpm2cpio.c b/busybox/rpm2cpio.c index 45c3ffb17..8d639d6ad 100644 --- a/busybox/rpm2cpio.c +++ b/busybox/rpm2cpio.c @@ -26,27 +26,23 @@ #define RPM_MAGIC "\355\253\356\333" #define RPM_HEADER_MAGIC "\216\255\350" -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; - struct rpm_lead { unsigned char magic[4]; - u8 major, minor; - u16 type; - u16 archnum; + u_int8_t major, minor; + u_int16_t type; + u_int16_t archnum; char name[66]; - u16 osnum; - u16 signature_type; + u_int16_t osnum; + u_int16_t signature_type; char reserved[16]; }; struct rpm_header { char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */ - u8 version; /* 1 byte version number */ - u32 reserved; /* 4 bytes reserved */ - u32 entries; /* Number of entries in header (4 bytes) */ - u32 size; /* Size of store (4 bytes) */ + u_int8_t version; /* 1 byte version number */ + u_int32_t reserved; /* 4 bytes reserved */ + u_int32_t entries; /* Number of entries in header (4 bytes) */ + u_int32_t size; /* Size of store (4 bytes) */ }; void skip_header(FILE *rpmfile) diff --git a/busybox/util-linux/fbset.c b/busybox/util-linux/fbset.c index 41c7f9796..5ccd80e79 100644 --- a/busybox/util-linux/fbset.c +++ b/busybox/util-linux/fbset.c @@ -85,7 +85,7 @@ static unsigned int g_options = 0; /* Stuff stolen from the kernel's fb.h */ static const int FBIOGET_VSCREENINFO = 0x4600; static const int FBIOPUT_VSCREENINFO = 0x4601; -#define __u32 unsigned int +#define __u32 u_int32_t struct fb_bitfield { __u32 offset; /* beginning of bitfield */ __u32 length; /* length of bitfield */ diff --git a/busybox/util-linux/fsck_minix.c b/busybox/util-linux/fsck_minix.c index a2421fc34..952968d85 100644 --- a/busybox/util-linux/fsck_minix.c +++ b/busybox/util-linux/fsck_minix.c @@ -98,12 +98,6 @@ #include #include "busybox.h" - - typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; - - static const int MINIX_ROOT_INO = 1; static const int MINIX_LINK_MAX = 250; static const int MINIX2_LINK_MAX = 65530; @@ -130,13 +124,13 @@ static const int MINIX_V2 = 0x0002; /* minix V2 fs */ * Note the 8-bit gid and atime and ctime. */ struct minix_inode { - u16 i_mode; - u16 i_uid; - u32 i_size; - u32 i_time; - u8 i_gid; - u8 i_nlinks; - u16 i_zone[9]; + u_int16_t i_mode; + u_int16_t i_uid; + u_int32_t i_size; + u_int32_t i_time; + u_int8_t i_gid; + u_int8_t i_nlinks; + u_int16_t i_zone[9]; }; /* @@ -146,35 +140,35 @@ struct minix_inode { * now 16-bit. The inode is now 64 bytes instead of 32. */ struct minix2_inode { - u16 i_mode; - u16 i_nlinks; - u16 i_uid; - u16 i_gid; - u32 i_size; - u32 i_atime; - u32 i_mtime; - u32 i_ctime; - u32 i_zone[10]; + u_int16_t i_mode; + u_int16_t i_nlinks; + u_int16_t i_uid; + u_int16_t i_gid; + u_int32_t i_size; + u_int32_t i_atime; + u_int32_t i_mtime; + u_int32_t i_ctime; + u_int32_t i_zone[10]; }; /* * minix super-block data on disk */ struct minix_super_block { - u16 s_ninodes; - u16 s_nzones; - u16 s_imap_blocks; - u16 s_zmap_blocks; - u16 s_firstdatazone; - u16 s_log_zone_size; - u32 s_max_size; - u16 s_magic; - u16 s_state; - u32 s_zones; + u_int16_t s_ninodes; + u_int16_t s_nzones; + u_int16_t s_imap_blocks; + u_int16_t s_zmap_blocks; + u_int16_t s_firstdatazone; + u_int16_t s_log_zone_size; + u_int32_t s_max_size; + u_int16_t s_magic; + u_int16_t s_state; + u_int32_t s_zones; }; struct minix_dir_entry { - u16 inode; + u_int16_t inode; char name[0]; }; diff --git a/busybox/util-linux/mkfs_minix.c b/busybox/util-linux/mkfs_minix.c index 70374eae9..ccc0e85d7 100644 --- a/busybox/util-linux/mkfs_minix.c +++ b/busybox/util-linux/mkfs_minix.c @@ -76,12 +76,6 @@ #include #include "busybox.h" - -typedef unsigned char u8; -typedef unsigned short u16; -typedef unsigned int u32; - - #define MINIX_ROOT_INO 1 #define MINIX_LINK_MAX 250 #define MINIX2_LINK_MAX 65530 @@ -108,13 +102,13 @@ typedef unsigned int u32; * Note the 8-bit gid and atime and ctime. */ struct minix_inode { - u16 i_mode; - u16 i_uid; - u32 i_size; - u32 i_time; - u8 i_gid; - u8 i_nlinks; - u16 i_zone[9]; + u_int16_t i_mode; + u_int16_t i_uid; + u_int32_t i_size; + u_int32_t i_time; + u_int8_t i_gid; + u_int8_t i_nlinks; + u_int16_t i_zone[9]; }; /* @@ -124,35 +118,35 @@ struct minix_inode { * now 16-bit. The inode is now 64 bytes instead of 32. */ struct minix2_inode { - u16 i_mode; - u16 i_nlinks; - u16 i_uid; - u16 i_gid; - u32 i_size; - u32 i_atime; - u32 i_mtime; - u32 i_ctime; - u32 i_zone[10]; + u_int16_t i_mode; + u_int16_t i_nlinks; + u_int16_t i_uid; + u_int16_t i_gid; + u_int32_t i_size; + u_int32_t i_atime; + u_int32_t i_mtime; + u_int32_t i_ctime; + u_int32_t i_zone[10]; }; /* * minix super-block data on disk */ struct minix_super_block { - u16 s_ninodes; - u16 s_nzones; - u16 s_imap_blocks; - u16 s_zmap_blocks; - u16 s_firstdatazone; - u16 s_log_zone_size; - u32 s_max_size; - u16 s_magic; - u16 s_state; - u32 s_zones; + u_int16_t s_ninodes; + u_int16_t s_nzones; + u_int16_t s_imap_blocks; + u_int16_t s_zmap_blocks; + u_int16_t s_firstdatazone; + u_int16_t s_log_zone_size; + u_int32_t s_max_size; + u_int16_t s_magic; + u_int16_t s_state; + u_int32_t s_zones; }; struct minix_dir_entry { - u16 inode; + u_int16_t inode; char name[0]; };