Commit c21b37f6449a3d799c7e75e978391674ee207600
Committed by
Linus Torvalds
1 parent
3968cb49ab
Exists in
master
and in
4 other branches
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: 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>
Showing 1 changed file with 3 additions and 3 deletions Side-by-side Diff
lib/lzo/lzo1x_compress.c
... | ... | @@ -32,13 +32,13 @@ |
32 | 32 | ip += 4; |
33 | 33 | |
34 | 34 | for (;;) { |
35 | - dindex = ((0x21 * DX3(ip, 5, 5, 6)) >> 5) & D_MASK; | |
35 | + dindex = ((size_t)(0x21 * DX3(ip, 5, 5, 6)) >> 5) & D_MASK; | |
36 | 36 | m_pos = dict[dindex]; |
37 | 37 | |
38 | 38 | if (m_pos < in) |
39 | 39 | goto literal; |
40 | 40 | |
41 | - if (ip == m_pos || (ip - m_pos) > M4_MAX_OFFSET) | |
41 | + if (ip == m_pos || ((size_t)(ip - m_pos) > M4_MAX_OFFSET)) | |
42 | 42 | goto literal; |
43 | 43 | |
44 | 44 | m_off = ip - m_pos; |
... | ... | @@ -51,7 +51,7 @@ |
51 | 51 | if (m_pos < in) |
52 | 52 | goto literal; |
53 | 53 | |
54 | - if (ip == m_pos || (ip - m_pos) > M4_MAX_OFFSET) | |
54 | + if (ip == m_pos || ((size_t)(ip - m_pos) > M4_MAX_OFFSET)) | |
55 | 55 | goto literal; |
56 | 56 | |
57 | 57 | m_off = ip - m_pos; |