Loading src/os/object/xdrinput.cc +4 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ float XDRInput::get_float() uint32_t i; float f; } v; // Setting one member of a struct and then reading another is undefined // behaviour, but works as intended in nearly any (embedded) compiler v.i = get_uint32(); return v.f; } Loading @@ -51,6 +53,8 @@ double XDRInput::get_double() uint64_t i; double d; } v; // Setting one member of a struct and then reading another is undefined // behaviour, but works as intended in nearly any (embedded) compiler v.i = get_uint64(); return v.d; } Loading src/os/object/xdrstream.cc +4 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,8 @@ XDRStream & XDRStream::operator<<(float number) uint32_t i; float f; } v; // Setting one member of a struct and then reading another is undefined // behaviour, but works as intended in nearly any (embedded) compiler v.f = number; *this << v.i; return *this; Loading @@ -85,6 +87,8 @@ XDRStream & XDRStream::operator<<(double number) uint64_t i; double d; } v; // Setting one member of a struct and then reading another is undefined // behaviour, but works as intended in nearly any (embedded) compiler v.d = number; *this << v.i; return *this; Loading Loading
src/os/object/xdrinput.cc +4 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ float XDRInput::get_float() uint32_t i; float f; } v; // Setting one member of a struct and then reading another is undefined // behaviour, but works as intended in nearly any (embedded) compiler v.i = get_uint32(); return v.f; } Loading @@ -51,6 +53,8 @@ double XDRInput::get_double() uint64_t i; double d; } v; // Setting one member of a struct and then reading another is undefined // behaviour, but works as intended in nearly any (embedded) compiler v.i = get_uint64(); return v.d; } Loading
src/os/object/xdrstream.cc +4 −0 Original line number Diff line number Diff line Loading @@ -74,6 +74,8 @@ XDRStream & XDRStream::operator<<(float number) uint32_t i; float f; } v; // Setting one member of a struct and then reading another is undefined // behaviour, but works as intended in nearly any (embedded) compiler v.f = number; *this << v.i; return *this; Loading @@ -85,6 +87,8 @@ XDRStream & XDRStream::operator<<(double number) uint64_t i; double d; } v; // Setting one member of a struct and then reading another is undefined // behaviour, but works as intended in nearly any (embedded) compiler v.d = number; *this << v.i; return *this; Loading