filehash/ffdb_hash.c
static void
_ffdb_swap_header (ffdb_htab_t* hashp)
{
  ffdb_hashhdr_t *hdrp;
  int i;

  hdrp = &hashp->hdr;

  M_32_SWAP(hdrp->magic);
  M_32_SWAP(hdrp->version);
  M_32_SWAP(hdrp->lorder);
  M_32_SWAP(hdrp->bsize);
  M_32_SWAP(hdrp->bshift);
  M_32_SWAP(hdrp->ovfl_point);
  M_32_SWAP(hdrp->max_bucket);
  M_32_SWAP(hdrp->high_mask);
  M_32_SWAP(hdrp->low_mask);
  M_32_SWAP(hdrp->ffactor);
  M_32_SWAP(hdrp->nkeys);
  M_32_SWAP(hdrp->hdrpages);
  M_32_SWAP(hdrp->uinfolen);
  M_16_SWAP(hdrp->uinfo_page);
  M_16_SWAP(hdrp->uinfo_npages);
  M_16_SWAP(hdrp->cfig_page);
  M_16_SWAP(hdrp->cfig_npages);
  M_32_SWAP(hdrp->num_cfigs);
  M_32_SWAP(hdrp->h_charkey);
  M_32_SWAP(hdrp->num_moved_pages);
  for (i = 0; i < NCACHED; i++) 
    M_32_SWAP(hdrp->spares[i]);
  for (i = 0; i < NCACHED; i++) 
    M_32_SWAP(hdrp->free_pages[i]);
  M_32_SWAP(hdrp->chksum);
}
/**
 * Swap headers only if the byte order is little endian
 */
Swap headers only if the byte order is little endian
Swap headers only if the byte order is little endian
static void
_ffdb_swap_header (ffdb_htab_t* hashp)
{
  ffdb_hashhdr_t *hdrp;
  int i;
  hdrp = &hashp->hdr;
  M_32_SWAP(hdrp->magic);
  M_32_SWAP(hdrp->version);
  M_32_SWAP(hdrp->lorder);
  M_32_SWAP(hdrp->bsize);
  M_32_SWAP(hdrp->bshift);
  M_32_SWAP(hdrp->ovfl_point);
  M_32_SWAP(hdrp->max_bucket);
  M_32_SWAP(hdrp->high_mask);
  M_32_SWAP(hdrp->low_mask);
  M_32_SWAP(hdrp->ffactor);
  M_32_SWAP(hdrp->nkeys);
  M_32_SWAP(hdrp->hdrpages);
  M_32_SWAP(hdrp->uinfolen);
  M_16_SWAP(hdrp->uinfo_page);
  M_16_SWAP(hdrp->uinfo_npages);
  M_16_SWAP(hdrp->cfig_page);
  M_16_SWAP(hdrp->cfig_npages);
  M_32_SWAP(hdrp->num_cfigs);
  M_32_SWAP(hdrp->h_charkey);
  M_32_SWAP(hdrp->num_moved_pages);
  for (i = 0; i < NCACHED; i++) 
    M_32_SWAP(hdrp->spares[i]);
  for (i = 0; i < NCACHED; i++) 
    M_32_SWAP(hdrp->free_pages[i]);
  M_32_SWAP(hdrp->chksum);
}
static void _ffdb_swap_header ( ffdb_htab_t * hashp ) { ffdb_hashhdr_t * hdrp ; int i ; hdrp = & hashp -> hdr ; M_32_SWAP ( hdrp -> magic ) ; M_32_SWAP ( hdrp -> version ) ; M_32_SWAP ( hdrp -> lorder ) ; M_32_SWAP ( hdrp -> bsize ) ; M_32_SWAP ( hdrp -> bshift ) ; M_32_SWAP ( hdrp -> ovfl_point ) ; M_32_SWAP ( hdrp -> max_bucket ) ; M_32_SWAP ( hdrp -> high_mask ) ; M_32_SWAP ( hdrp -> low_mask ) ; M_32_SWAP ( hdrp -> ffactor ) ; M_32_SWAP ( hdrp -> nkeys ) ; M_32_SWAP ( hdrp -> hdrpages ) ; M_32_SWAP ( hdrp -> uinfolen ) ; M_16_SWAP ( hdrp -> uinfo_page ) ; M_16_SWAP ( hdrp -> uinfo_npages ) ; M_16_SWAP ( hdrp -> cfig_page ) ; M_16_SWAP ( hdrp -> cfig_npages ) ; M_32_SWAP ( hdrp -> num_cfigs ) ; M_32_SWAP ( hdrp -> h_charkey ) ; M_32_SWAP ( hdrp -> num_moved_pages ) ; for ( i = 0 ; i < NCACHED ; i ++ ) M_32_SWAP ( hdrp -> spares [ i ] ) ; for ( i = 0 ; i < NCACHED ; i ++ ) M_32_SWAP ( hdrp -> free_pages [ i ] ) ; M_32_SWAP ( hdrp -> chksum ) ; }
Swap headers only if the byte order is little endian
Swap headers only if the byte order is little endian