summaryrefslogtreecommitdiffstats
path: root/fdisk/fdiskbsdlabel.c
diff options
context:
space:
mode:
authorJosiah Worcester2011-06-09 00:52:43 +0200
committerKarel Zak2011-06-14 13:58:33 +0200
commit95961ee294a7ced0c5911b66d863a880e8f8b386 (patch)
tree889df1cf1542588da4c847445a19a534ab096284 /fdisk/fdiskbsdlabel.c
parentlibmount: add mount support for loopdevs (diff)
downloadkernel-qcow2-util-linux-95961ee294a7ced0c5911b66d863a880e8f8b386.tar.gz
kernel-qcow2-util-linux-95961ee294a7ced0c5911b66d863a880e8f8b386.tar.xz
kernel-qcow2-util-linux-95961ee294a7ced0c5911b66d863a880e8f8b386.zip
fdisk, display, hexdump.h: Use standard C types instead of u_int, u_char, u_long, etc.
Signed-off-by: Josiah Worcester <josiahw@gmail.com>
Diffstat (limited to 'fdisk/fdiskbsdlabel.c')
-rw-r--r--fdisk/fdiskbsdlabel.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/fdisk/fdiskbsdlabel.c b/fdisk/fdiskbsdlabel.c
index 0c3810d47..d379b70ab 100644
--- a/fdisk/fdiskbsdlabel.c
+++ b/fdisk/fdiskbsdlabel.c
@@ -71,7 +71,7 @@ static void xbsd_change_fstype (void);
static int xbsd_get_part_index (int max);
static int xbsd_check_new_partition (int *i);
static void xbsd_list_types (void);
-static u_short xbsd_dkcksum (struct xbsd_disklabel *lp);
+static unsigned short xbsd_dkcksum (struct xbsd_disklabel *lp);
static int xbsd_initlabel (struct partition *p, struct xbsd_disklabel *d,
int pindex);
static int xbsd_readlabel (struct partition *p, struct xbsd_disklabel *d);
@@ -463,28 +463,28 @@ xbsd_edit_disklabel (void)
d = &xbsd_dlabel;
#if defined (__alpha__) || defined (__ia64__)
- d -> d_secsize = (u_long) edit_int ((u_long) d -> d_secsize ,_("bytes/sector"));
- d -> d_nsectors = (u_long) edit_int ((u_long) d -> d_nsectors ,_("sectors/track"));
- d -> d_ntracks = (u_long) edit_int ((u_long) d -> d_ntracks ,_("tracks/cylinder"));
- d -> d_ncylinders = (u_long) edit_int ((u_long) d -> d_ncylinders ,_("cylinders"));
+ d -> d_secsize = (unsigned long) edit_int ((unsigned long) d -> d_secsize ,_("bytes/sector"));
+ d -> d_nsectors = (unsigned long) edit_int ((unsigned long) d -> d_nsectors ,_("sectors/track"));
+ d -> d_ntracks = (unsigned long) edit_int ((unsigned long) d -> d_ntracks ,_("tracks/cylinder"));
+ d -> d_ncylinders = (unsigned long) edit_int ((unsigned long) d -> d_ncylinders ,_("cylinders"));
#endif
/* d -> d_secpercyl can be != d -> d_nsectors * d -> d_ntracks */
while (1)
{
- d -> d_secpercyl = (u_long) edit_int ((u_long) d -> d_nsectors * d -> d_ntracks,
+ d -> d_secpercyl = (unsigned long) edit_int ((unsigned long) d -> d_nsectors * d -> d_ntracks,
_("sectors/cylinder"));
if (d -> d_secpercyl <= d -> d_nsectors * d -> d_ntracks)
break;
printf (_("Must be <= sectors/track * tracks/cylinder (default).\n"));
}
- d -> d_rpm = (u_short) edit_int ((u_short) d -> d_rpm ,_("rpm"));
- d -> d_interleave = (u_short) edit_int ((u_short) d -> d_interleave,_("interleave"));
- d -> d_trackskew = (u_short) edit_int ((u_short) d -> d_trackskew ,_("trackskew"));
- d -> d_cylskew = (u_short) edit_int ((u_short) d -> d_cylskew ,_("cylinderskew"));
- d -> d_headswitch = (u_long) edit_int ((u_long) d -> d_headswitch ,_("headswitch"));
- d -> d_trkseek = (u_long) edit_int ((u_long) d -> d_trkseek ,_("track-to-track seek"));
+ d -> d_rpm = (unsigned short) edit_int ((unsigned short) d -> d_rpm ,_("rpm"));
+ d -> d_interleave = (unsigned short) edit_int ((unsigned short) d -> d_interleave,_("interleave"));
+ d -> d_trackskew = (unsigned short) edit_int ((unsigned short) d -> d_trackskew ,_("trackskew"));
+ d -> d_cylskew = (unsigned short) edit_int ((unsigned short) d -> d_cylskew ,_("cylinderskew"));
+ d -> d_headswitch = (unsigned long) edit_int ((unsigned long) d -> d_headswitch ,_("headswitch"));
+ d -> d_trkseek = (unsigned long) edit_int ((unsigned long) d -> d_trkseek ,_("track-to-track seek"));
d -> d_secperunit = d -> d_secpercyl * d -> d_ncylinders;
}
@@ -638,13 +638,13 @@ xbsd_list_types (void) {
list_types (xbsd_fstypes);
}
-static u_short
+static unsigned short
xbsd_dkcksum (struct xbsd_disklabel *lp) {
- u_short *start, *end;
- u_short sum = 0;
+ unsigned short *start, *end;
+ unsigned short sum = 0;
- start = (u_short *) lp;
- end = (u_short *) &lp->d_partitions[lp->d_npartitions];
+ start = (unsigned short *) lp;
+ end = (unsigned short *) &lp->d_partitions[lp->d_npartitions];
while (start < end)
sum ^= *start++;
return sum;