FreeBSD/contrib/subversion/subversion/libsvn_fs_x/index.c
/* Read COUNT run-length-encoded (see rle_array) uint64 from STREAM and
 * return them in VALUES.
 */
Read COUNT run-length-encoded  uint64 from STREAM and
return them in VALUES.
Read COUNT run - length - encoded uint64 from STREAM and return them in VALUES .
static svn_error_t *
expand_rle(apr_array_header_t *values,
           svn_fs_x__packed_number_stream_t *stream,
           apr_size_t count)
{
  apr_array_clear(values);
  while (count)
    {
      apr_uint64_t value;
      SVN_ERR(packed_stream_get(&value, stream));
      if (value)
        {
          APR_ARRAY_PUSH(values, apr_uint64_t) = value;
          --count;
        }
      else
        {
          apr_uint64_t i;
          apr_uint64_t repetitions;
          SVN_ERR(packed_stream_get(&repetitions, stream));
          if (++repetitions > count)
            repetitions = count;
          for (i = 0; i < repetitions; ++i)
            APR_ARRAY_PUSH(values, apr_uint64_t) = 1;
          count -= repetitions;
        }
    }
  return SVN_NO_ERROR;
}
static svn_error_t * expand_rle ( apr_array_header_t * values , svn_fs_x__packed_number_stream_t * stream , apr_size_t count ) { apr_array_clear ( values ) ; while ( count ) { apr_uint64_t value ; SVN_ERR ( packed_stream_get ( & value , stream ) ) ; if ( value ) { APR_ARRAY_PUSH ( values , apr_uint64_t ) = value ; -- count ; } else { apr_uint64_t i ; apr_uint64_t repetitions ; SVN_ERR ( packed_stream_get ( & repetitions , stream ) ) ; if ( ++ repetitions > count ) repetitions = count ; for ( i = 0 ; i < repetitions ; ++ i ) APR_ARRAY_PUSH ( values , apr_uint64_t ) = 1 ; count -= repetitions ; } } return SVN_NO_ERROR ; }
Read COUNT run-length-encoded (see rle_array) uint64 from STREAM and
 return them in VALUES.
Read COUNT run - length - encoded ( see rle_array ) uint64 from STREAM and return them in VALUES .