mork_num count = (mork_num) (at - buf);
mork_num count = at - buf;
morkStream::spill_buf(morkEnv* ev) // spill/flush from buffer to file{  morkFile* file = mStream_ContentFile;  if ( this->IsOpenOrClosingNode() && this->FileActive() && file )  {    mork_u1* buf = mStream_Buf;    if ( mStream_Dirty )    {      mork_u1* at = mStream_At;      if ( at >= buf && at <= mStream_WriteEnd ) // order?      {        mork_num count = (mork_num) (at - buf); // bytes buffered        if ( count ) // anything to write to the string?        {          if ( count > mStream_BufSize ) // no more than max?          {            count = mStream_BufSize;            mStream_WriteEnd = buf + mStream_BufSize;            this->NewBadCursorSlotsError(ev);          }          if ( ev->Good() )          {            file->Seek(ev, mStream_BufPos);            if ( ev->Good() )            {              file->Write(ev, buf, count);              if ( ev->Good() )              {                mStream_BufPos += count; // past bytes written                mStream_At = buf; // reset buffer cursor                mStream_Dirty = morkBool_kFalse;              }            }          }        }      }      else this->NewBadCursorOrderError(ev);    }    else    {#ifdef MORK_DEBUG      ev->NewWarning("stream:spill:not:dirty");#endif /*MORK_DEBUG*/    }  }  else this->NewFileDownError(ev);}