FreeBSD/contrib/subversion/subversion/libsvn_subr/checksum.c
/* Create a svn_checksum_t with everything but the contents of the
   digest populated. */
Create a svn_checksum_t with everything but the contents of the
digest populated.
Create a svn_checksum_t with everything but the contents of the digest populated .
static svn_checksum_t *
checksum_create_without_digest(svn_checksum_kind_t kind,
                               apr_size_t digest_size,
                               apr_pool_t *pool)
{
  svn_checksum_t *checksum = apr_palloc(pool, sizeof(*checksum) + digest_size);
  checksum->digest = (unsigned char *)checksum + sizeof(*checksum);
  checksum->kind = kind;
  return checksum;
}
static svn_checksum_t * checksum_create_without_digest ( svn_checksum_kind_t kind , apr_size_t digest_size , apr_pool_t * pool ) { svn_checksum_t * checksum = apr_palloc ( pool , sizeof ( * checksum ) + digest_size ) ; checksum -> digest = ( unsigned char * ) checksum + sizeof ( * checksum ) ; checksum -> kind = kind ; return checksum ; }
Create a svn_checksum_t with everything but the contents of the
digest populated.
Create a svn_checksum_t with everything but the contents of the digest populated .
/* Use apr_palloc() instead of apr_pcalloc() so that the digest
   * contents are only set once by the caller. */