Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/liblzf/dist get rid of most (but not all) lint ...



details:   https://anonhg.NetBSD.org/src/rev/41a4dd23f8c3
branches:  trunk
changeset: 763837:41a4dd23f8c3
user:      agc <agc%NetBSD.org@localhost>
date:      Tue Apr 05 06:24:42 2011 +0000

description:
get rid of most (but not all) lint on amd64

diffstat:

 external/bsd/liblzf/dist/lzf_c.c |  16 +++++++++-------
 external/bsd/liblzf/dist/lzf_d.c |   2 +-
 2 files changed, 10 insertions(+), 8 deletions(-)

diffs (83 lines):

diff -r b6b6728158e0 -r 41a4dd23f8c3 external/bsd/liblzf/dist/lzf_c.c
--- a/external/bsd/liblzf/dist/lzf_c.c  Tue Apr 05 06:15:30 2011 +0000
+++ b/external/bsd/liblzf/dist/lzf_c.c  Tue Apr 05 06:24:42 2011 +0000
@@ -148,7 +148,7 @@
       hslot = htab + IDX (hval);
       ref = *hslot; *hslot = ip;
 
-      if (1
+      if (/*CONSTCOND*/1
 #if INIT_HTAB
           && ref < ip /* the next test will actually take care of this, but this is faster */
 #endif
@@ -160,14 +160,14 @@
           && ref[1] == ip[1]
           && ref[2] == ip[2]
 #else
-          && *(u16 *)ref == *(u16 *)ip
+          && *(const u16 *)(const void *)ref == *(const u16 *)(const void *)ip
           && ref[2] == ip[2]
 #endif
         )
         {
           /* match found at *ref++ */
           unsigned int len = 2;
-          unsigned int maxlen = in_end - ip - len;
+          unsigned int maxlen = (unsigned)(in_end - ip) - len;
           maxlen = maxlen > MAX_REF ? MAX_REF : maxlen;
 
           if (expect_false (op + 3 + 1 >= out_end)) /* first a faster conservative test */
@@ -214,15 +214,15 @@
 
           if (len < 7)
             {
-              *op++ = (off >> 8) + (len << 5);
+              *op++ = (unsigned char)((off >> 8) + (len << 5));
             }
           else
             {
-              *op++ = (off >> 8) + (  7 << 5);
+              *op++ = (unsigned char)((off >> 8) + (  7 << 5));
               *op++ = len - 7;
             }
 
-          *op++ = off;
+          *op++ = (unsigned char)off;
           lit = 0; op++; /* start run */
 
           ip += len + 1;
@@ -266,6 +266,7 @@
 
           lit++; *op++ = *ip++;
 
+         /*LINTED*/
           if (expect_false (lit == MAX_LIT))
             {
               op [- lit - 1] = lit - 1; /* stop run */
@@ -281,6 +282,7 @@
     {
       lit++; *op++ = *ip++;
 
+      /*LINTED*/
       if (expect_false (lit == MAX_LIT))
         {
           op [- lit - 1] = lit - 1; /* stop run */
@@ -291,6 +293,6 @@
   op [- lit - 1] = lit - 1; /* end run */
   op -= !lit; /* undo run if length is zero */
 
-  return op - (u8 *)out_data;
+  return (unsigned)(op - (u8 *)out_data);
 }
 
diff -r b6b6728158e0 -r 41a4dd23f8c3 external/bsd/liblzf/dist/lzf_d.c
--- a/external/bsd/liblzf/dist/lzf_d.c  Tue Apr 05 06:15:30 2011 +0000
+++ b/external/bsd/liblzf/dist/lzf_d.c  Tue Apr 05 06:24:42 2011 +0000
@@ -143,6 +143,6 @@
     }
   while (ip < in_end);
 
-  return op - (u8 *)out_data;
+  return (unsigned)(op - (u8 *)out_data);
 }
 



Home | Main Index | Thread Index | Old Index