--- mcop/buffer.cc.orig 2004-03-24 14:51:23.586055192 +0100 +++ mcop/buffer.cc 2004-03-24 14:56:14.054897216 +0100 @@ -87,9 +87,8 @@ void Buffer::writeFloat(float f) { // FIXME: on some machines this may fail badly (there is explicit // float marshalling and demarshalling code in mico/orb/util.cc) - - long *f_as_long = (long *)&f; - writeLong(*f_as_long); + union { float f; long l; } u = {f}; + writeLong(u.l); } void Buffer::writeFloatSeq(const std::vector& seq) { @@ -252,9 +251,10 @@ float Buffer::readFloat() { // FIXME: see writeFloat() - long f_as_long = readLong(); + union {float f; long l; } u; + u.l = readLong(); - if(!_readError) return *(float *)&f_as_long; + if(!_readError) return u.f; return 0.0; }