Module Name:    src
Committed By:   agc
Date:           Tue Apr  5 06:24:42 UTC 2011

Modified Files:
        src/external/bsd/liblzf/dist: lzf_c.c lzf_d.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/liblzf/dist/lzf_c.c \
    src/external/bsd/liblzf/dist/lzf_d.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/liblzf/dist/lzf_c.c
diff -u src/external/bsd/liblzf/dist/lzf_c.c:1.2 src/external/bsd/liblzf/dist/lzf_c.c:1.3
--- src/external/bsd/liblzf/dist/lzf_c.c:1.2	Wed Feb  3 03:55:38 2010
+++ src/external/bsd/liblzf/dist/lzf_c.c	Tue Apr  5 06:24:42 2011
@@ -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);
 }
 
Index: src/external/bsd/liblzf/dist/lzf_d.c
diff -u src/external/bsd/liblzf/dist/lzf_d.c:1.2 src/external/bsd/liblzf/dist/lzf_d.c:1.3
--- src/external/bsd/liblzf/dist/lzf_d.c:1.2	Wed Feb  3 03:55:38 2010
+++ src/external/bsd/liblzf/dist/lzf_d.c	Tue Apr  5 06:24:42 2011
@@ -143,6 +143,6 @@
     }
   while (ip < in_end);
 
-  return op - (u8 *)out_data;
+  return (unsigned)(op - (u8 *)out_data);
 }
 

Reply via email to