From 789ad958a19bfb4329fe6af599a6c0bb65539b85 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Wed, 3 Nov 2021 17:28:13 +0100 Subject: [PATCH] Added putf80 method, which was not implemented yet --- byte_order_stuff.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/byte_order_stuff.cpp b/byte_order_stuff.cpp index 6f204d6..3ee9070 100644 --- a/byte_order_stuff.cpp +++ b/byte_order_stuff.cpp @@ -72,6 +72,14 @@ void data_streamer::putsi24(int32_t val, std::ostream& file) const { putui24(static_cast(val), file); } +void data_streamer::putf80(double val, std::ostream& file) const { + float_80 f80 {val}; + if (_target_byte_order != byte_order::big_endian) { + byte_swap(f80._val, sizeof(f80._val)); + } + file.write(reinterpret_cast(f80._val), sizeof(f80._val)); +} + // byte_order_changer ---------------------------------------------------------- byte_order_changer::byte_order_changer(data_streamer* ds, byte_order order) : _data_streamer {ds} {