Skip to content

Commit

Permalink
[upstream_utils] Upgrade Sleipnir and use wpi::SmallVector (wpilibsui…
Browse files Browse the repository at this point in the history
  • Loading branch information
calcmogul authored Jun 21, 2024
1 parent e2893fc commit 2586575
Show file tree
Hide file tree
Showing 29 changed files with 780 additions and 596 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Subject: [PATCH 1/4] Remove "using enum" declarations
2 files changed, 73 insertions(+), 110 deletions(-)

diff --git a/include/sleipnir/autodiff/Expression.hpp b/include/sleipnir/autodiff/Expression.hpp
index 5b8dc5dca9bd685e6647e79f5fd4699bb9909853..802a8602a125251058cfe22447911999f035efad 100644
index 99997da577f5d4de81dc0c6de3cc7225676f5aa3..0f306e3b2dccbe63367be7856d051d943a09f910 100644
--- a/include/sleipnir/autodiff/Expression.hpp
+++ b/include/sleipnir/autodiff/Expression.hpp
@@ -191,8 +191,6 @@ struct SLEIPNIR_DLLEXPORT Expression {
Expand Down
24 changes: 0 additions & 24 deletions upstream_utils/sleipnir_patches/0002-Add-implicit-typename.patch

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,48 +1,23 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Wed, 29 May 2024 16:29:55 -0700
Subject: [PATCH 3/4] Use fmtlib
Subject: [PATCH 2/4] Use fmtlib

---
include/.styleguide | 1 +
include/sleipnir/util/Assert.hpp | 5 +++--
include/sleipnir/util/Print.hpp | 27 ++++++++++++++-------------
3 files changed, 18 insertions(+), 15 deletions(-)
include/.styleguide | 1 +
include/sleipnir/util/Print.hpp | 27 ++++++++++++++-------------
2 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/include/.styleguide b/include/.styleguide
index f3b2f0cf9e60b3a86b9654ff2b381f9c48734ff6..8251a490677bcf5fd316d5303195b0fa4e599b75 100644
index 8fb61fdf9cc5ceff633d3126f0579eef25a1326f..6a7f8ed28f9cb037c9746a7e0ef5e110481d9825 100644
--- a/include/.styleguide
+++ b/include/.styleguide
@@ -8,4 +8,5 @@ cppSrcFileInclude {
@@ -12,4 +12,5 @@ licenseUpdateExclude {

includeOtherLibs {
^Eigen/
+ ^fmt/
}
diff --git a/include/sleipnir/util/Assert.hpp b/include/sleipnir/util/Assert.hpp
index ba381ef8f48446e6d07b6d7973a8271cbda8fec9..9999544278c493f263c819811cb4fbcb407b04f1 100644
--- a/include/sleipnir/util/Assert.hpp
+++ b/include/sleipnir/util/Assert.hpp
@@ -3,8 +3,9 @@
#pragma once

#ifdef JORMUNGANDR
-#include <format>
#include <stdexcept>
+
+#include <fmt/format.h>
/**
* Throw an exception in Python.
*/
@@ -12,7 +13,7 @@
do { \
if (!(condition)) { \
throw std::invalid_argument( \
- std::format("{}:{}: {}: Assertion `{}' failed.", __FILE__, __LINE__, \
+ fmt::format("{}:{}: {}: Assertion `{}' failed.", __FILE__, __LINE__, \
__func__, #condition)); \
} \
} while (0);
diff --git a/include/sleipnir/util/Print.hpp b/include/sleipnir/util/Print.hpp
index 339320bce6d017ca85025060ba445b2f025bb225..fcf2e69bfb5a081cd915bdded3caa80cd9c38518 100644
--- a/include/sleipnir/util/Print.hpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tyler Veness <calcmogul@gmail.com>
Date: Mon, 20 May 2024 09:01:54 -0700
Subject: [PATCH 4/4] Remove unsupported constexpr
Subject: [PATCH 3/4] Remove unsupported constexpr

---
include/sleipnir/autodiff/Expression.hpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/sleipnir/autodiff/Expression.hpp b/include/sleipnir/autodiff/Expression.hpp
index 802a8602a125251058cfe22447911999f035efad..7aa715a0aa5f4560b4e16cf5f0458f1385b88c7d 100644
index 0f306e3b2dccbe63367be7856d051d943a09f910..758433270a1cbe1b33f8b41d3e971b58de711e18 100644
--- a/include/sleipnir/autodiff/Expression.hpp
+++ b/include/sleipnir/autodiff/Expression.hpp
@@ -21,8 +21,8 @@ namespace sleipnir::detail {
Expand Down
Loading

0 comments on commit 2586575

Please sign in to comment.