From owner-svn-ports-all@freebsd.org Sun Oct 4 18:00:07 2015 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5A492A0F2DC; Sun, 4 Oct 2015 18:00:07 +0000 (UTC) (envelope-from sunpoet@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D34CF1A06; Sun, 4 Oct 2015 18:00:06 +0000 (UTC) (envelope-from sunpoet@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.70]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t94I06K3041409; Sun, 4 Oct 2015 18:00:06 GMT (envelope-from sunpoet@FreeBSD.org) Received: (from sunpoet@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t94I06sg041407; Sun, 4 Oct 2015 18:00:06 GMT (envelope-from sunpoet@FreeBSD.org) Message-Id: <201510041800.t94I06sg041407@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: sunpoet set sender to sunpoet@FreeBSD.org using -f From: Sunpoet Po-Chuan Hsieh Date: Sun, 4 Oct 2015 18:00:06 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r398593 - in head/archivers/brotli: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Oct 2015 18:00:07 -0000 Author: sunpoet Date: Sun Oct 4 18:00:05 2015 New Revision: 398593 URL: https://svnweb.freebsd.org/changeset/ports/398593 Log: - Fix build on 9.x - Remove unnecessary USE_CXXSTD - Bump PORTREVISION for package change Obtained from: https://github.com/google/brotli/commit/4a7024dcde1aaf30d824ade299e70711a30f4399 MFH: 2015Q4 Added: head/archivers/brotli/files/ head/archivers/brotli/files/patch-freebsd9 (contents, props changed) Modified: head/archivers/brotli/Makefile Modified: head/archivers/brotli/Makefile ============================================================================== --- head/archivers/brotli/Makefile Sun Oct 4 18:00:00 2015 (r398592) +++ head/archivers/brotli/Makefile Sun Oct 4 18:00:05 2015 (r398593) @@ -3,6 +3,7 @@ PORTNAME= brotli PORTVERSION= 0.2.0 +PORTREVISION= 1 DISTVERSIONPREFIX= v CATEGORIES= archivers @@ -12,7 +13,6 @@ COMMENT= Generic-purpose lossless compre LICENSE= APACHE20 LICENSE_FILE= ${WRKSRC}/LICENSE -USE_CXXSTD= c++0x USE_PYTHON= autoplist distutils USES= compiler:c++0x python Added: head/archivers/brotli/files/patch-freebsd9 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/archivers/brotli/files/patch-freebsd9 Sun Oct 4 18:00:05 2015 (r398593) @@ -0,0 +1,879 @@ +Obtained from: https://github.com/google/brotli/commit/4a7024dcde1aaf30d824ade299e70711a30f4399 + +--- enc/backward_references.cc.orig 2015-09-01 13:04:54 UTC ++++ enc/backward_references.cc +@@ -636,7 +636,7 @@ void CreateBackwardReferences(size_t num + int* num_literals) { + bool zopflify = quality > 9; + if (zopflify) { +- Hashers::H9* hasher = hashers->hash_h9.get(); ++ Hashers::H9* hasher = hashers->hash_h9; + if (num_bytes >= 3 && position >= 3) { + // Prepare the hashes for three last bytes of the last write. + // These could not be calculated before, since they require knowledge +@@ -710,55 +710,55 @@ void CreateBackwardReferences(size_t num + case 1: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h1.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h1, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + case 2: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h2.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h2, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + case 3: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h3.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h3, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + case 4: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h4.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h4, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + case 5: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h5.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h5, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + case 6: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h6.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h6, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + case 7: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h7.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h7, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + case 8: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h8.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h8, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + case 9: + CreateBackwardReferences( + num_bytes, position, ringbuffer, ringbuffer_mask, max_backward_limit, +- quality, hashers->hash_h9.get(), dist_cache, last_insert_len, ++ quality, hashers->hash_h9, dist_cache, last_insert_len, + commands, num_commands, num_literals); + break; + default: +--- enc/backward_references.h.orig 2015-09-01 13:04:54 UTC ++++ enc/backward_references.h +@@ -17,11 +17,11 @@ + #ifndef BROTLI_ENC_BACKWARD_REFERENCES_H_ + #define BROTLI_ENC_BACKWARD_REFERENCES_H_ + +-#include + #include + + #include "./hash.h" + #include "./command.h" ++#include "./types.h" + + namespace brotli { + +--- enc/bit_cost.h.orig 2015-09-01 13:04:54 UTC ++++ enc/bit_cost.h +@@ -18,10 +18,10 @@ + #define BROTLI_ENC_BIT_COST_H_ + + +-#include + + #include "./entropy_encode.h" + #include "./fast_log.h" ++#include "./types.h" + + namespace brotli { + +--- enc/block_splitter.h.orig 2015-09-01 13:04:54 UTC ++++ enc/block_splitter.h +@@ -17,14 +17,13 @@ + #ifndef BROTLI_ENC_BLOCK_SPLITTER_H_ + #define BROTLI_ENC_BLOCK_SPLITTER_H_ + +-#include +-#include + #include + #include + #include + + #include "./command.h" + #include "./metablock.h" ++#include "./types.h" + + namespace brotli { + +--- enc/brotli_bit_stream.cc.orig 2015-09-01 13:04:54 UTC ++++ enc/brotli_bit_stream.cc +@@ -28,7 +28,6 @@ + #include "./fast_log.h" + #include "./prefix.h" + #include "./write_bits.h" +- + namespace brotli { + + // returns false if fail +@@ -275,6 +274,7 @@ void StoreHuffmanTree(const uint8_t* dep + storage_ix, storage); + } + ++ + void BuildAndStoreHuffmanTree(const int *histogram, + const int length, + uint8_t* depth, +--- enc/brotli_bit_stream.h.orig 2015-09-01 13:04:54 UTC ++++ enc/brotli_bit_stream.h +@@ -24,11 +24,10 @@ + #ifndef BROTLI_ENC_BROTLI_BIT_STREAM_H_ + #define BROTLI_ENC_BROTLI_BIT_STREAM_H_ + +-#include +-#include + #include + + #include "./metablock.h" ++#include "./types.h" + + namespace brotli { + +--- enc/cluster.h.orig 2015-09-01 13:04:54 UTC ++++ enc/cluster.h +@@ -18,7 +18,6 @@ + #define BROTLI_ENC_CLUSTER_H_ + + #include +-#include + #include + #include + #include +@@ -31,6 +30,7 @@ + #include "./entropy_encode.h" + #include "./fast_log.h" + #include "./histogram.h" ++#include "./types.h" + + namespace brotli { + +@@ -264,6 +264,7 @@ void ClusterHistograms(const std::vector + (*histogram_symbols)[i] = i; + } + ++ + const int max_input_histograms = 64; + for (int i = 0; i < in_size; i += max_input_histograms) { + int num_to_combine = std::min(in_size - i, max_input_histograms); +@@ -282,6 +283,7 @@ void ClusterHistograms(const std::vector + + // Convert the context map to a canonical form. + HistogramReindex(out, histogram_symbols); ++ + } + + +--- enc/command.h.orig 2015-09-01 13:04:54 UTC ++++ enc/command.h +@@ -17,9 +17,9 @@ + #ifndef BROTLI_ENC_COMMAND_H_ + #define BROTLI_ENC_COMMAND_H_ + +-#include + #include "./fast_log.h" + #include "./prefix.h" ++#include "./types.h" + + namespace brotli { + +--- enc/context.h.orig 2015-09-01 13:04:54 UTC ++++ enc/context.h +@@ -17,7 +17,7 @@ + #ifndef BROTLI_ENC_CONTEXT_H_ + #define BROTLI_ENC_CONTEXT_H_ + +-#include ++#include "./types.h" + + namespace brotli { + +--- enc/dictionary.h.orig 2015-09-01 13:04:54 UTC ++++ enc/dictionary.h +@@ -17,7 +17,7 @@ + #ifndef BROTLI_ENC_DICTIONARY_H_ + #define BROTLI_ENC_DICTIONARY_H_ + +-#include ++#include "./types.h" + + static const uint8_t kBrotliDictionary[] = { + 0x74, 0x69, 0x6d, 0x65, 0x64, 0x6f, 0x77, 0x6e, 0x6c, 0x69, 0x66, 0x65, 0x6c, +--- enc/dictionary_hash.h.orig 2015-09-01 13:04:54 UTC ++++ enc/dictionary_hash.h +@@ -17,7 +17,7 @@ + #ifndef BROTLI_ENC_DICTIONARY_HASH_H_ + #define BROTLI_ENC_DICTIONARY_HASH_H_ + +-#include ++#include "./types.h" + + namespace brotli { + +--- enc/encode.cc.orig 2015-09-01 13:04:54 UTC ++++ enc/encode.cc +@@ -125,16 +125,18 @@ void RecomputeDistancePrefixes(Command* + + uint8_t* BrotliCompressor::GetBrotliStorage(size_t size) { + if (storage_size_ < size) { +- storage_.reset(new uint8_t[size]); ++ delete[] storage_; ++ storage_ = new uint8_t[size]; + storage_size_ = size; + } +- return &storage_[0]; ++ return storage_; + } + + BrotliCompressor::BrotliCompressor(BrotliParams params) + : params_(params), + hashers_(new Hashers()), + input_pos_(0), ++ literal_cost_(0), + num_commands_(0), + num_literals_(0), + last_insert_len_(0), +@@ -142,7 +144,8 @@ BrotliCompressor::BrotliCompressor(Brotl + last_processed_pos_(0), + prev_byte_(0), + prev_byte2_(0), +- storage_size_(0) { ++ storage_size_(0), ++ storage_(0) { + // Sanitize params. + params_.quality = std::max(1, params_.quality); + if (params_.lgwin < kMinWindowBits) { +@@ -169,15 +172,15 @@ BrotliCompressor::BrotliCompressor(Brotl + // read_block_size_bits + 1 bits because the copy tail length needs to be + // smaller than ringbuffer size. + int ringbuffer_bits = std::max(params_.lgwin + 1, params_.lgblock + 1); +- ringbuffer_.reset(new RingBuffer(ringbuffer_bits, params_.lgblock)); ++ ringbuffer_ = new RingBuffer(ringbuffer_bits, params_.lgblock); + if (params_.quality > 9) { + literal_cost_mask_ = (1 << params_.lgblock) - 1; +- literal_cost_.reset(new float[literal_cost_mask_ + 1]); ++ literal_cost_ = new float[literal_cost_mask_ + 1]; + } + + // Allocate command buffer. + cmd_buffer_size_ = std::max(1 << 18, 1 << params_.lgblock); +- commands_.reset(new brotli::Command[cmd_buffer_size_]); ++ commands_ = new brotli::Command[cmd_buffer_size_]; + + // Initialize last byte with stream header. + if (params_.lgwin == 16) { +@@ -209,6 +212,11 @@ BrotliCompressor::BrotliCompressor(Brotl + } + + BrotliCompressor::~BrotliCompressor() { ++ delete[] storage_; ++ delete[] literal_cost_; ++ delete[] commands_; ++ delete ringbuffer_; ++ delete hashers_; + } + + void BrotliCompressor::CopyInputToRingBuffer(const size_t input_size, +@@ -292,23 +300,23 @@ bool BrotliCompressor::WriteBrotliData(c + params_.quality >= 9 && + IsMostlyUTF8(&data[last_processed_pos_ & mask], bytes, kMinUTF8Ratio); + +- if (literal_cost_.get()) { ++ if (literal_cost_) { + if (utf8_mode) { + EstimateBitCostsForLiteralsUTF8(last_processed_pos_, bytes, mask, + literal_cost_mask_, data, +- literal_cost_.get()); ++ literal_cost_); + } else { + EstimateBitCostsForLiterals(last_processed_pos_, bytes, mask, + literal_cost_mask_, +- data, literal_cost_.get()); ++ data, literal_cost_); + } + } + CreateBackwardReferences(bytes, last_processed_pos_, data, mask, +- literal_cost_.get(), ++ literal_cost_, + literal_cost_mask_, + max_backward_distance_, + params_.quality, +- hashers_.get(), ++ hashers_, + hash_type_, + dist_cache_, + &last_insert_len_, +@@ -487,14 +495,14 @@ bool BrotliCompressor::WriteMetaBlockInt + if (params_.quality > 9 && params_.mode == BrotliParams::MODE_FONT) { + num_direct_distance_codes = 12; + distance_postfix_bits = 1; +- RecomputeDistancePrefixes(commands_.get(), ++ RecomputeDistancePrefixes(commands_, + num_commands_, + num_direct_distance_codes, + distance_postfix_bits); + } + if (params_.quality < kMinQualityForBlockSplit) { + if (!StoreMetaBlockTrivial(data, last_flush_pos_, bytes, mask, is_last, +- commands_.get(), num_commands_, ++ commands_, num_commands_, + &storage_ix, + &storage[0])) { + return false; +@@ -512,7 +520,7 @@ bool BrotliCompressor::WriteMetaBlockInt + &literal_context_map); + if (literal_context_map == NULL) { + BuildMetaBlockGreedy(data, last_flush_pos_, mask, +- commands_.get(), num_commands_, ++ commands_, num_commands_, + &mb); + } else { + BuildMetaBlockGreedyWithContexts(data, last_flush_pos_, mask, +@@ -520,13 +528,13 @@ bool BrotliCompressor::WriteMetaBlockInt + literal_context_mode, + num_literal_contexts, + literal_context_map, +- commands_.get(), num_commands_, ++ commands_, num_commands_, + &mb); + } + } else { + BuildMetaBlock(data, last_flush_pos_, mask, + prev_byte_, prev_byte2_, +- commands_.get(), num_commands_, ++ commands_, num_commands_, + literal_context_mode, + &mb); + } +@@ -541,7 +549,7 @@ bool BrotliCompressor::WriteMetaBlockInt + num_direct_distance_codes, + distance_postfix_bits, + literal_context_mode, +- commands_.get(), num_commands_, ++ commands_, num_commands_, + mb, + &storage_ix, + &storage[0])) { +@@ -684,7 +692,7 @@ bool BrotliInIsFinished(BrotliIn* r) { + } + + int BrotliCompress(BrotliParams params, BrotliIn* in, BrotliOut* out) { +- return BrotliCompressWithCustomDictionary(0, nullptr, params, in, out); ++ return BrotliCompressWithCustomDictionary(0, 0, params, in, out); + } + + int BrotliCompressWithCustomDictionary(size_t dictsize, const uint8_t* dict, +--- enc/encode.h.orig 2015-09-01 13:04:54 UTC ++++ enc/encode.h +@@ -17,8 +17,6 @@ + #ifndef BROTLI_ENC_ENCODE_H_ + #define BROTLI_ENC_ENCODE_H_ + +-#include +-#include + #include + #include + #include "./command.h" +@@ -26,6 +24,7 @@ + #include "./ringbuffer.h" + #include "./static_dict.h" + #include "./streams.h" ++#include "./types.h" + + namespace brotli { + +@@ -149,14 +148,14 @@ class BrotliCompressor { + + BrotliParams params_; + int max_backward_distance_; +- std::unique_ptr hashers_; ++ Hashers* hashers_; + int hash_type_; + size_t input_pos_; +- std::unique_ptr ringbuffer_; +- std::unique_ptr literal_cost_; ++ RingBuffer* ringbuffer_; ++ float* literal_cost_; + size_t literal_cost_mask_; + size_t cmd_buffer_size_; +- std::unique_ptr commands_; ++ Command* commands_; + int num_commands_; + int num_literals_; + int last_insert_len_; +@@ -169,7 +168,7 @@ class BrotliCompressor { + uint8_t prev_byte_; + uint8_t prev_byte2_; + int storage_size_; +- std::unique_ptr storage_; ++ uint8_t* storage_; + }; + + // Compresses the data in input_buffer into encoded_buffer, and sets +--- enc/encode_parallel.cc.orig 2015-09-01 13:04:54 UTC ++++ enc/encode_parallel.cc +@@ -167,7 +167,7 @@ bool WriteMetaBlockParallel(const Brotli + + // Initialize hashers. + int hash_type = std::min(9, params.quality); +- std::unique_ptr hashers(new Hashers()); ++ Hashers* hashers = new Hashers(); + hashers->Init(hash_type); + + // Compute backward references. +@@ -183,13 +183,14 @@ bool WriteMetaBlockParallel(const Brotli + &literal_cost[0], mask, + max_backward_distance, + params.quality, +- hashers.get(), ++ hashers, + hash_type, + dist_cache, + &last_insert_len, + &commands[0], + &num_commands, + &num_literals); ++ delete hashers; + commands.resize(num_commands); + if (last_insert_len > 0) { + commands.push_back(Command(last_insert_len)); +--- enc/encode_parallel.h.orig 2015-09-01 13:04:54 UTC ++++ enc/encode_parallel.h +@@ -19,10 +19,9 @@ + #ifndef BROTLI_ENC_ENCODE_PARALLEL_H_ + #define BROTLI_ENC_ENCODE_PARALLEL_H_ + +-#include +-#include + + #include "./encode.h" ++#include "./types.h" + + namespace brotli { + +--- enc/entropy_encode.cc.orig 2015-09-01 13:04:54 UTC ++++ enc/entropy_encode.cc +@@ -16,13 +16,13 @@ + + #include "./entropy_encode.h" + +-#include + #include + #include + #include + #include + + #include "./histogram.h" ++#include "./types.h" + + namespace brotli { + +--- enc/entropy_encode.h.orig 2015-09-01 13:04:54 UTC ++++ enc/entropy_encode.h +@@ -17,11 +17,11 @@ + #ifndef BROTLI_ENC_ENTROPY_ENCODE_H_ + #define BROTLI_ENC_ENTROPY_ENCODE_H_ + +-#include + #include + #include + #include "./histogram.h" + #include "./prefix.h" ++#include "./types.h" + + namespace brotli { + +--- enc/fast_log.h.orig 2015-09-01 13:04:54 UTC ++++ enc/fast_log.h +@@ -19,7 +19,8 @@ + + #include + #include +-#include ++ ++#include "./types.h" + + namespace brotli { + +--- enc/find_match_length.h.orig 2015-09-01 13:04:54 UTC ++++ enc/find_match_length.h +@@ -17,11 +17,9 @@ + #ifndef BROTLI_ENC_FIND_MATCH_LENGTH_H_ + #define BROTLI_ENC_FIND_MATCH_LENGTH_H_ + +-#include +- +-#include + + #include "./port.h" ++#include "./types.h" + + namespace brotli { + +--- enc/hash.h.orig 2015-09-01 13:04:54 UTC ++++ enc/hash.h +@@ -18,8 +18,6 @@ + #ifndef BROTLI_ENC_HASH_H_ + #define BROTLI_ENC_HASH_H_ + +-#include +-#include + #include + #include + #include +@@ -34,6 +32,7 @@ + #include "./prefix.h" + #include "./static_dict.h" + #include "./transform.h" ++#include "./types.h" + + namespace brotli { + +@@ -631,17 +630,32 @@ struct Hashers { + typedef HashLongestMatch<15, 7, 10> H8; + typedef HashLongestMatch<15, 8, 16> H9; + ++ Hashers() : hash_h1(0), hash_h2(0), hash_h3(0), hash_h4(0), hash_h5(0), ++ hash_h6(0), hash_h7(0), hash_h8(0), hash_h9(0) {} ++ ++ ~Hashers() { ++ delete hash_h1; ++ delete hash_h2; ++ delete hash_h3; ++ delete hash_h4; ++ delete hash_h5; ++ delete hash_h6; ++ delete hash_h7; ++ delete hash_h8; ++ delete hash_h9; ++ } ++ + void Init(int type) { + switch (type) { +- case 1: hash_h1.reset(new H1); break; +- case 2: hash_h2.reset(new H2); break; +- case 3: hash_h3.reset(new H3); break; +- case 4: hash_h4.reset(new H4); break; +- case 5: hash_h5.reset(new H5); break; +- case 6: hash_h6.reset(new H6); break; +- case 7: hash_h7.reset(new H7); break; +- case 8: hash_h8.reset(new H8); break; +- case 9: hash_h9.reset(new H9); break; ++ case 1: hash_h1 = new H1; break; ++ case 2: hash_h2 = new H2; break; ++ case 3: hash_h3 = new H3; break; ++ case 4: hash_h4 = new H4; break; ++ case 5: hash_h5 = new H5; break; ++ case 6: hash_h6 = new H6; break; ++ case 7: hash_h7 = new H7; break; ++ case 8: hash_h8 = new H8; break; ++ case 9: hash_h9 = new H9; break; + default: break; + } + } +@@ -657,28 +671,28 @@ struct Hashers { + void PrependCustomDictionary( + int type, const size_t size, const uint8_t* dict) { + switch (type) { +- case 1: WarmupHash(size, dict, hash_h1.get()); break; +- case 2: WarmupHash(size, dict, hash_h2.get()); break; +- case 3: WarmupHash(size, dict, hash_h3.get()); break; +- case 4: WarmupHash(size, dict, hash_h4.get()); break; +- case 5: WarmupHash(size, dict, hash_h5.get()); break; +- case 6: WarmupHash(size, dict, hash_h6.get()); break; +- case 7: WarmupHash(size, dict, hash_h7.get()); break; +- case 8: WarmupHash(size, dict, hash_h8.get()); break; +- case 9: WarmupHash(size, dict, hash_h9.get()); break; ++ case 1: WarmupHash(size, dict, hash_h1); break; ++ case 2: WarmupHash(size, dict, hash_h2); break; ++ case 3: WarmupHash(size, dict, hash_h3); break; ++ case 4: WarmupHash(size, dict, hash_h4); break; ++ case 5: WarmupHash(size, dict, hash_h5); break; ++ case 6: WarmupHash(size, dict, hash_h6); break; ++ case 7: WarmupHash(size, dict, hash_h7); break; ++ case 8: WarmupHash(size, dict, hash_h8); break; ++ case 9: WarmupHash(size, dict, hash_h9); break; + default: break; + } + } + +- std::unique_ptr

hash_h1; +- std::unique_ptr

hash_h2; +- std::unique_ptr

hash_h3; +- std::unique_ptr

hash_h4; +- std::unique_ptr

hash_h5; +- std::unique_ptr
hash_h6; +- std::unique_ptr hash_h7; +- std::unique_ptr hash_h8; +- std::unique_ptr hash_h9; ++ H1* hash_h1; ++ H2* hash_h2; ++ H3* hash_h3; ++ H4* hash_h4; ++ H5* hash_h5; ++ H6* hash_h6; ++ H7* hash_h7; ++ H8* hash_h8; ++ H9* hash_h9; + }; + + } // namespace brotli +--- enc/histogram.cc.orig 2015-09-01 13:04:54 UTC ++++ enc/histogram.cc +@@ -16,7 +16,6 @@ + + #include "./histogram.h" + +-#include + #include + + #include "./block_splitter.h" +--- enc/histogram.h.orig 2015-09-01 13:04:54 UTC ++++ enc/histogram.h +@@ -17,13 +17,13 @@ + #ifndef BROTLI_ENC_HISTOGRAM_H_ + #define BROTLI_ENC_HISTOGRAM_H_ + +-#include + #include + #include + #include + #include "./command.h" + #include "./fast_log.h" + #include "./prefix.h" ++#include "./types.h" + + namespace brotli { + +--- enc/literal_cost.cc.orig 2015-09-01 13:04:54 UTC ++++ enc/literal_cost.cc +@@ -17,10 +17,10 @@ + #include "./literal_cost.h" + + #include +-#include + #include + + #include "./fast_log.h" ++#include "./types.h" + + namespace brotli { + +--- enc/literal_cost.h.orig 2015-09-01 13:04:54 UTC ++++ enc/literal_cost.h +@@ -17,8 +17,7 @@ + #ifndef BROTLI_ENC_LITERAL_COST_H_ + #define BROTLI_ENC_LITERAL_COST_H_ + +-#include +-#include ++#include "./types.h" + + namespace brotli { + +--- enc/port.h.orig 2015-09-01 13:04:54 UTC ++++ enc/port.h +@@ -18,6 +18,7 @@ + #define BROTLI_ENC_PORT_H_ + + #include ++#include "./types.h" + + #if defined OS_LINUX || defined OS_CYGWIN + #include +--- enc/prefix.h.orig 2015-09-01 13:04:54 UTC ++++ enc/prefix.h +@@ -18,8 +18,8 @@ + #ifndef BROTLI_ENC_PREFIX_H_ + #define BROTLI_ENC_PREFIX_H_ + +-#include + #include "./fast_log.h" ++#include "./types.h" + + namespace brotli { + +--- enc/ringbuffer.h.orig 2015-09-01 13:04:54 UTC ++++ enc/ringbuffer.h +@@ -17,10 +17,9 @@ + #ifndef BROTLI_ENC_RINGBUFFER_H_ + #define BROTLI_ENC_RINGBUFFER_H_ + +-#include +-#include + + #include "./port.h" ++#include "./types.h" + + namespace brotli { + +--- enc/static_dict.h.orig 2015-09-01 13:04:54 UTC ++++ enc/static_dict.h +@@ -17,7 +17,7 @@ + #ifndef BROTLI_ENC_STATIC_DICT_H_ + #define BROTLI_ENC_STATIC_DICT_H_ + +-#include ++#include "./types.h" + + namespace brotli { + +--- enc/static_dict_lut.h.orig 2015-09-01 13:04:54 UTC ++++ enc/static_dict_lut.h +@@ -17,7 +17,7 @@ + #ifndef BROTLI_ENC_DICTIONARY_LUT_H_ + #define BROTLI_ENC_DICTIONARY_LUT_H_ + +-#include ++#include "./types.h" + + namespace brotli { + +--- enc/streams.h.orig 2015-09-01 13:04:54 UTC ++++ enc/streams.h +@@ -17,9 +17,10 @@ + #ifndef BROTLI_ENC_STREAMS_H_ + #define BROTLI_ENC_STREAMS_H_ + +-#include + #include + #include ++#include "./port.h" ++#include "./types.h" + + namespace brotli { + +@@ -56,7 +57,7 @@ class BrotliMemIn : public BrotliIn { + // returns the amount of data consumed + int position() const { return pos_; } + +- const void* Read(size_t n, size_t* OUTPUT) override; ++ const void* Read(size_t n, size_t* OUTPUT); + + private: + const void* buf_; // start of input buffer +@@ -74,7 +75,7 @@ class BrotliMemOut : public BrotliOut { + // returns the amount of data written + int position() const { return pos_; } + +- bool Write(const void* buf, size_t n) override; ++ bool Write(const void* buf, size_t n); + + private: + void* buf_; // start of output buffer +@@ -92,7 +93,7 @@ class BrotliStringOut : public BrotliOut + + void Reset(std::string* buf, int max_len); + +- bool Write(const void* buf, size_t n) override; ++ bool Write(const void* buf, size_t n); + + private: + std::string* buf_; // start of output buffer +@@ -105,7 +106,7 @@ class BrotliFileIn : public BrotliIn { + BrotliFileIn(FILE* f, size_t max_read_size); + ~BrotliFileIn(); + +- const void* Read(size_t n, size_t* bytes_read) override; ++ const void* Read(size_t n, size_t* bytes_read); + + private: + FILE* f_; +@@ -118,7 +119,7 @@ class BrotliFileOut : public BrotliOut { + public: + explicit BrotliFileOut(FILE* f); + +- bool Write(const void* buf, size_t n) override; ++ bool Write(const void* buf, size_t n); + private: + FILE* f_; + }; +--- enc/types.h.orig 2015-10-04 15:45:23 UTC ++++ enc/types.h +@@ -0,0 +1,36 @@ ++/* Copyright 2013 Google Inc. All Rights Reserved. ++ ++ Licensed under the Apache License, Version 2.0 (the "License"); ++ you may not use this file except in compliance with the License. ++ You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++ Unless required by applicable law or agreed to in writing, software ++ distributed under the License is distributed on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++ See the License for the specific language governing permissions and ++ limitations under the License. ++*/ ++ ++/* Common types */ ++ ++#ifndef BROTLI_ENC_TYPES_H_ ++#define BROTLI_ENC_TYPES_H_ ++ ++#include /* for size_t */ ++ ++#if defined(_MSC_VER) && (_MSC_VER < 1600) ++typedef signed char int8_t; ++typedef unsigned char uint8_t; ++typedef signed short int16_t; ++typedef unsigned short uint16_t; ++typedef signed int int32_t; ++typedef unsigned int uint32_t; ++typedef unsigned long long int uint64_t; ++typedef long long int int64_t; ++#else ++#include ++#endif /* defined(_MSC_VER) && (_MSC_VER < 1600) */ ++ ++#endif /* BROTLI_ENC_TYPES_H_ */ +--- enc/write_bits.h.orig 2015-09-01 13:04:54 UTC ++++ enc/write_bits.h +@@ -18,10 +18,10 @@ + #define BROTLI_ENC_WRITE_BITS_H_ + + #include +-#include + #include + + #include "./port.h" ++#include "./types.h" + + namespace brotli { + +--- setup.py.orig 2015-09-01 13:04:54 UTC ++++ setup.py +@@ -175,6 +175,7 @@ brotli = Extension("brotli", + "enc/static_dict_lut.h", + "enc/streams.h", + "enc/transform.h", ++ "enc/types.h", + "enc/write_bits.h", + "dec/bit_reader.h", + "dec/context.h",