mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
[upstream_utils] Upgrade Sleipnir (#7973)
This commit is contained in:
@@ -1,30 +1,32 @@
|
||||
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 1/3] Use fmtlib
|
||||
Subject: [PATCH 1/8] Use fmtlib
|
||||
|
||||
---
|
||||
include/.styleguide | 1 +
|
||||
include/sleipnir/util/Print.hpp | 31 ++++++++++++++++++-------------
|
||||
2 files changed, 19 insertions(+), 13 deletions(-)
|
||||
include/sleipnir/util/print.hpp | 31 ++++++++++++++++++-------------
|
||||
src/optimization/problem.cpp | 2 +-
|
||||
3 files changed, 20 insertions(+), 14 deletions(-)
|
||||
|
||||
diff --git a/include/.styleguide b/include/.styleguide
|
||||
index 8fb61fdf9cc5ceff633d3126f0579eef25a1326f..6a7f8ed28f9cb037c9746a7e0ef5e110481d9825 100644
|
||||
index 1b6652d3d5886cf8c9eca0d855c21031775bad7c..4f4c76204071f90bf49eddb8c2aceb583b5e09ba 100644
|
||||
--- a/include/.styleguide
|
||||
+++ b/include/.styleguide
|
||||
@@ -12,4 +12,5 @@ licenseUpdateExclude {
|
||||
@@ -8,5 +8,6 @@ cppSrcFileInclude {
|
||||
|
||||
includeOtherLibs {
|
||||
^Eigen/
|
||||
+ ^fmt/
|
||||
^gch/
|
||||
}
|
||||
diff --git a/include/sleipnir/util/Print.hpp b/include/sleipnir/util/Print.hpp
|
||||
index a746cb77b70f095bb15f4c493295cb925bc74cd3..c01fd4ac679df854b885293d681ea1e0984626fa 100644
|
||||
--- a/include/sleipnir/util/Print.hpp
|
||||
+++ b/include/sleipnir/util/Print.hpp
|
||||
@@ -3,52 +3,57 @@
|
||||
#pragma once
|
||||
diff --git a/include/sleipnir/util/print.hpp b/include/sleipnir/util/print.hpp
|
||||
index fe430352dabf4cd6a890dc8007237c7a261dfd4b..055d5c9fa246201f1d8ae7ddca00b1159aeb2a57 100644
|
||||
--- a/include/sleipnir/util/print.hpp
|
||||
+++ b/include/sleipnir/util/print.hpp
|
||||
@@ -4,10 +4,15 @@
|
||||
|
||||
#ifndef SLEIPNIR_DISABLE_DIAGNOSTICS
|
||||
#include <cstdio>
|
||||
-#include <print>
|
||||
#include <system_error>
|
||||
@@ -36,7 +38,11 @@ index a746cb77b70f095bb15f4c493295cb925bc74cd3..c01fd4ac679df854b885293d681ea1e0
|
||||
+#include <fmt/core.h>
|
||||
+#endif
|
||||
+
|
||||
namespace sleipnir {
|
||||
#endif
|
||||
|
||||
namespace slp {
|
||||
@@ -15,45 +20,45 @@ namespace slp {
|
||||
#ifndef SLEIPNIR_DISABLE_DIAGNOSTICS
|
||||
|
||||
/**
|
||||
- * Wrapper around std::print() that squelches write failure exceptions.
|
||||
@@ -93,3 +99,16 @@ index a746cb77b70f095bb15f4c493295cb925bc74cd3..c01fd4ac679df854b885293d681ea1e0
|
||||
} catch (const std::system_error&) {
|
||||
}
|
||||
}
|
||||
diff --git a/src/optimization/problem.cpp b/src/optimization/problem.cpp
|
||||
index 31115490867146ec166604bcc61731d7891a9f22..81863808d329a53d4162ce0624a3b8e8afc32dfc 100644
|
||||
--- a/src/optimization/problem.cpp
|
||||
+++ b/src/optimization/problem.cpp
|
||||
@@ -335,7 +335,7 @@ void Problem::print_exit_conditions([[maybe_unused]] const Options& options) {
|
||||
slp::println(" ↳ executed {} iterations", options.max_iterations);
|
||||
}
|
||||
if (std::isfinite(options.timeout.count())) {
|
||||
- slp::println(" ↳ {} elapsed", options.timeout);
|
||||
+ slp::println(" ↳ {} elapsed", options.timeout.count());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user