Lines 87-95
Link Here
|
87 |
void Buffer::writeFloat(float f) { |
87 |
void Buffer::writeFloat(float f) { |
88 |
// FIXME: on some machines this may fail badly (there is explicit |
88 |
// FIXME: on some machines this may fail badly (there is explicit |
89 |
// float marshalling and demarshalling code in mico/orb/util.cc) |
89 |
// float marshalling and demarshalling code in mico/orb/util.cc) |
90 |
|
90 |
union { float f; long l; } u = {f}; |
91 |
long *f_as_long = (long *)&f; |
91 |
writeLong(u.l); |
92 |
writeLong(*f_as_long); |
|
|
93 |
} |
92 |
} |
94 |
|
93 |
|
95 |
void Buffer::writeFloatSeq(const std::vector<float>& seq) { |
94 |
void Buffer::writeFloatSeq(const std::vector<float>& seq) { |
Lines 252-260
Link Here
|
252 |
float Buffer::readFloat() |
251 |
float Buffer::readFloat() |
253 |
{ |
252 |
{ |
254 |
// FIXME: see writeFloat() |
253 |
// FIXME: see writeFloat() |
255 |
long f_as_long = readLong(); |
254 |
union {float f; long l; } u; |
|
|
255 |
u.l = readLong(); |
256 |
|
256 |
|
257 |
if(!_readError) return *(float *)&f_as_long; |
257 |
if(!_readError) return u.f; |
258 |
return 0.0; |
258 |
return 0.0; |
259 |
} |
259 |
} |
260 |
|
260 |
|