Logo Search packages:      
Sourcecode: apertium version File versions  Download package

double EndianDoubleUtil::read ( FILE *  input  )  [static]

Read procedure.

Parameters:
input the stream to read from.
Returns:
the first element readed from the current position of the stream

Definition at line 28 of file endian_double_util.cc.

{
  double retval;
#ifdef WORDS_BIGENDIAN
  fread(&retval, sizeof(double), 1, input);
#else
  char *s = reinterpret_cast<char *>(&retval);

  for(int i = sizeof(double)-1; i != -1; i--)
  {
    fread(&(s[i]), 1, 1, input);
  } 
#endif
  return retval;
}


Generated by  Doxygen 1.6.0   Back to index