Source-Changes-HG archive

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

[src/trunk]: src/lib/libperfuse Avoid comparison between signed and unsigned ...



details:   https://anonhg.NetBSD.org/src/rev/e8886f1b1bb0
branches:  trunk
changeset: 769438:e8886f1b1bb0
user:      tron <tron%NetBSD.org@localhost>
date:      Sat Sep 10 10:06:10 2011 +0000

description:
Avoid comparison between signed and unsigned integer expressions by
casting the offset to a unsigned type. This fixes the NetBSD/i386
and hopefully the NetBSD/amd64 build.

diffstat:

 lib/libperfuse/ops.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r b8eb15b9f09a -r e8886f1b1bb0 lib/libperfuse/ops.c
--- a/lib/libperfuse/ops.c      Sat Sep 10 08:27:06 2011 +0000
+++ b/lib/libperfuse/ops.c      Sat Sep 10 10:06:10 2011 +0000
@@ -1,4 +1,4 @@
-/*  $NetBSD: ops.c,v 1.41 2011/09/09 22:51:44 christos Exp $ */
+/*  $NetBSD: ops.c,v 1.42 2011/09/10 10:06:10 tron Exp $ */
 
 /*-
  *  Copyright (c) 2010-2011 Emmanuel Dreyfus. All rights reserved.
@@ -2835,7 +2835,7 @@
        vap = puffs_pn_getvap((struct puffs_node *)opc);
        pm = NULL;
 
-       if (offset + *resid > vap->va_size)
+       if ((u_quad_t)offset + *resid > vap->va_size)
                DWARNX("%s %p read %lld@%zu beyond EOF %" PRIu64 "\n",
                       __func__, (void *)opc, (long long)offset,
                       *resid, vap->va_size);
@@ -2942,7 +2942,7 @@
        /* 
         * Serialize size access, see comment in perfuse_node_setattr().
         */
-       if (offset + *resid > vap->va_size) {
+       if ((u_quad_t)offset + *resid > vap->va_size) {
                while (pnd->pnd_flags & PND_INRESIZE)
                        requeue_request(pu, opc, PCQ_RESIZE);
                pnd->pnd_flags |= PND_INRESIZE;



Home | Main Index | Thread Index | Old Index