summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2018-11-30 09:26:05 +0100
committerDaniel Friesel <derf@finalrewind.org>2018-11-30 09:26:05 +0100
commitfd34ebda2f2d2858b5f0fe96feae53ae6a2c268f (patch)
tree184b29f63403f0e062526d7e978d5907b92bb415 /src
parentd5636b932e111056e852316cdbe6a711a9643183 (diff)
XDR: Add float and double support
Diffstat (limited to 'src')
-rw-r--r--src/os/object/xdrinput.cc12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/os/object/xdrinput.cc b/src/os/object/xdrinput.cc
index 561c779..077f695 100644
--- a/src/os/object/xdrinput.cc
+++ b/src/os/object/xdrinput.cc
@@ -35,6 +35,18 @@ int64_t XDRInput::get_int64()
return (ret0 << 32) | ret1;
}
+float XDRInput::get_float()
+{
+ uint32_t val = get_uint32();
+ return *(float*)&val;
+}
+
+double XDRInput::get_double()
+{
+ uint64_t val = get_uint64();
+ return *(double*)&val;
+}
+
uint32_t XDRInput::get_opaque_length()
{
return get_uint32();