mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-25 01:41:43 +00:00
Use std::bit_cast (#7567)
Backport #7492 Co-authored-by: Tyler Veness <calcmogul@gmail.com>
This commit is contained in:
@@ -2,15 +2,14 @@
|
||||
// Open Source Software; you can modify and/or share it under the terms of
|
||||
// the WPILib BSD license file in the root directory of this project.
|
||||
|
||||
#include <bit>
|
||||
#include <cstdio>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <fmt/format.h>
|
||||
#include <wpi/MathExtras.h>
|
||||
#include <wpi/SmallVector.h>
|
||||
#include <wpi/StringExtras.h>
|
||||
#include <wpi/bit.h>
|
||||
#include <wpi/print.h>
|
||||
#include <wpi/timestamp.h>
|
||||
|
||||
@@ -43,7 +42,7 @@ static bool NewlineBuffer(std::string& rem, uv::Buffer& buf, size_t len,
|
||||
if (tcp) {
|
||||
// Header is 2 byte len, 1 byte type, 4 byte timestamp, 2 byte sequence num
|
||||
uint32_t ts =
|
||||
wpi::bit_cast<uint32_t, float>((wpi::Now() - startTime) * 1.0e-6);
|
||||
std::bit_cast<uint32_t, float>((wpi::Now() - startTime) * 1.0e-6);
|
||||
uint16_t len = rem.size() + toCopy.size() + 1 + 4 + 2;
|
||||
const uint8_t header[] = {static_cast<uint8_t>((len >> 8) & 0xff),
|
||||
static_cast<uint8_t>(len & 0xff),
|
||||
|
||||
Reference in New Issue
Block a user