Source-Changes-HG archive

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

[src/trunk]: src/lib/libc/db/recno Fix signed/unsigned comparison warnings.



details:   https://anonhg.NetBSD.org/src/rev/6437e1806505
branches:  trunk
changeset: 539230:6437e1806505
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Nov 11 20:05:53 2002 +0000

description:
Fix signed/unsigned comparison warnings.

diffstat:

 lib/libc/db/recno/rec_close.c |  10 ++++++----
 lib/libc/db/recno/rec_put.c   |   6 +++---
 2 files changed, 9 insertions(+), 7 deletions(-)

diffs (65 lines):

diff -r 28a1d99f2e6b -r 6437e1806505 lib/libc/db/recno/rec_close.c
--- a/lib/libc/db/recno/rec_close.c     Mon Nov 11 19:49:00 2002 +0000
+++ b/lib/libc/db/recno/rec_close.c     Mon Nov 11 20:05:53 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rec_close.c,v 1.10 1998/08/18 23:50:09 thorpej Exp $   */
+/*     $NetBSD: rec_close.c,v 1.11 2002/11/11 20:05:53 thorpej Exp $   */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)rec_close.c        8.6 (Berkeley) 8/18/94";
 #else
-__RCSID("$NetBSD: rec_close.c,v 1.10 1998/08/18 23:50:09 thorpej Exp $");
+__RCSID("$NetBSD: rec_close.c,v 1.11 2002/11/11 20:05:53 thorpej Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -160,7 +160,8 @@
                 */
                status = (dbp->seq)(dbp, &key, &data, R_FIRST);
                while (status == RET_SUCCESS) {
-                       if (write(t->bt_rfd, data.data, data.size) != data.size)
+                       if (write(t->bt_rfd, data.data, data.size) !=
+                           (ssize_t) data.size)
                                return (RET_ERROR);
                        status = (dbp->seq)(dbp, &key, &data, R_NEXT);
                }
@@ -172,7 +173,8 @@
                while (status == RET_SUCCESS) {
                        iov[0].iov_base = data.data;
                        iov[0].iov_len = data.size;
-                       if (writev(t->bt_rfd, iov, 2) != data.size + 1)
+                       if (writev(t->bt_rfd, iov, 2) !=
+                           (ssize_t) (data.size + 1))
                                return (RET_ERROR);
                        status = (dbp->seq)(dbp, &key, &data, R_NEXT);
                }
diff -r 28a1d99f2e6b -r 6437e1806505 lib/libc/db/recno/rec_put.c
--- a/lib/libc/db/recno/rec_put.c       Mon Nov 11 19:49:00 2002 +0000
+++ b/lib/libc/db/recno/rec_put.c       Mon Nov 11 20:05:53 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rec_put.c,v 1.11 1998/12/09 12:42:51 christos Exp $    */
+/*     $NetBSD: rec_put.c,v 1.12 2002/11/11 20:09:21 thorpej Exp $     */
 
 /*-
  * Copyright (c) 1990, 1993, 1994
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)rec_put.c  8.7 (Berkeley) 8/18/94";
 #else
-__RCSID("$NetBSD: rec_put.c,v 1.11 1998/12/09 12:42:51 christos Exp $");
+__RCSID("$NetBSD: rec_put.c,v 1.12 2002/11/11 20:09:21 thorpej Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -264,7 +264,7 @@
         * the offset array, shift the pointers up.
         */
        nbytes = NRLEAFDBT(data->size);
-       if (h->upper - h->lower < nbytes + sizeof(indx_t)) {
+       if ((u_int32_t) (h->upper - h->lower) < nbytes + sizeof(indx_t)) {
                status = __bt_split(t, h, NULL, data, dflags, nbytes,
                    (u_int32_t)idx);
                if (status == RET_SUCCESS)



Home | Main Index | Thread Index | Old Index