modules/brotli/README.mozilla
author Nathan Froyd <froydnj@mozilla.com>
Wed, 07 Oct 2015 16:50:25 -0400
changeset 287061 91d4539e00cecb658604e021675a923c60ef3235
parent 286535 8881708f5c15249df6e9fefaa3fb2af5b1e98711
child 287942 ee4cb52e6b15156e195c55ee74041d182d0471a4
permissions -rw-r--r--
Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat The bulk of this commit was generated with a script, executed at the top level of a typical source code checkout. The only non-machine-generated part was modifying MFBT's moz.build to reflect the new naming. # The main substitution. find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \ xargs perl -p -i -e ' s/nsRefPtr\.h/RefPtr\.h/g; # handle includes s/nsRefPtr ?</RefPtr</g; # handle declarations and variables ' # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h. perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h # Handle nsRefPtr.h itself, a couple places that define constructors # from nsRefPtr, and code generators specially. We do this here, rather # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename # things like nsRefPtrHashtable. perl -p -i -e 's/nsRefPtr/RefPtr/g' \ mfbt/nsRefPtr.h \ xpcom/glue/nsCOMPtr.h \ xpcom/base/OwningNonNull.h \ ipc/ipdl/ipdl/lower.py \ ipc/ipdl/ipdl/builtin.py \ dom/bindings/Codegen.py \ python/lldbutils/lldbutils/utils.py # In our indiscriminate substitution above, we renamed # nsRefPtrGetterAddRefs, the class behind getter_AddRefs. Fix that up. find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \ xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g' if [ -d .git ]; then git mv mfbt/nsRefPtr.h mfbt/RefPtr.h else hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h fi

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. */