mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-26 01:51:41 +00:00
Use std::bit_cast (#7492)
This commit is contained in:
@@ -5,11 +5,11 @@
|
||||
#include "WireDecoder3.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <bit>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
#include <wpi/SpanExtras.h>
|
||||
|
||||
#include "Message3.h"
|
||||
@@ -74,7 +74,7 @@ std::optional<uint64_t> WireDecoder3::SimpleValueReader::Read64(
|
||||
std::optional<double> WireDecoder3::SimpleValueReader::ReadDouble(
|
||||
std::span<const uint8_t>* in) {
|
||||
if (auto val = Read64(in)) {
|
||||
return wpi::bit_cast<double>(val.value());
|
||||
return std::bit_cast<double>(val.value());
|
||||
} else {
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
|
||||
#include "WireEncoder3.h"
|
||||
|
||||
#include <bit>
|
||||
|
||||
#include <wpi/Endian.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/leb128.h>
|
||||
#include <wpi/raw_ostream.h>
|
||||
@@ -33,7 +34,7 @@ static void Write32(wpi::raw_ostream& os, uint32_t val) {
|
||||
|
||||
static void WriteDouble(wpi::raw_ostream& os, double val) {
|
||||
uint8_t buf[8];
|
||||
wpi::support::endian::write64be(buf, wpi::bit_cast<uint64_t>(val));
|
||||
wpi::support::endian::write64be(buf, std::bit_cast<uint64_t>(val));
|
||||
os << buf;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user