diff options
author | Eric Andersen <andersen@codepoet.org> | 2001-08-29 19:02:26 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2001-08-29 19:02:26 +0000 |
commit | dcbca62e89a46788de4b32ba3b2a4b5cd725e430 (patch) | |
tree | 8625e627265130f72a02982cbb3c1e7642f1221c | |
parent | 507891998164b8548f5aebfc54e759a3fbbd3bde (diff) | |
download | busybox-w32-dcbca62e89a46788de4b32ba3b2a4b5cd725e430.tar.gz busybox-w32-dcbca62e89a46788de4b32ba3b2a4b5cd725e430.tar.bz2 busybox-w32-dcbca62e89a46788de4b32ba3b2a4b5cd725e430.zip |
Standard typing (u_int16_t instead of u16, u_int32_t instead
of u32, etc) cleanups from Laurence Anderson <laurence@zxmail.com>
-rw-r--r-- | archival/rpm2cpio.c | 22 | ||||
-rw-r--r-- | fbset.c | 2 | ||||
-rw-r--r-- | fsck_minix.c | 60 | ||||
-rw-r--r-- | mkfs_minix.c | 60 | ||||
-rw-r--r-- | rpm2cpio.c | 22 | ||||
-rw-r--r-- | util-linux/fbset.c | 2 | ||||
-rw-r--r-- | util-linux/fsck_minix.c | 60 | ||||
-rw-r--r-- | util-linux/mkfs_minix.c | 60 |
8 files changed, 128 insertions, 160 deletions
diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c index 45c3ffb17..8d639d6ad 100644 --- a/archival/rpm2cpio.c +++ b/archival/rpm2cpio.c | |||
@@ -26,27 +26,23 @@ | |||
26 | #define RPM_MAGIC "\355\253\356\333" | 26 | #define RPM_MAGIC "\355\253\356\333" |
27 | #define RPM_HEADER_MAGIC "\216\255\350" | 27 | #define RPM_HEADER_MAGIC "\216\255\350" |
28 | 28 | ||
29 | typedef unsigned char u8; | ||
30 | typedef unsigned short u16; | ||
31 | typedef unsigned int u32; | ||
32 | |||
33 | struct rpm_lead { | 29 | struct rpm_lead { |
34 | unsigned char magic[4]; | 30 | unsigned char magic[4]; |
35 | u8 major, minor; | 31 | u_int8_t major, minor; |
36 | u16 type; | 32 | u_int16_t type; |
37 | u16 archnum; | 33 | u_int16_t archnum; |
38 | char name[66]; | 34 | char name[66]; |
39 | u16 osnum; | 35 | u_int16_t osnum; |
40 | u16 signature_type; | 36 | u_int16_t signature_type; |
41 | char reserved[16]; | 37 | char reserved[16]; |
42 | }; | 38 | }; |
43 | 39 | ||
44 | struct rpm_header { | 40 | struct rpm_header { |
45 | char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */ | 41 | char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */ |
46 | u8 version; /* 1 byte version number */ | 42 | u_int8_t version; /* 1 byte version number */ |
47 | u32 reserved; /* 4 bytes reserved */ | 43 | u_int32_t reserved; /* 4 bytes reserved */ |
48 | u32 entries; /* Number of entries in header (4 bytes) */ | 44 | u_int32_t entries; /* Number of entries in header (4 bytes) */ |
49 | u32 size; /* Size of store (4 bytes) */ | 45 | u_int32_t size; /* Size of store (4 bytes) */ |
50 | }; | 46 | }; |
51 | 47 | ||
52 | void skip_header(FILE *rpmfile) | 48 | void skip_header(FILE *rpmfile) |
@@ -85,7 +85,7 @@ static unsigned int g_options = 0; | |||
85 | /* Stuff stolen from the kernel's fb.h */ | 85 | /* Stuff stolen from the kernel's fb.h */ |
86 | static const int FBIOGET_VSCREENINFO = 0x4600; | 86 | static const int FBIOGET_VSCREENINFO = 0x4600; |
87 | static const int FBIOPUT_VSCREENINFO = 0x4601; | 87 | static const int FBIOPUT_VSCREENINFO = 0x4601; |
88 | #define __u32 unsigned int | 88 | #define __u32 u_int32_t |
89 | struct fb_bitfield { | 89 | struct fb_bitfield { |
90 | __u32 offset; /* beginning of bitfield */ | 90 | __u32 offset; /* beginning of bitfield */ |
91 | __u32 length; /* length of bitfield */ | 91 | __u32 length; /* length of bitfield */ |
diff --git a/fsck_minix.c b/fsck_minix.c index a2421fc34..952968d85 100644 --- a/fsck_minix.c +++ b/fsck_minix.c | |||
@@ -98,12 +98,6 @@ | |||
98 | #include <sys/param.h> | 98 | #include <sys/param.h> |
99 | #include "busybox.h" | 99 | #include "busybox.h" |
100 | 100 | ||
101 | |||
102 | typedef unsigned char u8; | ||
103 | typedef unsigned short u16; | ||
104 | typedef unsigned int u32; | ||
105 | |||
106 | |||
107 | static const int MINIX_ROOT_INO = 1; | 101 | static const int MINIX_ROOT_INO = 1; |
108 | static const int MINIX_LINK_MAX = 250; | 102 | static const int MINIX_LINK_MAX = 250; |
109 | static const int MINIX2_LINK_MAX = 65530; | 103 | static const int MINIX2_LINK_MAX = 65530; |
@@ -130,13 +124,13 @@ static const int MINIX_V2 = 0x0002; /* minix V2 fs */ | |||
130 | * Note the 8-bit gid and atime and ctime. | 124 | * Note the 8-bit gid and atime and ctime. |
131 | */ | 125 | */ |
132 | struct minix_inode { | 126 | struct minix_inode { |
133 | u16 i_mode; | 127 | u_int16_t i_mode; |
134 | u16 i_uid; | 128 | u_int16_t i_uid; |
135 | u32 i_size; | 129 | u_int32_t i_size; |
136 | u32 i_time; | 130 | u_int32_t i_time; |
137 | u8 i_gid; | 131 | u_int8_t i_gid; |
138 | u8 i_nlinks; | 132 | u_int8_t i_nlinks; |
139 | u16 i_zone[9]; | 133 | u_int16_t i_zone[9]; |
140 | }; | 134 | }; |
141 | 135 | ||
142 | /* | 136 | /* |
@@ -146,35 +140,35 @@ struct minix_inode { | |||
146 | * now 16-bit. The inode is now 64 bytes instead of 32. | 140 | * now 16-bit. The inode is now 64 bytes instead of 32. |
147 | */ | 141 | */ |
148 | struct minix2_inode { | 142 | struct minix2_inode { |
149 | u16 i_mode; | 143 | u_int16_t i_mode; |
150 | u16 i_nlinks; | 144 | u_int16_t i_nlinks; |
151 | u16 i_uid; | 145 | u_int16_t i_uid; |
152 | u16 i_gid; | 146 | u_int16_t i_gid; |
153 | u32 i_size; | 147 | u_int32_t i_size; |
154 | u32 i_atime; | 148 | u_int32_t i_atime; |
155 | u32 i_mtime; | 149 | u_int32_t i_mtime; |
156 | u32 i_ctime; | 150 | u_int32_t i_ctime; |
157 | u32 i_zone[10]; | 151 | u_int32_t i_zone[10]; |
158 | }; | 152 | }; |
159 | 153 | ||
160 | /* | 154 | /* |
161 | * minix super-block data on disk | 155 | * minix super-block data on disk |
162 | */ | 156 | */ |
163 | struct minix_super_block { | 157 | struct minix_super_block { |
164 | u16 s_ninodes; | 158 | u_int16_t s_ninodes; |
165 | u16 s_nzones; | 159 | u_int16_t s_nzones; |
166 | u16 s_imap_blocks; | 160 | u_int16_t s_imap_blocks; |
167 | u16 s_zmap_blocks; | 161 | u_int16_t s_zmap_blocks; |
168 | u16 s_firstdatazone; | 162 | u_int16_t s_firstdatazone; |
169 | u16 s_log_zone_size; | 163 | u_int16_t s_log_zone_size; |
170 | u32 s_max_size; | 164 | u_int32_t s_max_size; |
171 | u16 s_magic; | 165 | u_int16_t s_magic; |
172 | u16 s_state; | 166 | u_int16_t s_state; |
173 | u32 s_zones; | 167 | u_int32_t s_zones; |
174 | }; | 168 | }; |
175 | 169 | ||
176 | struct minix_dir_entry { | 170 | struct minix_dir_entry { |
177 | u16 inode; | 171 | u_int16_t inode; |
178 | char name[0]; | 172 | char name[0]; |
179 | }; | 173 | }; |
180 | 174 | ||
diff --git a/mkfs_minix.c b/mkfs_minix.c index 70374eae9..ccc0e85d7 100644 --- a/mkfs_minix.c +++ b/mkfs_minix.c | |||
@@ -76,12 +76,6 @@ | |||
76 | #include <mntent.h> | 76 | #include <mntent.h> |
77 | #include "busybox.h" | 77 | #include "busybox.h" |
78 | 78 | ||
79 | |||
80 | typedef unsigned char u8; | ||
81 | typedef unsigned short u16; | ||
82 | typedef unsigned int u32; | ||
83 | |||
84 | |||
85 | #define MINIX_ROOT_INO 1 | 79 | #define MINIX_ROOT_INO 1 |
86 | #define MINIX_LINK_MAX 250 | 80 | #define MINIX_LINK_MAX 250 |
87 | #define MINIX2_LINK_MAX 65530 | 81 | #define MINIX2_LINK_MAX 65530 |
@@ -108,13 +102,13 @@ typedef unsigned int u32; | |||
108 | * Note the 8-bit gid and atime and ctime. | 102 | * Note the 8-bit gid and atime and ctime. |
109 | */ | 103 | */ |
110 | struct minix_inode { | 104 | struct minix_inode { |
111 | u16 i_mode; | 105 | u_int16_t i_mode; |
112 | u16 i_uid; | 106 | u_int16_t i_uid; |
113 | u32 i_size; | 107 | u_int32_t i_size; |
114 | u32 i_time; | 108 | u_int32_t i_time; |
115 | u8 i_gid; | 109 | u_int8_t i_gid; |
116 | u8 i_nlinks; | 110 | u_int8_t i_nlinks; |
117 | u16 i_zone[9]; | 111 | u_int16_t i_zone[9]; |
118 | }; | 112 | }; |
119 | 113 | ||
120 | /* | 114 | /* |
@@ -124,35 +118,35 @@ struct minix_inode { | |||
124 | * now 16-bit. The inode is now 64 bytes instead of 32. | 118 | * now 16-bit. The inode is now 64 bytes instead of 32. |
125 | */ | 119 | */ |
126 | struct minix2_inode { | 120 | struct minix2_inode { |
127 | u16 i_mode; | 121 | u_int16_t i_mode; |
128 | u16 i_nlinks; | 122 | u_int16_t i_nlinks; |
129 | u16 i_uid; | 123 | u_int16_t i_uid; |
130 | u16 i_gid; | 124 | u_int16_t i_gid; |
131 | u32 i_size; | 125 | u_int32_t i_size; |
132 | u32 i_atime; | 126 | u_int32_t i_atime; |
133 | u32 i_mtime; | 127 | u_int32_t i_mtime; |
134 | u32 i_ctime; | 128 | u_int32_t i_ctime; |
135 | u32 i_zone[10]; | 129 | u_int32_t i_zone[10]; |
136 | }; | 130 | }; |
137 | 131 | ||
138 | /* | 132 | /* |
139 | * minix super-block data on disk | 133 | * minix super-block data on disk |
140 | */ | 134 | */ |
141 | struct minix_super_block { | 135 | struct minix_super_block { |
142 | u16 s_ninodes; | 136 | u_int16_t s_ninodes; |
143 | u16 s_nzones; | 137 | u_int16_t s_nzones; |
144 | u16 s_imap_blocks; | 138 | u_int16_t s_imap_blocks; |
145 | u16 s_zmap_blocks; | 139 | u_int16_t s_zmap_blocks; |
146 | u16 s_firstdatazone; | 140 | u_int16_t s_firstdatazone; |
147 | u16 s_log_zone_size; | 141 | u_int16_t s_log_zone_size; |
148 | u32 s_max_size; | 142 | u_int32_t s_max_size; |
149 | u16 s_magic; | 143 | u_int16_t s_magic; |
150 | u16 s_state; | 144 | u_int16_t s_state; |
151 | u32 s_zones; | 145 | u_int32_t s_zones; |
152 | }; | 146 | }; |
153 | 147 | ||
154 | struct minix_dir_entry { | 148 | struct minix_dir_entry { |
155 | u16 inode; | 149 | u_int16_t inode; |
156 | char name[0]; | 150 | char name[0]; |
157 | }; | 151 | }; |
158 | 152 | ||
diff --git a/rpm2cpio.c b/rpm2cpio.c index 45c3ffb17..8d639d6ad 100644 --- a/rpm2cpio.c +++ b/rpm2cpio.c | |||
@@ -26,27 +26,23 @@ | |||
26 | #define RPM_MAGIC "\355\253\356\333" | 26 | #define RPM_MAGIC "\355\253\356\333" |
27 | #define RPM_HEADER_MAGIC "\216\255\350" | 27 | #define RPM_HEADER_MAGIC "\216\255\350" |
28 | 28 | ||
29 | typedef unsigned char u8; | ||
30 | typedef unsigned short u16; | ||
31 | typedef unsigned int u32; | ||
32 | |||
33 | struct rpm_lead { | 29 | struct rpm_lead { |
34 | unsigned char magic[4]; | 30 | unsigned char magic[4]; |
35 | u8 major, minor; | 31 | u_int8_t major, minor; |
36 | u16 type; | 32 | u_int16_t type; |
37 | u16 archnum; | 33 | u_int16_t archnum; |
38 | char name[66]; | 34 | char name[66]; |
39 | u16 osnum; | 35 | u_int16_t osnum; |
40 | u16 signature_type; | 36 | u_int16_t signature_type; |
41 | char reserved[16]; | 37 | char reserved[16]; |
42 | }; | 38 | }; |
43 | 39 | ||
44 | struct rpm_header { | 40 | struct rpm_header { |
45 | char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */ | 41 | char magic[3]; /* 3 byte magic: 0x8e 0xad 0xe8 */ |
46 | u8 version; /* 1 byte version number */ | 42 | u_int8_t version; /* 1 byte version number */ |
47 | u32 reserved; /* 4 bytes reserved */ | 43 | u_int32_t reserved; /* 4 bytes reserved */ |
48 | u32 entries; /* Number of entries in header (4 bytes) */ | 44 | u_int32_t entries; /* Number of entries in header (4 bytes) */ |
49 | u32 size; /* Size of store (4 bytes) */ | 45 | u_int32_t size; /* Size of store (4 bytes) */ |
50 | }; | 46 | }; |
51 | 47 | ||
52 | void skip_header(FILE *rpmfile) | 48 | void skip_header(FILE *rpmfile) |
diff --git a/util-linux/fbset.c b/util-linux/fbset.c index 41c7f9796..5ccd80e79 100644 --- a/util-linux/fbset.c +++ b/util-linux/fbset.c | |||
@@ -85,7 +85,7 @@ static unsigned int g_options = 0; | |||
85 | /* Stuff stolen from the kernel's fb.h */ | 85 | /* Stuff stolen from the kernel's fb.h */ |
86 | static const int FBIOGET_VSCREENINFO = 0x4600; | 86 | static const int FBIOGET_VSCREENINFO = 0x4600; |
87 | static const int FBIOPUT_VSCREENINFO = 0x4601; | 87 | static const int FBIOPUT_VSCREENINFO = 0x4601; |
88 | #define __u32 unsigned int | 88 | #define __u32 u_int32_t |
89 | struct fb_bitfield { | 89 | struct fb_bitfield { |
90 | __u32 offset; /* beginning of bitfield */ | 90 | __u32 offset; /* beginning of bitfield */ |
91 | __u32 length; /* length of bitfield */ | 91 | __u32 length; /* length of bitfield */ |
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index a2421fc34..952968d85 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -98,12 +98,6 @@ | |||
98 | #include <sys/param.h> | 98 | #include <sys/param.h> |
99 | #include "busybox.h" | 99 | #include "busybox.h" |
100 | 100 | ||
101 | |||
102 | typedef unsigned char u8; | ||
103 | typedef unsigned short u16; | ||
104 | typedef unsigned int u32; | ||
105 | |||
106 | |||
107 | static const int MINIX_ROOT_INO = 1; | 101 | static const int MINIX_ROOT_INO = 1; |
108 | static const int MINIX_LINK_MAX = 250; | 102 | static const int MINIX_LINK_MAX = 250; |
109 | static const int MINIX2_LINK_MAX = 65530; | 103 | static const int MINIX2_LINK_MAX = 65530; |
@@ -130,13 +124,13 @@ static const int MINIX_V2 = 0x0002; /* minix V2 fs */ | |||
130 | * Note the 8-bit gid and atime and ctime. | 124 | * Note the 8-bit gid and atime and ctime. |
131 | */ | 125 | */ |
132 | struct minix_inode { | 126 | struct minix_inode { |
133 | u16 i_mode; | 127 | u_int16_t i_mode; |
134 | u16 i_uid; | 128 | u_int16_t i_uid; |
135 | u32 i_size; | 129 | u_int32_t i_size; |
136 | u32 i_time; | 130 | u_int32_t i_time; |
137 | u8 i_gid; | 131 | u_int8_t i_gid; |
138 | u8 i_nlinks; | 132 | u_int8_t i_nlinks; |
139 | u16 i_zone[9]; | 133 | u_int16_t i_zone[9]; |
140 | }; | 134 | }; |
141 | 135 | ||
142 | /* | 136 | /* |
@@ -146,35 +140,35 @@ struct minix_inode { | |||
146 | * now 16-bit. The inode is now 64 bytes instead of 32. | 140 | * now 16-bit. The inode is now 64 bytes instead of 32. |
147 | */ | 141 | */ |
148 | struct minix2_inode { | 142 | struct minix2_inode { |
149 | u16 i_mode; | 143 | u_int16_t i_mode; |
150 | u16 i_nlinks; | 144 | u_int16_t i_nlinks; |
151 | u16 i_uid; | 145 | u_int16_t i_uid; |
152 | u16 i_gid; | 146 | u_int16_t i_gid; |
153 | u32 i_size; | 147 | u_int32_t i_size; |
154 | u32 i_atime; | 148 | u_int32_t i_atime; |
155 | u32 i_mtime; | 149 | u_int32_t i_mtime; |
156 | u32 i_ctime; | 150 | u_int32_t i_ctime; |
157 | u32 i_zone[10]; | 151 | u_int32_t i_zone[10]; |
158 | }; | 152 | }; |
159 | 153 | ||
160 | /* | 154 | /* |
161 | * minix super-block data on disk | 155 | * minix super-block data on disk |
162 | */ | 156 | */ |
163 | struct minix_super_block { | 157 | struct minix_super_block { |
164 | u16 s_ninodes; | 158 | u_int16_t s_ninodes; |
165 | u16 s_nzones; | 159 | u_int16_t s_nzones; |
166 | u16 s_imap_blocks; | 160 | u_int16_t s_imap_blocks; |
167 | u16 s_zmap_blocks; | 161 | u_int16_t s_zmap_blocks; |
168 | u16 s_firstdatazone; | 162 | u_int16_t s_firstdatazone; |
169 | u16 s_log_zone_size; | 163 | u_int16_t s_log_zone_size; |
170 | u32 s_max_size; | 164 | u_int32_t s_max_size; |
171 | u16 s_magic; | 165 | u_int16_t s_magic; |
172 | u16 s_state; | 166 | u_int16_t s_state; |
173 | u32 s_zones; | 167 | u_int32_t s_zones; |
174 | }; | 168 | }; |
175 | 169 | ||
176 | struct minix_dir_entry { | 170 | struct minix_dir_entry { |
177 | u16 inode; | 171 | u_int16_t inode; |
178 | char name[0]; | 172 | char name[0]; |
179 | }; | 173 | }; |
180 | 174 | ||
diff --git a/util-linux/mkfs_minix.c b/util-linux/mkfs_minix.c index 70374eae9..ccc0e85d7 100644 --- a/util-linux/mkfs_minix.c +++ b/util-linux/mkfs_minix.c | |||
@@ -76,12 +76,6 @@ | |||
76 | #include <mntent.h> | 76 | #include <mntent.h> |
77 | #include "busybox.h" | 77 | #include "busybox.h" |
78 | 78 | ||
79 | |||
80 | typedef unsigned char u8; | ||
81 | typedef unsigned short u16; | ||
82 | typedef unsigned int u32; | ||
83 | |||
84 | |||
85 | #define MINIX_ROOT_INO 1 | 79 | #define MINIX_ROOT_INO 1 |
86 | #define MINIX_LINK_MAX 250 | 80 | #define MINIX_LINK_MAX 250 |
87 | #define MINIX2_LINK_MAX 65530 | 81 | #define MINIX2_LINK_MAX 65530 |
@@ -108,13 +102,13 @@ typedef unsigned int u32; | |||
108 | * Note the 8-bit gid and atime and ctime. | 102 | * Note the 8-bit gid and atime and ctime. |
109 | */ | 103 | */ |
110 | struct minix_inode { | 104 | struct minix_inode { |
111 | u16 i_mode; | 105 | u_int16_t i_mode; |
112 | u16 i_uid; | 106 | u_int16_t i_uid; |
113 | u32 i_size; | 107 | u_int32_t i_size; |
114 | u32 i_time; | 108 | u_int32_t i_time; |
115 | u8 i_gid; | 109 | u_int8_t i_gid; |
116 | u8 i_nlinks; | 110 | u_int8_t i_nlinks; |
117 | u16 i_zone[9]; | 111 | u_int16_t i_zone[9]; |
118 | }; | 112 | }; |
119 | 113 | ||
120 | /* | 114 | /* |
@@ -124,35 +118,35 @@ struct minix_inode { | |||
124 | * now 16-bit. The inode is now 64 bytes instead of 32. | 118 | * now 16-bit. The inode is now 64 bytes instead of 32. |
125 | */ | 119 | */ |
126 | struct minix2_inode { | 120 | struct minix2_inode { |
127 | u16 i_mode; | 121 | u_int16_t i_mode; |
128 | u16 i_nlinks; | 122 | u_int16_t i_nlinks; |
129 | u16 i_uid; | 123 | u_int16_t i_uid; |
130 | u16 i_gid; | 124 | u_int16_t i_gid; |
131 | u32 i_size; | 125 | u_int32_t i_size; |
132 | u32 i_atime; | 126 | u_int32_t i_atime; |
133 | u32 i_mtime; | 127 | u_int32_t i_mtime; |
134 | u32 i_ctime; | 128 | u_int32_t i_ctime; |
135 | u32 i_zone[10]; | 129 | u_int32_t i_zone[10]; |
136 | }; | 130 | }; |
137 | 131 | ||
138 | /* | 132 | /* |
139 | * minix super-block data on disk | 133 | * minix super-block data on disk |
140 | */ | 134 | */ |
141 | struct minix_super_block { | 135 | struct minix_super_block { |
142 | u16 s_ninodes; | 136 | u_int16_t s_ninodes; |
143 | u16 s_nzones; | 137 | u_int16_t s_nzones; |
144 | u16 s_imap_blocks; | 138 | u_int16_t s_imap_blocks; |
145 | u16 s_zmap_blocks; | 139 | u_int16_t s_zmap_blocks; |
146 | u16 s_firstdatazone; | 140 | u_int16_t s_firstdatazone; |
147 | u16 s_log_zone_size; | 141 | u_int16_t s_log_zone_size; |
148 | u32 s_max_size; | 142 | u_int32_t s_max_size; |
149 | u16 s_magic; | 143 | u_int16_t s_magic; |
150 | u16 s_state; | 144 | u_int16_t s_state; |
151 | u32 s_zones; | 145 | u_int32_t s_zones; |
152 | }; | 146 | }; |
153 | 147 | ||
154 | struct minix_dir_entry { | 148 | struct minix_dir_entry { |
155 | u16 inode; | 149 | u_int16_t inode; |
156 | char name[0]; | 150 | char name[0]; |
157 | }; | 151 | }; |
158 | 152 | ||