Lines Matching refs:state

208     if (enc.state < BCJ2_NUM_STREAMS)

210 if (enc.bufs[enc.state] != enc.lims[enc.state])
212 const size_t curSize = (size_t)(enc.bufs[enc.state] - _bufs[enc.state]);
213 // printf("Write stream = %2d %6d\n", enc.state, curSize);
214 RINOK(WriteStream(outStreams[enc.state], _bufs[enc.state], curSize))
215 if (enc.state == BCJ2_STREAM_RC)
217 enc.bufs[enc.state] = _bufs[enc.state];
218 enc.lims[enc.state] = _bufs[enc.state] + _bufsSizes[enc.state];
222 if (enc.state != BCJ2_ENC_STATE_ORIG)
224 // (enc.state == BCJ2_ENC_STATE_ORIG)
330 && (enc.state == BCJ2_ENC_STATE_ORIG)
458 (dec.state < BCJ2_NUM_STREAMS)
462 const unsigned state = dec.state;
465 Byte *buf = _bufs[state];
466 const Byte *cur = dec.bufs[state];
467 // if (cur != dec.lims[state]) throw 1; // unexpected case
468 dec.lims[state] =
469 dec.bufs[state] = buf;
470 total = (UInt32)_extraSizes[state];
475 if (_readRes[state] != S_OK)
480 UInt32 curSize = _bufsSizes[state] - total;
481 // if (state == 0) curSize = 0; // for debug
483 /* even if we have reached provided inSizes[state] limit,
490 const HRESULT hres = inStream->Read(_bufs[state] + total, curSize, &curSize);
491 _readRes[state] = hres;
494 _readSizes[state] += curSize;
499 while (total < 4 && BCJ2_IS_32BIT_STREAM(state));
507 if (BCJ2_IS_32BIT_STREAM(state))
510 _extraSizes[state] = extra;
513 if (_readRes[state] == S_OK)
514 _readRes[state] = S_FALSE; // actually it's stream error. So maybe we need another error code.
520 dec.lims[state] += total; // = _bufs[state] + total;
551 if (dec.state < BCJ2_NUM_STREAMS)
553 ReadInStream(inStreams[dec.state]);
554 const unsigned state = dec.state;
555 const HRESULT hres = _readRes[state];
556 if (dec.lims[state] == _bufs[state])
565 else // (BCJ2_DEC_STATE_ORIG_0 <= state <= BCJ2_STATE_ORIG)
629 Currently 7-Zip/7z code ends with (state == BCJ2_STREAM_MAIN),
632 And Bcj2Dec_Decode() exits with (state == BCJ2_STREAM_MAIN),
637 (state == BCJ2_DEC_STATE_ORIG), if we know the exact size
640 if (dec.state != BCJ2_STREAM_MAIN)
641 if (dec.state != BCJ2_DEC_STATE_ORIG)
746 if (dec.state >= BCJ2_NUM_STREAMS)
748 ReadInStream(_inStreams[dec.state]);
749 if (dec.lims[dec.state] == _bufs[dec.state])
754 res = _readRes[dec.state];
764 if (dec.state != BCJ2_STREAM_MAIN)
765 if (dec.state != BCJ2_DEC_STATE_ORIG)