Builder/Builder/Common/plyfile.c
/******************************************************************************
  Reverse the order in an array of bytes.  This is the conversion from big
  endian to little endian and vice versa

Entry:
  bytes     - array of bytes to reverse (in place)
  num_bytes - number of bytes in array
******************************************************************************/
Reverse the order in an array of bytes.  This is the conversion from big
endian to little endian and vice versa

bytes     - array of bytes to reverse (in place)
num_bytes - number of bytes in array
Reverse the order in an array of bytes . This is the conversion from big endian to little endian and vice versa bytes - array of bytes to reverse ( in place ) num_bytes - number of bytes in array
void swap_bytes(char *bytes, int num_bytes)
{
    int i;
    char temp;
    for (i=0; i < num_bytes/2; i++)
    {
	temp = bytes[i];
	bytes[i] = bytes[(num_bytes-1)-i];
	bytes[(num_bytes-1)-i] = temp;
    }
}
void swap_bytes ( char * bytes , int num_bytes ) { int i ; char temp ; for ( i = 0 ; i < num_bytes / 2 ; i ++ ) { temp = bytes [ i ] ; bytes [ i ] = bytes [ ( num_bytes - 1 ) - i ] ; bytes [ ( num_bytes - 1 ) - i ] = temp ; } }
Reverse the order in an array of bytes.
Reverse the order in an array of bytes .