X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fxpress-decompress.c;h=c16b5e32019085c5308bd136d73a94dd5439bc5c;hb=7e7070982833be4292431b7dbffa8280e27b3d8a;hp=9c5d48662883baa0cb8edb4805f0ec27e0d3b90a;hpb=7371dd5ed076ed4fe15c354b07001653cb2ede52;p=wimlib diff --git a/src/xpress-decompress.c b/src/xpress-decompress.c index 9c5d4866..c16b5e32 100644 --- a/src/xpress-decompress.c +++ b/src/xpress-decompress.c @@ -6,7 +6,7 @@ /* * - * Copyright (C) 2012 Eric Biggers + * Copyright (C) 2012, 2013 Eric Biggers * * This file is part of wimlib, a library for working with WIM files. * @@ -91,9 +91,10 @@ * * Returns the match length, or -1 on error. */ -static int xpress_decode_match(unsigned huffsym, unsigned window_pos, - unsigned window_len, u8 window[], - struct input_bitstream *istream) +static int +xpress_decode_match(unsigned huffsym, unsigned window_pos, + unsigned window_len, u8 window[], + struct input_bitstream *istream) { unsigned match_len; unsigned match_offset; @@ -142,15 +143,15 @@ static int xpress_decode_match(unsigned huffsym, unsigned window_pos, match_src = match_dest - match_offset; if (window_pos + match_len > window_len) { - ERROR("XPRESS decompression error: match of length %d " + ERROR("XPRESS decompression error: match of length %u " "bytes overflows window", match_len); return -1; } if (match_src < window) { - ERROR("XPRESS decompression error: match of length %d bytes " - "references data before window (match_offset = %d, " - "window_pos = %d)", match_len, match_offset, window_pos); + ERROR("XPRESS decompression error: match of length %u bytes " + "references data before window (match_offset = %u, " + "window_pos = %u)", match_len, match_offset, window_pos); return -1; } @@ -162,11 +163,12 @@ static int xpress_decode_match(unsigned huffsym, unsigned window_pos, /* Decodes the Huffman-encoded matches and literal bytes in a block of * XPRESS-encoded data. */ -static int xpress_decompress_block(struct input_bitstream *istream, - u8 uncompressed_data[], - unsigned uncompressed_len, - const u8 lens[], - const u16 decode_table[]) +static int +xpress_decompress_block(struct input_bitstream *istream, + u8 uncompressed_data[], + unsigned uncompressed_len, + const u8 lens[], + const u16 decode_table[]) { unsigned curpos; unsigned huffsym; @@ -198,8 +200,9 @@ static int xpress_decompress_block(struct input_bitstream *istream, } -int xpress_decompress(const void *__compressed_data, unsigned compressed_len, - void *uncompressed_data, unsigned uncompressed_len) +int +xpress_decompress(const void *__compressed_data, unsigned compressed_len, + void *uncompressed_data, unsigned uncompressed_len) { u8 lens[XPRESS_NUM_SYMBOLS]; u16 decode_table[(1 << XPRESS_TABLEBITS) + 2 * XPRESS_NUM_SYMBOLS];