Source-Changes-HG archive

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

[src/trunk]: src/sys/compat/common fix sign-compare issues.



details:   https://anonhg.NetBSD.org/src/rev/fd0a9299e357
branches:  trunk
changeset: 454703:fd0a9299e357
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Sep 26 01:28:27 2019 +0000

description:
fix sign-compare issues.

diffstat:

 sys/compat/common/if_media_80.c     |  6 +++---
 sys/compat/common/rndpseudo_50.c    |  6 +++---
 sys/compat/common/usb_subr_30.c     |  9 +++++----
 sys/compat/common/vfs_syscalls_20.c |  6 +++---
 4 files changed, 14 insertions(+), 13 deletions(-)

diffs (111 lines):

diff -r 9ef21756712c -r fd0a9299e357 sys/compat/common/if_media_80.c
--- a/sys/compat/common/if_media_80.c   Wed Sep 25 23:09:19 2019 +0000
+++ b/sys/compat/common/if_media_80.c   Thu Sep 26 01:28:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_media_80.c,v 1.1 2019/05/17 07:37:11 msaitoh Exp $  */
+/*     $NetBSD: if_media_80.c,v 1.2 2019/09/26 01:28:27 christos Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -126,8 +126,8 @@
 {
        struct ifmediareq *ifmr = (struct ifmediareq *)ifr;
        size_t minwords;
-       int count, *kptr;
-       int error;
+       size_t count;
+       int error, *kptr;
 
        switch (cmd) {
        case SIOCSIFMEDIA:
diff -r 9ef21756712c -r fd0a9299e357 sys/compat/common/rndpseudo_50.c
--- a/sys/compat/common/rndpseudo_50.c  Wed Sep 25 23:09:19 2019 +0000
+++ b/sys/compat/common/rndpseudo_50.c  Thu Sep 26 01:28:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rndpseudo_50.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $        */
+/*     $NetBSD: rndpseudo_50.c,v 1.5 2019/09/26 01:28:27 christos Exp $        */
 
 /*-
  * Copyright (c) 1997-2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rndpseudo_50.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rndpseudo_50.c,v 1.5 2019/09/26 01:28:27 christos Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_compat_netbsd.h"
@@ -76,7 +76,7 @@
        {
                rndstat_t rstbuf = {.start = 0};
                rndstat50_t *rst50 = (rndstat50_t *)addr;
-               int count;
+               size_t count;
 
                if (rst50->count > RND_MAXSTATCOUNT50)
                        return EINVAL;
diff -r 9ef21756712c -r fd0a9299e357 sys/compat/common/usb_subr_30.c
--- a/sys/compat/common/usb_subr_30.c   Wed Sep 25 23:09:19 2019 +0000
+++ b/sys/compat/common/usb_subr_30.c   Thu Sep 26 01:28:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr_30.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $ */
+/*     $NetBSD: usb_subr_30.c,v 1.5 2019/09/26 01:28:27 christos Exp $ */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr_30.c,v 1.4 2019/03/01 11:06:56 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr_30.c,v 1.5 2019/09/26 01:28:27 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -131,7 +131,8 @@
     int (*do_printBCD)(char *cp, size_t l, int bcd))
 {
        struct usbd_port *p;
-       int i, j, err;
+       size_t i, j;
+       int err;
 
        di->udi_bus = device_unit(dev->ud_bus->ub_usbctl);
        di->udi_addr = dev->ud_addr;
@@ -171,7 +172,7 @@
                return 0;
        }
 
-       const int nports = dev->ud_hub->uh_hubdesc.bNbrPorts;
+       const u_int nports = dev->ud_hub->uh_hubdesc.bNbrPorts;
        for (i = 1; i <= __arraycount(di->udi_ports) && i <= nports;
             i++) {
                p = &dev->ud_hub->uh_ports[i - 1];
diff -r 9ef21756712c -r fd0a9299e357 sys/compat/common/vfs_syscalls_20.c
--- a/sys/compat/common/vfs_syscalls_20.c       Wed Sep 25 23:09:19 2019 +0000
+++ b/sys/compat/common/vfs_syscalls_20.c       Thu Sep 26 01:28:27 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: vfs_syscalls_20.c,v 1.42 2019/09/22 22:59:38 christos Exp $    */
+/*     $NetBSD: vfs_syscalls_20.c,v 1.43 2019/09/26 01:28:27 christos Exp $    */
 
 /*
  * Copyright (c) 1989, 1993
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.42 2019/09/22 22:59:38 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: vfs_syscalls_20.c,v 1.43 2019/09/26 01:28:27 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -104,7 +104,7 @@
 {
        struct statfs12 ofs, *bfs = vbfs;
        const struct statvfs *fs = vfs;
-       int i;
+       size_t i;
        ofs.f_type = 0;
        ofs.f_oflags = (short)fs->f_flag;
 



Home | Main Index | Thread Index | Old Index