fix sign-compare issues

This commit is contained in:
lukem 2009-04-12 11:23:12 +00:00
parent 39a84db38a
commit e72a1356ea
2 changed files with 13 additions and 13 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kdump.c,v 1.102 2009/01/11 03:05:41 christos Exp $ */
/* $NetBSD: kdump.c,v 1.103 2009/04/12 11:23:12 lukem Exp $ */
/*-
* Copyright (c) 1988, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: kdump.c,v 1.102 2009/01/11 03:05:41 christos Exp $");
__RCSID("$NetBSD: kdump.c,v 1.103 2009/04/12 11:23:12 lukem Exp $");
#endif
#endif /* not lint */
@ -542,21 +542,21 @@ ktrsyscall(struct ktr_syscall *ktr)
if (strcmp(emul->name, "linux") == 0 ||
strcmp(emul->name, "linux32") == 0) {
if ((long)*ap >= 0 && *ap <
sizeof(linux_ptrace_ops) /
sizeof(linux_ptrace_ops[0]))
(register_t)(sizeof(linux_ptrace_ops) /
sizeof(linux_ptrace_ops[0])))
(void)printf("%s",
linux_ptrace_ops[*ap]);
else
output_long((long)*ap, 1);
} else {
if ((long)*ap >= 0 && *ap <
sizeof(ptrace_ops) / sizeof(ptrace_ops[0]))
(register_t)(sizeof(ptrace_ops) / sizeof(ptrace_ops[0])))
(void)printf("%s", ptrace_ops[*ap]);
#ifdef PT_MACHDEP_STRINGS
else if (*ap >= PT_FIRSTMACH &&
*ap - PT_FIRSTMACH <
sizeof(ptrace_machdep_ops) /
sizeof(ptrace_machdep_ops[0]))
(register_t)(sizeof(ptrace_machdep_ops) /
sizeof(ptrace_machdep_ops[0])))
(void)printf("%s", ptrace_machdep_ops[*ap - PT_FIRSTMACH]);
#endif
else
@ -602,7 +602,7 @@ ktrsysret(struct ktr_sysret *ktr, int len)
switch (error) {
case 0:
rprint(ktr->ktr_retval);
if (len > offsetof(struct ktr_sysret, ktr_retval_1) &&
if (len > (int)offsetof(struct ktr_sysret, ktr_retval_1) &&
ktr->ktr_retval_1 != 0) {
(void)printf(", ");
rprint(ktr->ktr_retval_1);
@ -1035,7 +1035,7 @@ ktrmool(struct ktr_mool *mool, int len)
static void
ktrmib(int *namep, int len)
{
int i;
size_t i;
for (i = 0; i < (len / sizeof(*namep)); i++)
printf("%s%d", (i == 0) ? "" : ".", namep[i]);

View File

@ -1,4 +1,4 @@
/* $NetBSD: dump.c,v 1.32 2009/01/11 03:05:23 christos Exp $ */
/* $NetBSD: dump.c,v 1.33 2009/04/12 11:24:18 lukem Exp $ */
/*-
* Copyright (c) 1988, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#endif
__RCSID("$NetBSD: dump.c,v 1.32 2009/01/11 03:05:23 christos Exp $");
__RCSID("$NetBSD: dump.c,v 1.33 2009/04/12 11:24:18 lukem Exp $");
#endif /* not lint */
#include <sys/param.h>
@ -573,7 +573,7 @@ syscallprint(struct ktr_header *kth)
case SYS_ptrace :
if ((long)*ap >= 0 &&
*ap < sizeof(ptrace_ops) / sizeof(ptrace_ops[0]))
*ap < (register_t)(sizeof(ptrace_ops) / sizeof(ptrace_ops[0])))
wprintf("(%s", ptrace_ops[*ap]);
else
wprintf("(%ld", (long)*ap);
@ -637,7 +637,7 @@ sysretprint(struct ktr_header *kth)
break;
default:
wprintf(" = %ld", (long)ret);
if (kth->ktr_len > offsetof(struct ktr_sysret,
if (kth->ktr_len > (int)offsetof(struct ktr_sysret,
ktr_retval_1) && ktr->ktr_retval_1 != 0)
wprintf(", %ld", (long)ktr->ktr_retval_1);
break;