diff options
author | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-10-15 14:41:08 +0000 |
---|---|---|
committer | "Vladimir N. Oleynik" <dzo@simtreas.ru> | 2005-10-15 14:41:08 +0000 |
commit | c961a44e0ba57d79528ef2e69324872a26ecd3e6 (patch) | |
tree | 35f0dc57f58353588b51ac61bae191a7a2338a61 | |
parent | d3d829aaf0fb1fd0d38402a77a310debde2829bf (diff) | |
download | busybox-w32-c961a44e0ba57d79528ef2e69324872a26ecd3e6.tar.gz busybox-w32-c961a44e0ba57d79528ef2e69324872a26ecd3e6.tar.bz2 busybox-w32-c961a44e0ba57d79528ef2e69324872a26ecd3e6.zip |
more const, all data to text
-rw-r--r-- | e2fsprogs/blkid/probe.c | 40 | ||||
-rw-r--r-- | e2fsprogs/blkid/probe.h | 2 |
2 files changed, 21 insertions, 21 deletions
diff --git a/e2fsprogs/blkid/probe.c b/e2fsprogs/blkid/probe.c index 1c30460f6..cb21c1070 100644 --- a/e2fsprogs/blkid/probe.c +++ b/e2fsprogs/blkid/probe.c | |||
@@ -98,7 +98,7 @@ static void get_ext2_info(blkid_dev dev, unsigned char *buf) | |||
98 | static int probe_ext3(int fd __BLKID_ATTR((unused)), | 98 | static int probe_ext3(int fd __BLKID_ATTR((unused)), |
99 | blkid_cache cache __BLKID_ATTR((unused)), | 99 | blkid_cache cache __BLKID_ATTR((unused)), |
100 | blkid_dev dev, | 100 | blkid_dev dev, |
101 | struct blkid_magic *id, unsigned char *buf) | 101 | const struct blkid_magic *id, unsigned char *buf) |
102 | { | 102 | { |
103 | struct ext2_super_block *es; | 103 | struct ext2_super_block *es; |
104 | 104 | ||
@@ -124,7 +124,7 @@ static int probe_ext3(int fd __BLKID_ATTR((unused)), | |||
124 | static int probe_ext2(int fd __BLKID_ATTR((unused)), | 124 | static int probe_ext2(int fd __BLKID_ATTR((unused)), |
125 | blkid_cache cache __BLKID_ATTR((unused)), | 125 | blkid_cache cache __BLKID_ATTR((unused)), |
126 | blkid_dev dev, | 126 | blkid_dev dev, |
127 | struct blkid_magic *id, unsigned char *buf) | 127 | const struct blkid_magic *id, unsigned char *buf) |
128 | { | 128 | { |
129 | struct ext2_super_block *es; | 129 | struct ext2_super_block *es; |
130 | // const char *sec_type = 0, *label = 0; | 130 | // const char *sec_type = 0, *label = 0; |
@@ -144,7 +144,7 @@ static int probe_ext2(int fd __BLKID_ATTR((unused)), | |||
144 | static int probe_jbd(int fd __BLKID_ATTR((unused)), | 144 | static int probe_jbd(int fd __BLKID_ATTR((unused)), |
145 | blkid_cache cache __BLKID_ATTR((unused)), | 145 | blkid_cache cache __BLKID_ATTR((unused)), |
146 | blkid_dev dev, | 146 | blkid_dev dev, |
147 | struct blkid_magic *id __BLKID_ATTR((unused)), | 147 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
148 | unsigned char *buf) | 148 | unsigned char *buf) |
149 | { | 149 | { |
150 | struct ext2_super_block *es = (struct ext2_super_block *) buf; | 150 | struct ext2_super_block *es = (struct ext2_super_block *) buf; |
@@ -161,7 +161,7 @@ static int probe_jbd(int fd __BLKID_ATTR((unused)), | |||
161 | static int probe_vfat(int fd __BLKID_ATTR((unused)), | 161 | static int probe_vfat(int fd __BLKID_ATTR((unused)), |
162 | blkid_cache cache __BLKID_ATTR((unused)), | 162 | blkid_cache cache __BLKID_ATTR((unused)), |
163 | blkid_dev dev, | 163 | blkid_dev dev, |
164 | struct blkid_magic *id __BLKID_ATTR((unused)), | 164 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
165 | unsigned char *buf) | 165 | unsigned char *buf) |
166 | { | 166 | { |
167 | struct vfat_super_block *vs; | 167 | struct vfat_super_block *vs; |
@@ -194,7 +194,7 @@ static int probe_vfat(int fd __BLKID_ATTR((unused)), | |||
194 | static int probe_msdos(int fd __BLKID_ATTR((unused)), | 194 | static int probe_msdos(int fd __BLKID_ATTR((unused)), |
195 | blkid_cache cache __BLKID_ATTR((unused)), | 195 | blkid_cache cache __BLKID_ATTR((unused)), |
196 | blkid_dev dev, | 196 | blkid_dev dev, |
197 | struct blkid_magic *id __BLKID_ATTR((unused)), | 197 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
198 | unsigned char *buf) | 198 | unsigned char *buf) |
199 | { | 199 | { |
200 | struct msdos_super_block *ms = (struct msdos_super_block *) buf; | 200 | struct msdos_super_block *ms = (struct msdos_super_block *) buf; |
@@ -226,7 +226,7 @@ static int probe_msdos(int fd __BLKID_ATTR((unused)), | |||
226 | static int probe_xfs(int fd __BLKID_ATTR((unused)), | 226 | static int probe_xfs(int fd __BLKID_ATTR((unused)), |
227 | blkid_cache cache __BLKID_ATTR((unused)), | 227 | blkid_cache cache __BLKID_ATTR((unused)), |
228 | blkid_dev dev, | 228 | blkid_dev dev, |
229 | struct blkid_magic *id __BLKID_ATTR((unused)), | 229 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
230 | unsigned char *buf) | 230 | unsigned char *buf) |
231 | { | 231 | { |
232 | struct xfs_super_block *xs; | 232 | struct xfs_super_block *xs; |
@@ -244,7 +244,7 @@ static int probe_xfs(int fd __BLKID_ATTR((unused)), | |||
244 | static int probe_reiserfs(int fd __BLKID_ATTR((unused)), | 244 | static int probe_reiserfs(int fd __BLKID_ATTR((unused)), |
245 | blkid_cache cache __BLKID_ATTR((unused)), | 245 | blkid_cache cache __BLKID_ATTR((unused)), |
246 | blkid_dev dev, | 246 | blkid_dev dev, |
247 | struct blkid_magic *id, unsigned char *buf) | 247 | const struct blkid_magic *id, unsigned char *buf) |
248 | { | 248 | { |
249 | struct reiserfs_super_block *rs = (struct reiserfs_super_block *) buf; | 249 | struct reiserfs_super_block *rs = (struct reiserfs_super_block *) buf; |
250 | unsigned int blocksize; | 250 | unsigned int blocksize; |
@@ -271,7 +271,7 @@ static int probe_reiserfs(int fd __BLKID_ATTR((unused)), | |||
271 | static int probe_jfs(int fd __BLKID_ATTR((unused)), | 271 | static int probe_jfs(int fd __BLKID_ATTR((unused)), |
272 | blkid_cache cache __BLKID_ATTR((unused)), | 272 | blkid_cache cache __BLKID_ATTR((unused)), |
273 | blkid_dev dev, | 273 | blkid_dev dev, |
274 | struct blkid_magic *id __BLKID_ATTR((unused)), | 274 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
275 | unsigned char *buf) | 275 | unsigned char *buf) |
276 | { | 276 | { |
277 | struct jfs_super_block *js; | 277 | struct jfs_super_block *js; |
@@ -289,7 +289,7 @@ static int probe_jfs(int fd __BLKID_ATTR((unused)), | |||
289 | static int probe_romfs(int fd __BLKID_ATTR((unused)), | 289 | static int probe_romfs(int fd __BLKID_ATTR((unused)), |
290 | blkid_cache cache __BLKID_ATTR((unused)), | 290 | blkid_cache cache __BLKID_ATTR((unused)), |
291 | blkid_dev dev, | 291 | blkid_dev dev, |
292 | struct blkid_magic *id __BLKID_ATTR((unused)), | 292 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
293 | unsigned char *buf) | 293 | unsigned char *buf) |
294 | { | 294 | { |
295 | struct romfs_super_block *ros; | 295 | struct romfs_super_block *ros; |
@@ -306,7 +306,7 @@ static int probe_romfs(int fd __BLKID_ATTR((unused)), | |||
306 | static int probe_swap0(int fd __BLKID_ATTR((unused)), | 306 | static int probe_swap0(int fd __BLKID_ATTR((unused)), |
307 | blkid_cache cache __BLKID_ATTR((unused)), | 307 | blkid_cache cache __BLKID_ATTR((unused)), |
308 | blkid_dev dev, | 308 | blkid_dev dev, |
309 | struct blkid_magic *id __BLKID_ATTR((unused)), | 309 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
310 | unsigned char *buf __BLKID_ATTR((unused))) | 310 | unsigned char *buf __BLKID_ATTR((unused))) |
311 | { | 311 | { |
312 | blkid_set_tag(dev, "UUID", 0, 0); | 312 | blkid_set_tag(dev, "UUID", 0, 0); |
@@ -317,7 +317,7 @@ static int probe_swap0(int fd __BLKID_ATTR((unused)), | |||
317 | static int probe_swap1(int fd, | 317 | static int probe_swap1(int fd, |
318 | blkid_cache cache __BLKID_ATTR((unused)), | 318 | blkid_cache cache __BLKID_ATTR((unused)), |
319 | blkid_dev dev, | 319 | blkid_dev dev, |
320 | struct blkid_magic *id __BLKID_ATTR((unused)), | 320 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
321 | unsigned char *buf __BLKID_ATTR((unused))) | 321 | unsigned char *buf __BLKID_ATTR((unused))) |
322 | { | 322 | { |
323 | struct swap_id_block *sws; | 323 | struct swap_id_block *sws; |
@@ -351,17 +351,17 @@ static int probe_swap1(int fd, | |||
351 | } | 351 | } |
352 | 352 | ||
353 | static const char | 353 | static const char |
354 | *udf_magic[] = { "BEA01", "BOOT2", "CD001", "CDW02", "NSR02", | 354 | * const udf_magic[] = { "BEA01", "BOOT2", "CD001", "CDW02", "NSR02", |
355 | "NSR03", "TEA01", 0 }; | 355 | "NSR03", "TEA01", 0 }; |
356 | 356 | ||
357 | static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)), | 357 | static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)), |
358 | blkid_dev dev __BLKID_ATTR((unused)), | 358 | blkid_dev dev __BLKID_ATTR((unused)), |
359 | struct blkid_magic *id __BLKID_ATTR((unused)), | 359 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
360 | unsigned char *buf __BLKID_ATTR((unused))) | 360 | unsigned char *buf __BLKID_ATTR((unused))) |
361 | { | 361 | { |
362 | int j, bs; | 362 | int j, bs; |
363 | struct iso_volume_descriptor isosb; | 363 | struct iso_volume_descriptor isosb; |
364 | const char ** m; | 364 | const char * const * m; |
365 | 365 | ||
366 | /* determine the block size by scanning in 2K increments | 366 | /* determine the block size by scanning in 2K increments |
367 | (block sizes larger than 2K will be null padded) */ | 367 | (block sizes larger than 2K will be null padded) */ |
@@ -399,7 +399,7 @@ static int probe_udf(int fd, blkid_cache cache __BLKID_ATTR((unused)), | |||
399 | static int probe_ocfs(int fd __BLKID_ATTR((unused)), | 399 | static int probe_ocfs(int fd __BLKID_ATTR((unused)), |
400 | blkid_cache cache __BLKID_ATTR((unused)), | 400 | blkid_cache cache __BLKID_ATTR((unused)), |
401 | blkid_dev dev, | 401 | blkid_dev dev, |
402 | struct blkid_magic *id __BLKID_ATTR((unused)), | 402 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
403 | unsigned char *buf) | 403 | unsigned char *buf) |
404 | { | 404 | { |
405 | struct ocfs_volume_header ovh; | 405 | struct ocfs_volume_header ovh; |
@@ -424,7 +424,7 @@ static int probe_ocfs(int fd __BLKID_ATTR((unused)), | |||
424 | static int probe_ocfs2(int fd __BLKID_ATTR((unused)), | 424 | static int probe_ocfs2(int fd __BLKID_ATTR((unused)), |
425 | blkid_cache cache __BLKID_ATTR((unused)), | 425 | blkid_cache cache __BLKID_ATTR((unused)), |
426 | blkid_dev dev, | 426 | blkid_dev dev, |
427 | struct blkid_magic *id __BLKID_ATTR((unused)), | 427 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
428 | unsigned char *buf) | 428 | unsigned char *buf) |
429 | { | 429 | { |
430 | struct ocfs2_super_block *osb; | 430 | struct ocfs2_super_block *osb; |
@@ -439,7 +439,7 @@ static int probe_ocfs2(int fd __BLKID_ATTR((unused)), | |||
439 | static int probe_oracleasm(int fd __BLKID_ATTR((unused)), | 439 | static int probe_oracleasm(int fd __BLKID_ATTR((unused)), |
440 | blkid_cache cache __BLKID_ATTR((unused)), | 440 | blkid_cache cache __BLKID_ATTR((unused)), |
441 | blkid_dev dev, | 441 | blkid_dev dev, |
442 | struct blkid_magic *id __BLKID_ATTR((unused)), | 442 | const struct blkid_magic *id __BLKID_ATTR((unused)), |
443 | unsigned char *buf) | 443 | unsigned char *buf) |
444 | { | 444 | { |
445 | struct oracle_asm_disk_label *dl; | 445 | struct oracle_asm_disk_label *dl; |
@@ -464,7 +464,7 @@ static int probe_oracleasm(int fd __BLKID_ATTR((unused)), | |||
464 | * sboff are in kilobytes and bytes respectively. All magics are in | 464 | * sboff are in kilobytes and bytes respectively. All magics are in |
465 | * byte strings so we don't worry about endian issues. | 465 | * byte strings so we don't worry about endian issues. |
466 | */ | 466 | */ |
467 | static struct blkid_magic type_array[] = { | 467 | static const struct blkid_magic type_array[] = { |
468 | /* type kboff sboff len magic probe */ | 468 | /* type kboff sboff len magic probe */ |
469 | { "oracleasm", 0, 32, 8, "ORCLDISK", probe_oracleasm }, | 469 | { "oracleasm", 0, 32, 8, "ORCLDISK", probe_oracleasm }, |
470 | { "ntfs", 0, 3, 8, "NTFS ", 0 }, | 470 | { "ntfs", 0, 3, 8, "NTFS ", 0 }, |
@@ -534,7 +534,7 @@ static struct blkid_magic type_array[] = { | |||
534 | */ | 534 | */ |
535 | blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev) | 535 | blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev) |
536 | { | 536 | { |
537 | struct blkid_magic *id; | 537 | const struct blkid_magic *id; |
538 | unsigned char *bufs[BLKID_BLK_OFFS + 1], *buf; | 538 | unsigned char *bufs[BLKID_BLK_OFFS + 1], *buf; |
539 | const char *type; | 539 | const char *type; |
540 | struct stat st; | 540 | struct stat st; |
@@ -658,7 +658,7 @@ found_type: | |||
658 | 658 | ||
659 | int blkid_known_fstype(const char *fstype) | 659 | int blkid_known_fstype(const char *fstype) |
660 | { | 660 | { |
661 | struct blkid_magic *id; | 661 | const struct blkid_magic *id; |
662 | 662 | ||
663 | for (id = type_array; id->bim_type; id++) { | 663 | for (id = type_array; id->bim_type; id++) { |
664 | if (strcmp(fstype, id->bim_type) == 0) | 664 | if (strcmp(fstype, id->bim_type) == 0) |
diff --git a/e2fsprogs/blkid/probe.h b/e2fsprogs/blkid/probe.h index 85234e84f..10af5d518 100644 --- a/e2fsprogs/blkid/probe.h +++ b/e2fsprogs/blkid/probe.h | |||
@@ -19,7 +19,7 @@ | |||
19 | struct blkid_magic; | 19 | struct blkid_magic; |
20 | 20 | ||
21 | typedef int (*blkid_probe_t)(int fd, blkid_cache cache, blkid_dev dev, | 21 | typedef int (*blkid_probe_t)(int fd, blkid_cache cache, blkid_dev dev, |
22 | struct blkid_magic *id, unsigned char *buf); | 22 | const struct blkid_magic *id, unsigned char *buf); |
23 | 23 | ||
24 | struct blkid_magic { | 24 | struct blkid_magic { |
25 | const char *bim_type; /* type name for this magic */ | 25 | const char *bim_type; /* type name for this magic */ |