gecko-dev/modules/brotli
2015-09-28 13:10:09 -04:00
..
dec bug 1207298 - update brotli library r=jfkthame 2015-09-28 13:10:09 -04:00
moz.build bug 1207298 - update brotli library r=jfkthame 2015-09-28 13:10:09 -04:00
README.mozilla bug 1207298 - update brotli library r=jfkthame 2015-09-28 13:10:09 -04:00
update.sh Bug 1142953 - Update Brotli decompressor to latest upstream revision from GitHub; now at ca29aa22c295daac15baf5d85427ecc7808b515c. r=jdaggett 2015-03-19 11:11:28 +00:00

This is the Brotli data compression library from
https://github.com/google/brotli.

Currently, we import only the Brotli decoder (the /dec/ subdirectory), not the
encoder (/enc/ subdirectory).

Upstream code can be viewed at
  https://github.com/google/brotli/tree/master/dec

and cloned by
  git clone https://github.com/google/brotli

The in-tree copy is updated by running
  sh update.sh
from within the modules/brotli directory.

Current version: [commit 933bb9bd800c8f5f7f6a02382d33c902a98ef73a].

this trivial patch is added to preserve no-warnings behavior in code
that includes the brotli interface. future imports are expected to
have an equivalent change made upstream already.

diff --git a/modules/brotli/dec/bit_reader.h b/modules/brotli/dec/bit_reader.h
--- a/modules/brotli/dec/bit_reader.h
+++ b/modules/brotli/dec/bit_reader.h
@@ -284,17 +284,17 @@ static BROTLI_INLINE int BrotliPeekByte(
   int bytes_left = (int)(sizeof(br->val_) - (br->bit_pos_ >> 3));
   if (br->bit_pos_ & 7) {
     return -1;
   }
   if (offset < bytes_left) {
     return (br->val_ >> (br->bit_pos_ + (unsigned)(offset << 3))) & 0xFF;
   }
   offset -= bytes_left;
-  if (offset < br->avail_in) {
+  if (offset < (long)br->avail_in) {
     return br->next_in[offset];
   }
   return -1;
 }
 
 /* Copies remaining input bytes stored in the bit reader to the output. Value
    num may not be larger than BrotliGetRemainingBytes. The bit reader must be
    warmed up again after this. */