diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 10:55:35 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-06-25 10:55:35 +0000 |
commit | 80b8b39899a09c7516920cda5fd343b3086d4824 (patch) | |
tree | aa9903fd6b64d19c5f640fa302272d85c92b204e /util-linux/fdisk_sun.c | |
parent | 1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff) | |
download | busybox-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_sun.c')
-rw-r--r-- | util-linux/fdisk_sun.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/util-linux/fdisk_sun.c b/util-linux/fdisk_sun.c index 2fa7b2b86..d4614fd4f 100644 --- a/util-linux/fdisk_sun.c +++ b/util-linux/fdisk_sun.c | |||
@@ -207,7 +207,7 @@ sun_autoconfigure_scsi(void) | |||
207 | if (!q) | 207 | if (!q) |
208 | break; | 208 | break; |
209 | *q = '\0'; | 209 | *q = '\0'; |
210 | for (i = 0; i < SIZE(sun_drives); i++) { | 210 | for (i = 0; i < ARRAY_SIZE(sun_drives); i++) { |
211 | if (*sun_drives[i].vendor && strcasecmp(sun_drives[i].vendor, vendor)) | 211 | if (*sun_drives[i].vendor && strcasecmp(sun_drives[i].vendor, vendor)) |
212 | continue; | 212 | continue; |
213 | if (!strstr(model, sun_drives[i].model)) | 213 | if (!strstr(model, sun_drives[i].model)) |
@@ -244,7 +244,7 @@ create_sunlabel(void) | |||
244 | puts("Drive type\n" | 244 | puts("Drive type\n" |
245 | " ? auto configure\n" | 245 | " ? auto configure\n" |
246 | " 0 custom (with hardware detected defaults)"); | 246 | " 0 custom (with hardware detected defaults)"); |
247 | for (i = 0; i < SIZE(sun_drives); i++) { | 247 | for (i = 0; i < ARRAY_SIZE(sun_drives); i++) { |
248 | printf(" %c %s%s%s\n", | 248 | printf(" %c %s%s%s\n", |
249 | i + 'a', sun_drives[i].vendor, | 249 | i + 'a', sun_drives[i].vendor, |
250 | (*sun_drives[i].vendor) ? " " : "", | 250 | (*sun_drives[i].vendor) ? " " : "", |
@@ -255,11 +255,11 @@ create_sunlabel(void) | |||
255 | if (c == '0') { | 255 | if (c == '0') { |
256 | break; | 256 | break; |
257 | } | 257 | } |
258 | if (c >= 'a' && c < 'a' + SIZE(sun_drives)) { | 258 | if (c >= 'a' && c < 'a' + ARRAY_SIZE(sun_drives)) { |
259 | p = sun_drives + c - 'a'; | 259 | p = sun_drives + c - 'a'; |
260 | break; | 260 | break; |
261 | } | 261 | } |
262 | if (c >= 'A' && c < 'A' + SIZE(sun_drives)) { | 262 | if (c >= 'A' && c < 'A' + ARRAY_SIZE(sun_drives)) { |
263 | p = sun_drives + c - 'A'; | 263 | p = sun_drives + c - 'A'; |
264 | break; | 264 | break; |
265 | } | 265 | } |
@@ -446,7 +446,7 @@ verify_sun(void) | |||
446 | else | 446 | else |
447 | array[i] = -1; | 447 | array[i] = -1; |
448 | } | 448 | } |
449 | qsort(array,SIZE(array),sizeof(array[0]), | 449 | qsort(array, ARRAY_SIZE(array), sizeof(array[0]), |
450 | (int (*)(const void *,const void *)) verify_sun_cmp); | 450 | (int (*)(const void *,const void *)) verify_sun_cmp); |
451 | if (array[0] == -1) { | 451 | if (array[0] == -1) { |
452 | printf("No partitions defined\n"); | 452 | printf("No partitions defined\n"); |