diff --git a/hal/src/main/native/sim/MockHooks.cpp b/hal/src/main/native/sim/MockHooks.cpp index 4e20c6acf5..93c385e2e4 100644 --- a/hal/src/main/native/sim/MockHooks.cpp +++ b/hal/src/main/native/sim/MockHooks.cpp @@ -122,7 +122,7 @@ void HALSIM_StepTiming(uint64_t delta) { int32_t status = 0; uint64_t curTime = HAL_GetFPGATime(&status); uint64_t nextTimeout = HALSIM_GetNextNotifierTimeout(); - uint64_t step = std::min(delta, nextTimeout - curTime); + uint64_t step = (std::min)(delta, nextTimeout - curTime); StepTiming(step); delta -= step; diff --git a/wpilibc/src/main/native/cpp/ADIS16448_IMU.cpp b/wpilibc/src/main/native/cpp/ADIS16448_IMU.cpp index ed23e2368e..7048720e59 100644 --- a/wpilibc/src/main/native/cpp/ADIS16448_IMU.cpp +++ b/wpilibc/src/main/native/cpp/ADIS16448_IMU.cpp @@ -196,7 +196,7 @@ bool ADIS16448_IMU::SwitchToStandardSPI() { while (data_count > 0) { /* Dequeue 200 at a time, or the remainder of the buffer if less than * 200 */ - m_spi->ReadAutoReceivedData(trashBuffer, std::min(200, data_count), + m_spi->ReadAutoReceivedData(trashBuffer, (std::min)(200, data_count), 0_s); /* Update remaining buffer count */ data_count = m_spi->ReadAutoReceivedData(trashBuffer, 0, 0_s); @@ -331,7 +331,7 @@ int ADIS16448_IMU::ConfigCalTime(CalibrationTime new_cal_time) { void ADIS16448_IMU::Calibrate() { std::scoped_lock sync(m_mutex); // Calculate the running average - int gyroAverageSize = std::min(m_accum_count, m_avg_size); + int gyroAverageSize = (std::min)(m_accum_count, m_avg_size); double accum_gyro_rate_x = 0.0; double accum_gyro_rate_y = 0.0; double accum_gyro_rate_z = 0.0; diff --git a/wpilibc/src/main/native/cpp/ADIS16470_IMU.cpp b/wpilibc/src/main/native/cpp/ADIS16470_IMU.cpp index 6e1cbcaeff..e1cd9863a6 100644 --- a/wpilibc/src/main/native/cpp/ADIS16470_IMU.cpp +++ b/wpilibc/src/main/native/cpp/ADIS16470_IMU.cpp @@ -193,7 +193,7 @@ bool ADIS16470_IMU::SwitchToStandardSPI() { while (data_count > 0) { /* Receive data, max of 200 words at a time (prevent potential segfault) */ - m_spi->ReadAutoReceivedData(trashBuffer, std::min(data_count, 200), + m_spi->ReadAutoReceivedData(trashBuffer, (std::min)(data_count, 200), 0_s); /*Get the remaining data count */ data_count = m_spi->ReadAutoReceivedData(trashBuffer, 0, 0_s); diff --git a/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp b/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp index 367dd6f846..8cce62eeb0 100644 --- a/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp +++ b/wpilibc/src/main/native/cpp/drive/DifferentialDrive.cpp @@ -103,8 +103,8 @@ DifferentialDrive::WheelSpeeds DifferentialDrive::ArcadeDriveIK( // Find the maximum possible value of (throttle + turn) along the vector that // the joystick is pointing, then desaturate the wheel speeds - double greaterInput = std::max(std::abs(xSpeed), std::abs(zRotation)); - double lesserInput = std::min(std::abs(xSpeed), std::abs(zRotation)); + double greaterInput = (std::max)(std::abs(xSpeed), std::abs(zRotation)); + double lesserInput = (std::min)(std::abs(xSpeed), std::abs(zRotation)); if (greaterInput == 0.0) { return {0.0, 0.0}; } diff --git a/wpimath/src/main/native/cpp/trajectory/constraint/DifferentialDriveVoltageConstraint.cpp b/wpimath/src/main/native/cpp/trajectory/constraint/DifferentialDriveVoltageConstraint.cpp index c79c313322..d60b4b68f2 100644 --- a/wpimath/src/main/native/cpp/trajectory/constraint/DifferentialDriveVoltageConstraint.cpp +++ b/wpimath/src/main/native/cpp/trajectory/constraint/DifferentialDriveVoltageConstraint.cpp @@ -33,8 +33,8 @@ DifferentialDriveVoltageConstraint::MinMaxAcceleration( auto wheelSpeeds = m_kinematics.ToWheelSpeeds({speed, 0_mps, speed * curvature}); - auto maxWheelSpeed = std::max(wheelSpeeds.left, wheelSpeeds.right); - auto minWheelSpeed = std::min(wheelSpeeds.left, wheelSpeeds.right); + auto maxWheelSpeed = (std::max)(wheelSpeeds.left, wheelSpeeds.right); + auto minWheelSpeed = (std::min)(wheelSpeeds.left, wheelSpeeds.right); // Calculate maximum/minimum possible accelerations from motor dynamics // and max/min wheel speeds diff --git a/wpimath/src/main/native/include/frc/system/NumericalIntegration.h b/wpimath/src/main/native/include/frc/system/NumericalIntegration.h index 48748e2472..bb856ece69 100644 --- a/wpimath/src/main/native/include/frc/system/NumericalIntegration.h +++ b/wpimath/src/main/native/include/frc/system/NumericalIntegration.h @@ -99,7 +99,7 @@ T RKDP(F&& f, T x, U u, units::second_t dt, double maxError = 1e-6) { while (dtElapsed < dt.value()) { do { // Only allow us to advance up to the dt remaining - h = std::min(h, dt.value() - dtElapsed); + h = (std::min)(h, dt.value() - dtElapsed); // clang-format off T k1 = f(x, u);