Change the substream implementation in pb_decode.

This makes it unnecessary to copy back the state, and also relaxes
the requirements on callbacks (bytes_left will always be valid).
It decreases code size by a few bytes, but may be just slightly slower.
This commit is contained in:
Petteri Aimonen
2012-08-24 19:35:17 +03:00
parent 86257a2a70
commit dc2da0edc5
2 changed files with 13 additions and 20 deletions

View File

@@ -23,10 +23,6 @@
*
* 3) You can use state to store your own data (e.g. buffer pointer),
* and rely on pb_read to verify that no-body reads past bytes_left.
*
* 4) Your callback may be used with substreams, in which case bytes_left
* is different than from the main stream. Don't use bytes_left to compute
* any pointers.
*/
struct _pb_istream_t
{