OLD | NEW |
1 /////////////////////////////////////////////////////////////////////////////// | 1 /////////////////////////////////////////////////////////////////////////////// |
2 // | 2 // |
3 /// \file delta_encoder.c | 3 /// \file delta_encoder.c |
4 /// \brief Delta filter encoder | 4 /// \brief Delta filter encoder |
5 // | 5 // |
6 // Author: Lasse Collin | 6 // Author: Lasse Collin |
7 // | 7 // |
8 // This file has been put into the public domain. | 8 // This file has been put into the public domain. |
9 // You can do whatever you want with this file. | 9 // You can do whatever you want with this file. |
10 // | 10 // |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 encode_in_place(coder, out + out_start, *out_pos - out_start); | 79 encode_in_place(coder, out + out_start, *out_pos - out_start); |
80 } | 80 } |
81 | 81 |
82 return ret; | 82 return ret; |
83 } | 83 } |
84 | 84 |
85 | 85 |
86 static lzma_ret | 86 static lzma_ret |
87 delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator, | 87 delta_encoder_update(lzma_coder *coder, lzma_allocator *allocator, |
88 » » const lzma_filter *filters_null lzma_attribute((unused)), | 88 » » const lzma_filter *filters_null lzma_attribute((__unused__)), |
89 const lzma_filter *reversed_filters) | 89 const lzma_filter *reversed_filters) |
90 { | 90 { |
91 // Delta doesn't and will never support changing the options in | 91 // Delta doesn't and will never support changing the options in |
92 // the middle of encoding. If the app tries to change them, we | 92 // the middle of encoding. If the app tries to change them, we |
93 // simply ignore them. | 93 // simply ignore them. |
94 return lzma_next_filter_update( | 94 return lzma_next_filter_update( |
95 &coder->next, allocator, reversed_filters + 1); | 95 &coder->next, allocator, reversed_filters + 1); |
96 } | 96 } |
97 | 97 |
98 | 98 |
(...skipping 13 matching lines...) Expand all Loading... |
112 // The caller must have already validated the options, so it's | 112 // The caller must have already validated the options, so it's |
113 // LZMA_PROG_ERROR if they are invalid. | 113 // LZMA_PROG_ERROR if they are invalid. |
114 if (lzma_delta_coder_memusage(options) == UINT64_MAX) | 114 if (lzma_delta_coder_memusage(options) == UINT64_MAX) |
115 return LZMA_PROG_ERROR; | 115 return LZMA_PROG_ERROR; |
116 | 116 |
117 const lzma_options_delta *opt = options; | 117 const lzma_options_delta *opt = options; |
118 out[0] = opt->dist - LZMA_DELTA_DIST_MIN; | 118 out[0] = opt->dist - LZMA_DELTA_DIST_MIN; |
119 | 119 |
120 return LZMA_OK; | 120 return LZMA_OK; |
121 } | 121 } |
OLD | NEW |