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

void EndianDoubleUtil::write ( FILE *  output,
double const &  val 
) [static]

Write procedure.

Parameters:
outputthe stream to write to
valthe value of the generic object to write to the stream

Definition at line 62 of file endian_double_util.cc.

{
  double val2 = val;
#ifdef WORDS_BIGENDIAN
  fwrite(&val2, sizeof(double), 1, output);
#else
  char *s = reinterpret_cast<char *>(&val2);
    
  for(int i = sizeof(double)-1; i != -1; i--)
  {
    fwrite(&(s[i]), 1, 1, output);
  }
#endif
}

Generated by  Doxygen 1.6.0   Back to index