diff options
author | Daniel Friesel <derf@finalrewind.org> | 2018-11-19 09:37:32 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2018-11-19 09:37:32 +0100 |
commit | 0a4a3e085f162fb3d34da3522bca7e7eeb8847e9 (patch) | |
tree | ea8af08c32c4041cf6a246d59ff267077a18c6ab /src | |
parent | 3b660dbb8528542354f6488f6c22519b95a49b91 (diff) |
XDRStream: Support float/double
Diffstat (limited to 'src')
-rw-r--r-- | src/os/object/xdrstream.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/os/object/xdrstream.cc b/src/os/object/xdrstream.cc index bc2ad89..888153b 100644 --- a/src/os/object/xdrstream.cc +++ b/src/os/object/xdrstream.cc @@ -68,6 +68,18 @@ XDRStream & XDRStream::operator<<(int64_t number) return *this; } +XDRStream & XDRStream::operator<<(float number) +{ + *this << *(uint32_t*)&number; + return *this; +} + +XDRStream & XDRStream::operator<<(double number) +{ + *this << *(uint64_t*)&number; + return *this; +} + XDRStream & XDRStream::operator<<(char const *data){ if (!is_fixed_length) { *this << next_array_len; |