Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libc/gen/sysctlgetmibinfo.c,v rcsdiff: /ftp/cvs/cvsroot/src/lib/libc/gen/sysctlgetmibinfo.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.6.8.2 retrieving revision 1.7 diff -u -p -r1.6.8.2 -r1.7 --- src/lib/libc/gen/sysctlgetmibinfo.c 2008/04/29 06:53:02 1.6.8.2 +++ src/lib/libc/gen/sysctlgetmibinfo.c 2009/02/12 04:13:08 1.7 @@ -1,4 +1,4 @@ -/* $NetBSD: sysctlgetmibinfo.c,v 1.6.8.2 2008/04/29 06:53:02 martin Exp $ */ +/* $NetBSD: sysctlgetmibinfo.c,v 1.7 2009/02/12 04:13:08 lukem Exp $ */ /*- * Copyright (c) 2003,2004 The NetBSD Foundation, Inc. @@ -31,7 +31,7 @@ #include #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: sysctlgetmibinfo.c,v 1.6.8.2 2008/04/29 06:53:02 martin Exp $"); +__RCSID("$NetBSD: sysctlgetmibinfo.c,v 1.7 2009/02/12 04:13:08 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ #include "namespace.h" @@ -124,7 +124,8 @@ relearnhead(void) { struct sysctlnode *h, *i, *o, qnode; size_t si, so; - int rc, name, nlen, olen, ni, oi, t; + int rc, name, nlen, olen, ni, oi; + uint32_t t; /* * if there's nothing there, there's no need to expend any @@ -264,7 +265,7 @@ int __learn_tree(int *name, u_int namelen, struct sysctlnode *pnode) { struct sysctlnode qnode; - int rc; + uint32_t rc; size_t sz; if (pnode == NULL) @@ -398,8 +399,8 @@ sysctlgetmibinfo_unlocked(const char *gn #endif /* _REENTRANT */ { struct sysctlnode *pnode, *node; - int name[CTL_MAXNAME], ni, n, haven; - u_int nl; + int name[CTL_MAXNAME], n, haven; + u_int ni, nl; intmax_t q; char sep[2], token[SYSCTL_NAMELEN], pname[SYSCTL_NAMELEN * CTL_MAXNAME + CTL_MAXNAME]; @@ -417,7 +418,7 @@ sysctlgetmibinfo_unlocked(const char *gn } else { /* this is just someone being silly */ - if (SYSCTL_VERS((*rnode)->sysctl_flags) != v) + if (SYSCTL_VERS((*rnode)->sysctl_flags) != (uint32_t)v) return (EINVAL); /* XXX later deal with other people's trees */ @@ -476,7 +477,7 @@ sysctlgetmibinfo_unlocked(const char *gn return (-1); } } - else if (dot - piece > sizeof(token) - 1) { + else if (dot - piece > (intptr_t)(sizeof(token) - 1)) { COPY_OUT_DATA(token, cname, csz, namelenp, nl); errno = ENAMETOOLONG; return (-1);