Make hashinit() use unsigned quantities throughout.
This commit is contained in:
parent
56999645f0
commit
f02cb5ee27
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: kern_subr.c,v 1.83 2002/08/23 20:50:25 matt Exp $ */
|
||||
/* $NetBSD: kern_subr.c,v 1.84 2002/08/25 20:01:13 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1997, 1998, 1999, 2002 The NetBSD Foundation, Inc.
|
||||
@ -90,7 +90,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.83 2002/08/23 20:50:25 matt Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.84 2002/08/25 20:01:13 thorpej Exp $");
|
||||
|
||||
#include "opt_ddb.h"
|
||||
#include "opt_md.h"
|
||||
@ -320,18 +320,18 @@ copyout_proc(struct proc *p, const void *kaddr, void *uaddr, size_t len)
|
||||
*/
|
||||
void *
|
||||
hashinit(elements, htype, mtype, mflags, hashmask)
|
||||
int elements;
|
||||
u_int elements;
|
||||
enum hashtype htype;
|
||||
int mtype, mflags;
|
||||
u_long *hashmask;
|
||||
{
|
||||
long hashsize;
|
||||
u_long hashsize, i;
|
||||
LIST_HEAD(, generic) *hashtbl_list;
|
||||
TAILQ_HEAD(, generic) *hashtbl_tailq;
|
||||
int i, esize;
|
||||
size_t esize;
|
||||
void *p;
|
||||
|
||||
if (elements <= 0)
|
||||
if (elements == 0)
|
||||
panic("hashinit: bad cnt");
|
||||
for (hashsize = 1; hashsize < elements; hashsize <<= 1)
|
||||
continue;
|
||||
@ -349,7 +349,7 @@ hashinit(elements, htype, mtype, mflags, hashmask)
|
||||
#endif
|
||||
}
|
||||
|
||||
if ((p = malloc((u_long)hashsize * esize, mtype, mflags)) == NULL)
|
||||
if ((p = malloc(hashsize * esize, mtype, mflags)) == NULL)
|
||||
return (NULL);
|
||||
|
||||
switch (htype) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: systm.h,v 1.147 2002/08/07 05:16:28 briggs Exp $ */
|
||||
/* $NetBSD: systm.h,v 1.148 2002/08/25 20:01:12 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1982, 1988, 1991, 1993
|
||||
@ -178,7 +178,7 @@ enum hashtype {
|
||||
HASH_TAILQ
|
||||
};
|
||||
|
||||
void *hashinit __P((int, enum hashtype, int, int, u_long *));
|
||||
void *hashinit __P((u_int, enum hashtype, int, int, u_long *));
|
||||
void hashdone __P((void *, int));
|
||||
int seltrue __P((dev_t, int, struct proc *));
|
||||
int sys_nosys __P((struct proc *, void *, register_t *));
|
||||
|
Loading…
Reference in New Issue
Block a user