Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ddb Fix signed/unsigned comparison warnings.



details:   https://anonhg.NetBSD.org/src/rev/e659276e28c5
branches:  trunk
changeset: 539168:e659276e28c5
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Nov 10 03:12:17 2002 +0000

description:
Fix signed/unsigned comparison warnings.

diffstat:

 sys/ddb/db_elf.c   |  8 ++++----
 sys/ddb/db_print.c |  7 ++++---
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (64 lines):

diff -r 2ac804e47b3f -r e659276e28c5 sys/ddb/db_elf.c
--- a/sys/ddb/db_elf.c  Sun Nov 10 02:27:50 2002 +0000
+++ b/sys/ddb/db_elf.c  Sun Nov 10 03:12:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_elf.c,v 1.20 2002/02/15 07:33:50 simonb Exp $       */
+/*     $NetBSD: db_elf.c,v 1.21 2002/11/10 03:12:17 thorpej Exp $      */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -38,7 +38,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_elf.c,v 1.20 2002/02/15 07:33:50 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_elf.c,v 1.21 2002/11/10 03:12:17 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -284,7 +284,7 @@
 #endif
 
                if (off >= symp->st_value) {
-                       if ((off - symp->st_value) < diff) {
+                       if ((db_expr_t)(off - symp->st_value) < diff) {
                                diff = off - symp->st_value;
                                rsymp = symp;
                                if (diff == 0) {
@@ -299,7 +299,7 @@
                                              != STB_LOCAL)
                                                break;
                                }
-                       } else if ((off - symp->st_value) == diff) {
+                       } else if ((db_expr_t)(off - symp->st_value) == diff) {
                                if (rsymp == NULL)
                                        rsymp = symp;
                                else if (ELFDEFNNAME(ST_BIND)(rsymp->st_info)
diff -r 2ac804e47b3f -r e659276e28c5 sys/ddb/db_print.c
--- a/sys/ddb/db_print.c        Sun Nov 10 02:27:50 2002 +0000
+++ b/sys/ddb/db_print.c        Sun Nov 10 03:12:17 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_print.c,v 1.18 2002/02/15 07:33:52 simonb Exp $     */
+/*     $NetBSD: db_print.c,v 1.19 2002/11/10 03:14:41 thorpej Exp $    */
 
 /*
  * Mach Operating System
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_print.c,v 1.18 2002/02/15 07:33:52 simonb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_print.c,v 1.19 2002/11/10 03:14:41 thorpej Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -62,7 +62,8 @@
                db_read_variable(&vs, &value);
                db_printf("%-12s%s", vs.name, db_num_to_str(value));
                db_find_xtrn_sym_and_offset((db_addr_t)value, &name, &offset);
-               if (name != 0 && offset <= db_maxoff && offset != value) {
+               if (name != NULL &&
+                   (unsigned int) offset <= db_maxoff && offset != value) {
                        db_printf("\t%s", name);
                        if (offset != 0) {
                                char tbuf[24];



Home | Main Index | Thread Index | Old Index