u_short -> uint16_t
This commit is contained in:
parent
54cc3da266
commit
f2b0a44663
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: util.h,v 1.34 2005/01/12 03:33:11 christos Exp $ */
|
||||
/* $NetBSD: util.h,v 1.35 2005/05/15 21:01:34 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1995
|
||||
@ -105,7 +105,7 @@ int ttylock(const char *, int, pid_t *);
|
||||
char *ttymsg(struct iovec *, int, const char *, int);
|
||||
int ttyunlock(const char *);
|
||||
|
||||
u_short disklabel_dkcksum(struct disklabel *);
|
||||
uint16_t disklabel_dkcksum(struct disklabel *);
|
||||
int disklabel_scan(struct disklabel *, char *, size_t);
|
||||
__END_DECLS
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: disklabel_dkcksum.3,v 1.4 2003/04/16 13:35:14 wiz Exp $
|
||||
.\" $NetBSD: disklabel_dkcksum.3,v 1.5 2005/05/15 21:01:34 thorpej Exp $
|
||||
.\"
|
||||
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||
.\" All rights reserved.
|
||||
@ -34,7 +34,7 @@
|
||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd October 12, 2002
|
||||
.Dd MAy 15, 2005
|
||||
.Dt DISKLABEL_DKCKSUM 3
|
||||
.Os
|
||||
.Sh NAME
|
||||
@ -44,7 +44,7 @@
|
||||
.Lb libutil
|
||||
.Sh SYNOPSIS
|
||||
.In util.h
|
||||
.Ft u_short
|
||||
.Ft uint16_t
|
||||
.Fo disklabel_dkcksum
|
||||
.Fa "struct disklabel *lp"
|
||||
.Fc
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: disklabel_dkcksum.c,v 1.3 2003/10/25 07:31:27 christos Exp $ */
|
||||
/* $NetBSD: disklabel_dkcksum.c,v 1.4 2005/05/15 21:01:34 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1991, 1993
|
||||
@ -34,7 +34,7 @@
|
||||
#if 0
|
||||
static char sccsid[] = "@(#)dkcksum.c 8.1 (Berkeley) 6/5/93";
|
||||
#else
|
||||
__RCSID("$NetBSD: disklabel_dkcksum.c,v 1.3 2003/10/25 07:31:27 christos Exp $");
|
||||
__RCSID("$NetBSD: disklabel_dkcksum.c,v 1.4 2005/05/15 21:01:34 thorpej Exp $");
|
||||
#endif
|
||||
#endif /* not lint */
|
||||
|
||||
@ -43,15 +43,15 @@ __RCSID("$NetBSD: disklabel_dkcksum.c,v 1.3 2003/10/25 07:31:27 christos Exp $")
|
||||
|
||||
#include <util.h>
|
||||
|
||||
u_short
|
||||
uint16_t
|
||||
disklabel_dkcksum(struct disklabel *lp)
|
||||
{
|
||||
u_short *start, *end;
|
||||
u_short sum;
|
||||
uint16_t *start, *end;
|
||||
uint16_t sum;
|
||||
|
||||
sum = 0;
|
||||
start = (u_short *)(void *)lp;
|
||||
end = (u_short *)(void *)&lp->d_partitions[lp->d_npartitions];
|
||||
start = (uint16_t *)(void *)lp;
|
||||
end = (uint16_t *)(void *)&lp->d_partitions[lp->d_npartitions];
|
||||
while (start < end)
|
||||
sum ^= *start++;
|
||||
return (sum);
|
||||
|
Loading…
Reference in New Issue
Block a user