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
|
* Copyright (c) 1995
|
||||||
@ -105,7 +105,7 @@ int ttylock(const char *, int, pid_t *);
|
|||||||
char *ttymsg(struct iovec *, int, const char *, int);
|
char *ttymsg(struct iovec *, int, const char *, int);
|
||||||
int ttyunlock(const char *);
|
int ttyunlock(const char *);
|
||||||
|
|
||||||
u_short disklabel_dkcksum(struct disklabel *);
|
uint16_t disklabel_dkcksum(struct disklabel *);
|
||||||
int disklabel_scan(struct disklabel *, char *, size_t);
|
int disklabel_scan(struct disklabel *, char *, size_t);
|
||||||
__END_DECLS
|
__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.
|
.\" Copyright (c) 2002 The NetBSD Foundation, Inc.
|
||||||
.\" All rights reserved.
|
.\" All rights reserved.
|
||||||
@ -34,7 +34,7 @@
|
|||||||
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
.\" POSSIBILITY OF SUCH DAMAGE.
|
.\" POSSIBILITY OF SUCH DAMAGE.
|
||||||
.\"
|
.\"
|
||||||
.Dd October 12, 2002
|
.Dd MAy 15, 2005
|
||||||
.Dt DISKLABEL_DKCKSUM 3
|
.Dt DISKLABEL_DKCKSUM 3
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -44,7 +44,7 @@
|
|||||||
.Lb libutil
|
.Lb libutil
|
||||||
.Sh SYNOPSIS
|
.Sh SYNOPSIS
|
||||||
.In util.h
|
.In util.h
|
||||||
.Ft u_short
|
.Ft uint16_t
|
||||||
.Fo disklabel_dkcksum
|
.Fo disklabel_dkcksum
|
||||||
.Fa "struct disklabel *lp"
|
.Fa "struct disklabel *lp"
|
||||||
.Fc
|
.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
|
* Copyright (c) 1991, 1993
|
||||||
@ -34,7 +34,7 @@
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)dkcksum.c 8.1 (Berkeley) 6/5/93";
|
static char sccsid[] = "@(#)dkcksum.c 8.1 (Berkeley) 6/5/93";
|
||||||
#else
|
#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
|
||||||
#endif /* not lint */
|
#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>
|
#include <util.h>
|
||||||
|
|
||||||
u_short
|
uint16_t
|
||||||
disklabel_dkcksum(struct disklabel *lp)
|
disklabel_dkcksum(struct disklabel *lp)
|
||||||
{
|
{
|
||||||
u_short *start, *end;
|
uint16_t *start, *end;
|
||||||
u_short sum;
|
uint16_t sum;
|
||||||
|
|
||||||
sum = 0;
|
sum = 0;
|
||||||
start = (u_short *)(void *)lp;
|
start = (uint16_t *)(void *)lp;
|
||||||
end = (u_short *)(void *)&lp->d_partitions[lp->d_npartitions];
|
end = (uint16_t *)(void *)&lp->d_partitions[lp->d_npartitions];
|
||||||
while (start < end)
|
while (start < end)
|
||||||
sum ^= *start++;
|
sum ^= *start++;
|
||||||
return (sum);
|
return (sum);
|
||||||
|
Loading…
Reference in New Issue
Block a user