diff --git a/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp b/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp index 5709b43e4f..931624cda9 100644 --- a/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp +++ b/wpilibOldCommands/src/main/native/cpp/commands/Scheduler.cpp @@ -232,7 +232,7 @@ void Scheduler::Impl::ProcessCommandAddition(Command* command) { if (found == commands.end()) { // Check that the requirements can be had const auto& requirements = command->GetRequirements(); - for (const auto& requirement : requirements) { + for (const auto requirement : requirements) { if (requirement->GetCurrentCommand() != nullptr && !requirement->GetCurrentCommand()->IsInterruptible()) return; diff --git a/wpiutil/src/main/native/cpp/json_serializer.h b/wpiutil/src/main/native/cpp/json_serializer.h index 6983920fdd..6c5ffbe477 100644 --- a/wpiutil/src/main/native/cpp/json_serializer.h +++ b/wpiutil/src/main/native/cpp/json_serializer.h @@ -36,6 +36,7 @@ SOFTWARE. #include // lconv, localeconv #include // labs, isfinite, isnan, signbit, ldexp #include // locale +#include #include "wpi/raw_ostream.h" @@ -99,6 +100,18 @@ class json::serializer */ void dump_escaped(StringRef s, const bool ensure_ascii); + template , int> = 0> + bool is_negative_integer(NumberType x) { + return false; + } + + template , int> = 0> + bool is_negative_integer(NumberType x) { + return x < 0; + } + /*! @brief dump an integer @@ -121,7 +134,7 @@ class json::serializer return; } - const bool is_negative = (x <= 0) and (x != 0); // see issue #755 + const bool is_negative = is_negative_integer(x); // see issue #755 std::size_t i = 0; while (x != 0)