lz_decoder.h (207842) | lz_decoder.h (213700) |
---|---|
1/////////////////////////////////////////////////////////////////////////////// 2// 3/// \file lz_decoder.h 4/// \brief LZ out window 5/// 6// Authors: Igor Pavlov 7// Lasse Collin 8// --- 115 unchanged lines hidden (view full) --- 124 125 126/// Repeat *len bytes at distance. 127static inline bool 128dict_repeat(lzma_dict *dict, uint32_t distance, uint32_t *len) 129{ 130 // Don't write past the end of the dictionary. 131 const size_t dict_avail = dict->limit - dict->pos; | 1/////////////////////////////////////////////////////////////////////////////// 2// 3/// \file lz_decoder.h 4/// \brief LZ out window 5/// 6// Authors: Igor Pavlov 7// Lasse Collin 8// --- 115 unchanged lines hidden (view full) --- 124 125 126/// Repeat *len bytes at distance. 127static inline bool 128dict_repeat(lzma_dict *dict, uint32_t distance, uint32_t *len) 129{ 130 // Don't write past the end of the dictionary. 131 const size_t dict_avail = dict->limit - dict->pos; |
132 uint32_t left = MIN(dict_avail, *len); | 132 uint32_t left = my_min(dict_avail, *len); |
133 *len -= left; 134 135 // Repeat a block of data from the history. Because memcpy() is faster 136 // than copying byte by byte in a loop, the copying process gets split 137 // into three cases. 138 if (distance < left) { 139 // Source and target areas overlap, thus we can't use 140 // memcpy() nor even memmove() safely. --- 94 unchanged lines hidden --- | 133 *len -= left; 134 135 // Repeat a block of data from the history. Because memcpy() is faster 136 // than copying byte by byte in a loop, the copying process gets split 137 // into three cases. 138 if (distance < left) { 139 // Source and target areas overlap, thus we can't use 140 // memcpy() nor even memmove() safely. --- 94 unchanged lines hidden --- |