Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic remove unnecessary casts, make variable types con...



details:   https://anonhg.NetBSD.org/src/rev/fdc16ff78215
branches:  trunk
changeset: 513610:fdc16ff78215
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Aug 05 11:09:51 2001 +0000

description:
remove unnecessary casts, make variable types consistent with the
respective wsdisplay_cmap member
no functional change, stylistic only

diffstat:

 sys/dev/ic/bt463.c |   9 +++++----
 sys/dev/ic/bt485.c |  20 ++++++++++----------
 2 files changed, 15 insertions(+), 14 deletions(-)

diffs (80 lines):

diff -r 93d138eb02a8 -r fdc16ff78215 sys/dev/ic/bt463.c
--- a/sys/dev/ic/bt463.c        Sun Aug 05 10:52:05 2001 +0000
+++ b/sys/dev/ic/bt463.c        Sun Aug 05 11:09:51 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bt463.c,v 1.3 2000/06/28 17:12:55 mrg Exp $ */
+/* $NetBSD: bt463.c,v 1.4 2001/08/05 11:09:51 jdolecek Exp $ */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -361,10 +361,11 @@
        struct wsdisplay_cmap *cmapp;
 {
        struct bt463data *data = (struct bt463data *)rc;
-       int count, index, s;
+       u_int count, index;
+       int s;
 
-       if ((u_int)cmapp->index >= BT463_NCMAP_ENTRIES ||
-           ((u_int)cmapp->index + (u_int)cmapp->count) > BT463_NCMAP_ENTRIES)
+       if (cmapp->index >= BT463_NCMAP_ENTRIES ||
+           (cmapp->index + cmapp->count) > BT463_NCMAP_ENTRIES)
                return (EINVAL);
        if (!uvm_useracc(cmapp->red, cmapp->count, B_READ) ||
            !uvm_useracc(cmapp->green, cmapp->count, B_READ) ||
diff -r 93d138eb02a8 -r fdc16ff78215 sys/dev/ic/bt485.c
--- a/sys/dev/ic/bt485.c        Sun Aug 05 10:52:05 2001 +0000
+++ b/sys/dev/ic/bt485.c        Sun Aug 05 11:09:51 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: bt485.c,v 1.4 2001/07/07 16:13:47 thorpej Exp $ */
+/* $NetBSD: bt485.c,v 1.5 2001/08/05 11:09:51 jdolecek Exp $ */
 
 /*
  * Copyright (c) 1995, 1996 Carnegie-Mellon University.
@@ -259,10 +259,10 @@
        struct wsdisplay_cmap *cmapp;
 {
        struct bt485data *data = (struct bt485data *)rc;
-       int count, index, s;
+       u_int count, index;
+       int s;
 
-       if ((u_int)cmapp->index >= 256 ||
-           ((u_int)cmapp->index + (u_int)cmapp->count) > 256)
+       if (cmapp->index >= 256 || (cmapp->index + cmapp->count) > 256)
                return (EINVAL);
        if (!uvm_useracc(cmapp->red, cmapp->count, B_READ) ||
            !uvm_useracc(cmapp->green, cmapp->count, B_READ) ||
@@ -316,7 +316,8 @@
        struct wsdisplay_cursor *cursorp;
 {
        struct bt485data *data = (struct bt485data *)rc;
-       int count, index, v, s;
+       u_int count, index, v;
+       int s;
 
        v = cursorp->which;
 
@@ -325,9 +326,8 @@
         * before we do anything that we can't recover from.
         */
        if (v & WSDISPLAY_CURSOR_DOCMAP) {
-               if ((u_int)cursorp->cmap.index > 2 ||
-                   ((u_int)cursorp->cmap.index +
-                    (u_int)cursorp->cmap.count) > 2)
+               if (cursorp->cmap.index > 2 ||
+                   (cursorp->cmap.index + cursorp->cmap.count) > 2)
                        return (EINVAL);
                count = cursorp->cmap.count;
                if (!uvm_useracc(cursorp->cmap.red, count, B_READ) ||
@@ -336,8 +336,8 @@
                        return (EFAULT);
        }
        if (v & WSDISPLAY_CURSOR_DOSHAPE) {
-               if ((u_int)cursorp->size.x > CURSOR_MAX_SIZE ||
-                   (u_int)cursorp->size.y > CURSOR_MAX_SIZE)
+               if (cursorp->size.x > CURSOR_MAX_SIZE ||
+                   cursorp->size.y > CURSOR_MAX_SIZE)
                        return (EINVAL);
                count = (CURSOR_MAX_SIZE / NBBY) * data->cursize.y;
                if (!uvm_useracc(cursorp->image, count, B_READ) ||



Home | Main Index | Thread Index | Old Index