diff options
Diffstat (limited to 'src/os/object/xdrinput.cc')
-rw-r--r-- | src/os/object/xdrinput.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/os/object/xdrinput.cc b/src/os/object/xdrinput.cc index 5fb17bf..612244e 100644 --- a/src/os/object/xdrinput.cc +++ b/src/os/object/xdrinput.cc @@ -37,14 +37,22 @@ int64_t XDRInput::get_int64() float XDRInput::get_float() { - uint32_t val = get_uint32(); - return *(float*)&val; + union { + uint32_t i; + float f; + } v; + v.i = get_uint32(); + return v.f; } double XDRInput::get_double() { - uint64_t val = get_uint64(); - return *(double*)&val; + union { + uint64_t i; + double d; + } v; + v.i = get_uint64(); + return v.d; } uint32_t XDRInput::get_opaque_length() |