]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
lzo: add some missing casts
authorRichard Purdie <richard@openedhand.com>
Tue, 31 Jul 2007 07:37:42 +0000 (00:37 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Tue, 31 Jul 2007 22:39:37 +0000 (15:39 -0700)
Add some casts to the LZO compression algorithm after they were removed
during cleanup and shouldn't have been.

Signed-off-by: Richard Purdie <rpurdie@openedhand.com>
Cc: Edward Shishkin <edward@namesys.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
lib/lzo/lzo1x_compress.c

index c935f00073e9efe02cf174d5943f976e9d1dcea9..a6040990a62ee36054794b53cc5f91379c2a3be7 100644 (file)
@@ -32,13 +32,13 @@ _lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
        ip += 4;
 
        for (;;) {
-               dindex = ((0x21 * DX3(ip, 5, 5, 6)) >> 5) & D_MASK;
+               dindex = ((size_t)(0x21 * DX3(ip, 5, 5, 6)) >> 5) & D_MASK;
                m_pos = dict[dindex];
 
                if (m_pos < in)
                        goto literal;
 
-               if (ip == m_pos || (ip - m_pos) > M4_MAX_OFFSET)
+               if (ip == m_pos || ((size_t)(ip - m_pos) > M4_MAX_OFFSET))
                        goto literal;
 
                m_off = ip - m_pos;
@@ -51,7 +51,7 @@ _lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
                if (m_pos < in)
                        goto literal;
 
-               if (ip == m_pos || (ip - m_pos) > M4_MAX_OFFSET)
+               if (ip == m_pos || ((size_t)(ip - m_pos) > M4_MAX_OFFSET))
                        goto literal;
 
                m_off = ip - m_pos;