FreeBSD/contrib/subversion/subversion/libsvn_fs_x/noderevs.c
/* Given the REP, return the index+1 into REPS that contains a copy of it.
 * Returns 0 for NULL IDs.  We use DICT to detect duplicates.
 */
Given the REP, return the index+1 into REPS that contains a copy of it.
Returns 0 for NULL IDs.  We use DICT to detect duplicates.
Given the REP return the index + 1 into REPS that contains a copy of it . Returns 0 for NULL IDs . We use DICT to detect duplicates .
static int
store_representation(apr_array_header_t *reps,
                     apr_hash_t *dict,
                     const svn_fs_x__representation_t *rep)
{
  int idx;
  void *idx_void;
  if (rep == NULL)
    return 0;
  idx_void = apr_hash_get(dict, rep, sizeof(*rep));
  idx = (int)(apr_uintptr_t)idx_void;
  if (idx == 0)
    {
      APR_ARRAY_PUSH(reps, svn_fs_x__representation_t) = *rep;
      idx = reps->nelts;
      apr_hash_set(dict, reps->elts + (idx-1) * reps->elt_size,
                   reps->elt_size, (void*)(apr_uintptr_t)idx);
    }
  return idx;
}
static int store_representation ( apr_array_header_t * reps , apr_hash_t * dict , const svn_fs_x__representation_t * rep ) { int idx ; void * idx_void ; if ( rep == NULL ) return 0 ; idx_void = apr_hash_get ( dict , rep , sizeof ( * rep ) ) ; idx = ( int ) ( apr_uintptr_t ) idx_void ; if ( idx == 0 ) { APR_ARRAY_PUSH ( reps , svn_fs_x__representation_t ) = * rep ; idx = reps -> nelts ; apr_hash_set ( dict , reps -> elts + ( idx - 1 ) * reps -> elt_size , reps -> elt_size , ( void * ) ( apr_uintptr_t ) idx ) ; } return idx ; }
Given the REP, return the index+1 into REPS that contains a copy of it.
Given the REP return the index + 1 into REPS that contains a copy of it .