Commit c21b37f6 authored by Richard Purdie's avatar Richard Purdie Committed by Linus Torvalds

lzo: add some missing casts

Add some casts to the LZO compression algorithm after they were removed
during cleanup and shouldn't have been.
Signed-off-by: default avatarRichard Purdie <rpurdie@openedhand.com>
Cc: Edward Shishkin <edward@namesys.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 3968cb49
...@@ -32,13 +32,13 @@ _lzo1x_1_do_compress(const unsigned char *in, size_t in_len, ...@@ -32,13 +32,13 @@ _lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
ip += 4; ip += 4;
for (;;) { 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]; m_pos = dict[dindex];
if (m_pos < in) if (m_pos < in)
goto literal; 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; goto literal;
m_off = ip - m_pos; m_off = ip - m_pos;
...@@ -51,7 +51,7 @@ _lzo1x_1_do_compress(const unsigned char *in, size_t in_len, ...@@ -51,7 +51,7 @@ _lzo1x_1_do_compress(const unsigned char *in, size_t in_len,
if (m_pos < in) if (m_pos < in)
goto literal; 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; goto literal;
m_off = ip - m_pos; m_off = ip - m_pos;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment