File tree 2 files changed +6
-4
lines changed
2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -241,16 +241,18 @@ LZSSDecoder::status LZSSDecoder::handle_state() {
241
241
return res;
242
242
}
243
243
244
- LZSSDecoder::status LZSSDecoder::decompress (const char * buffer, uint32_t size) {
244
+ LZSSDecoder::status LZSSDecoder::decompress (uint8_t * const buffer, uint32_t size) {
245
245
if (!get_char_cbk) {
246
- this ->in_buffer = ( uint8_t *) buffer;
246
+ this ->in_buffer = buffer;
247
247
this ->available += size;
248
248
}
249
249
250
250
status res = IN_PROGRESS;
251
251
252
252
while ((res = handle_state ()) == IN_PROGRESS);
253
253
254
+ this ->in_buffer = nullptr ;
255
+
254
256
return res;
255
257
}
256
258
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ class LZSSDecoder {
56
56
* decode the provided buffer until buffer ends, then pause the process
57
57
* @return DONE if the decompression is completed, NOT_COMPLETED if not
58
58
*/
59
- status decompress (const char * buffer=nullptr , uint32_t size=0 );
59
+ status decompress (uint8_t * const buffer=nullptr , uint32_t size=0 );
60
60
61
61
static const int LZSS_EOF = -1 ;
62
62
static const int LZSS_BUFFER_EMPTY = -2 ;
@@ -93,7 +93,7 @@ class LZSSDecoder {
93
93
int i, r;
94
94
95
95
std::function<void (const uint8_t )> put_char_cbk=nullptr ;
96
- std::function<void ( const uint8_t )> get_char_cbk=nullptr ;
96
+ std::function<uint8_t ( )> get_char_cbk=nullptr ;
97
97
98
98
inline void putc (const uint8_t c) { if (put_char_cbk) { put_char_cbk (c); } }
99
99
You can’t perform that action at this time.
0 commit comments