Source-Changes-HG archive

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

[src/trunk]: src/gnu/dist/texinfo/info Cast strlen of constant down to avoid ...



details:   https://anonhg.NetBSD.org/src/rev/66a9ded064e6
branches:  trunk
changeset: 327115:66a9ded064e6
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Feb 27 18:09:18 2014 +0000

description:
Cast strlen of constant down to avoid argument widening. Change an abs
to labs based on the arguments.

diffstat:

 gnu/dist/texinfo/info/session.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 9a7a5abab4ce -r 66a9ded064e6 gnu/dist/texinfo/info/session.c
--- a/gnu/dist/texinfo/info/session.c   Thu Feb 27 18:05:07 2014 +0000
+++ b/gnu/dist/texinfo/info/session.c   Thu Feb 27 18:09:18 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: session.c,v 1.5 2008/09/02 08:41:51 christos Exp $     */
+/*     $NetBSD: session.c,v 1.6 2014/02/27 18:09:18 joerg Exp $        */
 
 /* session.c -- user windowing interface to Info.
    Id: session.c,v 1.16 2004/12/14 00:15:36 karl Exp
@@ -2020,7 +2020,7 @@
       /* See how far POS is from this xref.  Take into account the
          `*Note' that begins the xref, since as far as the user is
          concerned, that's where it starts.  */
-      delta = MIN (labs (pos - (xref->start - strlen (INFO_XREF_LABEL))),
+      delta = MIN (labs (pos - (xref->start - (long)strlen (INFO_XREF_LABEL))),
                    labs (pos - xref->end));
       
       /* It's the <= instead of < that makes us choose the forward xref
@@ -2247,7 +2247,7 @@
                 {
                   /* ref->end is more accurate estimate of position
                      for menus than ref->start.  Go figure.  */
-                  int dist = abs (window->point - ref->end);
+                  int dist = labs (window->point - ref->end);
 
                   if (dist < min_dist)
                     {



Home | Main Index | Thread Index | Old Index