diff options
author | Rob Landley <rob@landley.net> | 2006-03-10 19:22:06 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-03-10 19:22:06 +0000 |
commit | bc68cd14ccaebc17e7e03a08e51fddfb91007624 (patch) | |
tree | beb32cedafc6232bf8a49fe90f0769d471ea6791 /util-linux/fsck_minix.c | |
parent | dae6aa28598cb2353291f18ca52e768c3259165a (diff) | |
download | busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.gz busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.tar.bz2 busybox-w32-bc68cd14ccaebc17e7e03a08e51fddfb91007624.zip |
Patch from Denis Vlasenko turning static const int (which gets emitted into
the busybox binary) into enums (which don't).
Diffstat (limited to 'util-linux/fsck_minix.c')
-rw-r--r-- | util-linux/fsck_minix.c | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c index 1d3e90aa8..d7d81f130 100644 --- a/util-linux/fsck_minix.c +++ b/util-linux/fsck_minix.c | |||
@@ -98,26 +98,8 @@ | |||
98 | #include <sys/param.h> | 98 | #include <sys/param.h> |
99 | #include "busybox.h" | 99 | #include "busybox.h" |
100 | 100 | ||
101 | static const int MINIX_ROOT_INO = 1; | 101 | #define BLOCK_SIZE_BITS 10 |
102 | static const int MINIX_LINK_MAX = 250; | 102 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) |
103 | static const int MINIX2_LINK_MAX = 65530; | ||
104 | |||
105 | static const int MINIX_I_MAP_SLOTS = 8; | ||
106 | static const int MINIX_Z_MAP_SLOTS = 64; | ||
107 | static const int MINIX_SUPER_MAGIC = 0x137F; /* original minix fs */ | ||
108 | static const int MINIX_SUPER_MAGIC2 = 0x138F; /* minix fs, 30 char names */ | ||
109 | static const int MINIX2_SUPER_MAGIC = 0x2468; /* minix V2 fs */ | ||
110 | static const int MINIX2_SUPER_MAGIC2 = 0x2478; /* minix V2 fs, 30 char names */ | ||
111 | static const int MINIX_VALID_FS = 0x0001; /* Clean fs. */ | ||
112 | static const int MINIX_ERROR_FS = 0x0002; /* fs has errors. */ | ||
113 | |||
114 | #define MINIX_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix_inode))) | ||
115 | #define MINIX2_INODES_PER_BLOCK ((BLOCK_SIZE)/(sizeof (struct minix2_inode))) | ||
116 | |||
117 | static const int MINIX_V1 = 0x0001; /* original minix fs */ | ||
118 | static const int MINIX_V2 = 0x0002; /* minix V2 fs */ | ||
119 | |||
120 | #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version | ||
121 | 103 | ||
122 | /* | 104 | /* |
123 | * This is the original minix inode layout on disk. | 105 | * This is the original minix inode layout on disk. |
@@ -151,6 +133,29 @@ struct minix2_inode { | |||
151 | uint32_t i_zone[10]; | 133 | uint32_t i_zone[10]; |
152 | }; | 134 | }; |
153 | 135 | ||
136 | enum { | ||
137 | MINIX_ROOT_INO = 1, | ||
138 | MINIX_LINK_MAX = 250, | ||
139 | MINIX2_LINK_MAX = 65530, | ||
140 | |||
141 | MINIX_I_MAP_SLOTS = 8, | ||
142 | MINIX_Z_MAP_SLOTS = 64, | ||
143 | MINIX_SUPER_MAGIC = 0x137F, /* original minix fs */ | ||
144 | MINIX_SUPER_MAGIC2 = 0x138F, /* minix fs, 30 char names */ | ||
145 | MINIX2_SUPER_MAGIC = 0x2468, /* minix V2 fs */ | ||
146 | MINIX2_SUPER_MAGIC2 = 0x2478, /* minix V2 fs, 30 char names */ | ||
147 | MINIX_VALID_FS = 0x0001, /* Clean fs. */ | ||
148 | MINIX_ERROR_FS = 0x0002, /* fs has errors. */ | ||
149 | |||
150 | MINIX_INODES_PER_BLOCK = ((BLOCK_SIZE)/(sizeof (struct minix_inode))), | ||
151 | MINIX2_INODES_PER_BLOCK = ((BLOCK_SIZE)/(sizeof (struct minix2_inode))), | ||
152 | |||
153 | MINIX_V1 = 0x0001, /* original minix fs */ | ||
154 | MINIX_V2 = 0x0002 /* minix V2 fs */ | ||
155 | }; | ||
156 | |||
157 | #define INODE_VERSION(inode) inode->i_sb->u.minix_sb.s_version | ||
158 | |||
154 | /* | 159 | /* |
155 | * minix super-block data on disk | 160 | * minix super-block data on disk |
156 | */ | 161 | */ |
@@ -172,8 +177,6 @@ struct minix_dir_entry { | |||
172 | char name[0]; | 177 | char name[0]; |
173 | }; | 178 | }; |
174 | 179 | ||
175 | #define BLOCK_SIZE_BITS 10 | ||
176 | #define BLOCK_SIZE (1<<BLOCK_SIZE_BITS) | ||
177 | 180 | ||
178 | #define NAME_MAX 255 /* # chars in a file name */ | 181 | #define NAME_MAX 255 /* # chars in a file name */ |
179 | 182 | ||
@@ -187,7 +190,7 @@ struct minix_dir_entry { | |||
187 | #define volatile | 190 | #define volatile |
188 | #endif | 191 | #endif |
189 | 192 | ||
190 | static const int ROOT_INO = 1; | 193 | enum { ROOT_INO = 1 }; |
191 | 194 | ||
192 | #define UPPER(size,n) ((size+((n)-1))/(n)) | 195 | #define UPPER(size,n) ((size+((n)-1))/(n)) |
193 | #define INODE_SIZE (sizeof(struct minix_inode)) | 196 | #define INODE_SIZE (sizeof(struct minix_inode)) |
@@ -219,7 +222,7 @@ static struct termios termios; | |||
219 | static int termios_set = 0; | 222 | static int termios_set = 0; |
220 | 223 | ||
221 | /* File-name data */ | 224 | /* File-name data */ |
222 | static const int MAX_DEPTH = 32; | 225 | enum { MAX_DEPTH = 32 }; |
223 | static int name_depth = 0; | 226 | static int name_depth = 0; |
224 | // static char name_list[MAX_DEPTH][BUFSIZ + 1]; | 227 | // static char name_list[MAX_DEPTH][BUFSIZ + 1]; |
225 | static char **name_list = NULL; | 228 | static char **name_list = NULL; |