mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
42 lines
1.3 KiB
Diff
42 lines
1.3 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Tyler Veness <calcmogul@gmail.com>
|
|
Date: Tue, 28 Jan 2025 22:19:14 -0800
|
|
Subject: [PATCH 3/8] Use wpi::byteswap()
|
|
|
|
---
|
|
include/.styleguide | 1 +
|
|
include/sleipnir/util/spy.hpp | 3 ++-
|
|
2 files changed, 3 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/include/.styleguide b/include/.styleguide
|
|
index 4f4c76204071f90bf49eddb8c2aceb583b5e09ba..03938557c2600a7a1f72c6b93c935602f5acb2b2 100644
|
|
--- a/include/.styleguide
|
|
+++ b/include/.styleguide
|
|
@@ -10,4 +10,5 @@ includeOtherLibs {
|
|
^Eigen/
|
|
^fmt/
|
|
^gch/
|
|
+ ^wpi/
|
|
}
|
|
diff --git a/include/sleipnir/util/spy.hpp b/include/sleipnir/util/spy.hpp
|
|
index a2f94803e3744cee771669210d1af883160e9896..74dd7990b03783ce805a186920d5142caeb178c6 100644
|
|
--- a/include/sleipnir/util/spy.hpp
|
|
+++ b/include/sleipnir/util/spy.hpp
|
|
@@ -12,6 +12,7 @@
|
|
#include <string_view>
|
|
|
|
#include <Eigen/SparseCore>
|
|
+#include <wpi/util/bit.hpp>
|
|
|
|
#include "sleipnir/util/symbol_exports.hpp"
|
|
|
|
@@ -115,7 +116,7 @@ class SLEIPNIR_DLLEXPORT Spy {
|
|
*/
|
|
void write32le(int32_t num) {
|
|
if constexpr (std::endian::native != std::endian::little) {
|
|
- num = std::byteswap(num);
|
|
+ num = wpi::util::byteswap(num);
|
|
}
|
|
m_file.write(reinterpret_cast<char*>(&num), sizeof(num));
|
|
}
|