FreeBSD/contrib/ntp/ntpd/refclock_tt560.c
/******************************************************************
 *
 *  byte_swap
 *
 *  Inputs: 32 bit integer
 *
 *  Output: byte swapped 32 bit integer.
 *
 *  This routine is used to compensate for the byte alignment
 *  differences between big-endian and little-endian integers.
 *
 ******************************************************************/
byte_swap
Inputs: 32 bit integer

byte swapped 32 bit integer.

This routine is used to compensate for the byte alignment
differences between big-endian and little-endian integers.
byte_swap Inputs : 32 bit integer byte swapped 32 bit integer . This routine is used to compensate for the byte alignment differences between big - endian and little - endian integers .
static unsigned int
byte_swap(unsigned int input_num)
{
    byteswap_t    byte_swap;
    unsigned char temp;
    byte_swap.long_word = input_num;
    temp              = byte_swap.byte[3];
    byte_swap.byte[3] = byte_swap.byte[0];
    byte_swap.byte[0] = temp;
    temp              = byte_swap.byte[2];
    byte_swap.byte[2] = byte_swap.byte[1];
    byte_swap.byte[1] = temp;
    return (byte_swap.long_word);
}
static unsigned int byte_swap ( unsigned int input_num ) { byteswap_t byte_swap ; unsigned char temp ; byte_swap . long_word = input_num ; temp = byte_swap . byte [ 3 ] ; byte_swap . byte [ 3 ] = byte_swap . byte [ 0 ] ; byte_swap . byte [ 0 ] = temp ; temp = byte_swap . byte [ 2 ] ; byte_swap . byte [ 2 ] = byte_swap . byte [ 1 ] ; byte_swap . byte [ 1 ] = temp ; return ( byte_swap . long_word ) ; }
byte_swap
  Inputs: 32 bit integer
byte_swap Inputs : 32 bit integer