aboutsummaryrefslogtreecommitdiff
path: root/util-linux/fdisk_osf.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-25 10:55:35 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-25 10:55:35 +0000
commit80b8b39899a09c7516920cda5fd343b3086d4824 (patch)
treeaa9903fd6b64d19c5f640fa302272d85c92b204e /util-linux/fdisk_osf.c
parent1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff)
downloadbusybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz
busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.bz2
busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.zip
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'util-linux/fdisk_osf.c')
-rw-r--r--util-linux/fdisk_osf.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/util-linux/fdisk_osf.c b/util-linux/fdisk_osf.c
index afb8459a2..9f0dc7fd3 100644
--- a/util-linux/fdisk_osf.c
+++ b/util-linux/fdisk_osf.c
@@ -163,7 +163,7 @@ static const char * const xbsd_dktypenames[] = {
163 "floppy", 163 "floppy",
164 0 164 0
165}; 165};
166#define BSD_DKMAXTYPES (sizeof(xbsd_dktypenames) / sizeof(xbsd_dktypenames[0]) - 1) 166
167 167
168/* 168/*
169 * Filesystem type and version. 169 * Filesystem type and version.
@@ -219,7 +219,6 @@ static const char *const xbsd_fstypes[] = {
219 "\x10" "AdvFS", /* BSD_FS_ADVFS */ 219 "\x10" "AdvFS", /* BSD_FS_ADVFS */
220 NULL 220 NULL
221}; 221};
222#define BSD_FSMAXTYPES (SIZE(xbsd_fstypes)-1)
223 222
224 223
225/* 224/*
@@ -509,7 +508,7 @@ xbsd_print_disklabel(int show_all)
509#else 508#else
510 printf("# %s:\n", partname(disk_device, xbsd_part_index+1, 0)); 509 printf("# %s:\n", partname(disk_device, xbsd_part_index+1, 0));
511#endif 510#endif
512 if ((unsigned) lp->d_type < BSD_DKMAXTYPES) 511 if ((unsigned) lp->d_type < ARRAY_SIZE(xbsd_dktypenames)-1)
513 printf("type: %s\n", xbsd_dktypenames[lp->d_type]); 512 printf("type: %s\n", xbsd_dktypenames[lp->d_type]);
514 else 513 else
515 printf("type: %d\n", lp->d_type); 514 printf("type: %d\n", lp->d_type);
@@ -571,7 +570,7 @@ xbsd_print_disklabel(int show_all)
571 ); 570 );
572 } 571 }
573 572
574 if ((unsigned) pp->p_fstype < BSD_FSMAXTYPES) 573 if ((unsigned) pp->p_fstype < ARRAY_SIZE(xbsd_fstypes)-1)
575 printf("%8.8s", xbsd_fstypes[pp->p_fstype]); 574 printf("%8.8s", xbsd_fstypes[pp->p_fstype]);
576 else 575 else
577 printf("%8x", pp->p_fstype); 576 printf("%8x", pp->p_fstype);