address warnings and errors

This commit is contained in:
Swapnil Patel 2022-06-27 22:42:24 -04:00 committed by Jacob Perron
parent de253b6e81
commit d75d41c638
3 changed files with 5 additions and 3 deletions

View file

@ -68,6 +68,7 @@ namespace create {
public: public:
SerialQuery(std::shared_ptr<Data> data, bool install_signal_handler = true); SerialQuery(std::shared_ptr<Data> data, bool install_signal_handler = true);
virtual ~SerialQuery() = default;
}; };
} // namespace create } // namespace create

View file

@ -73,6 +73,7 @@ namespace create {
std::shared_ptr<Data> data, std::shared_ptr<Data> data,
const uint8_t& header = create::util::STREAM_HEADER, const uint8_t& header = create::util::STREAM_HEADER,
bool install_signal_handler = true); bool install_signal_handler = true);
virtual ~SerialStream() = default;
}; };
} // namespace create } // namespace create

View file

@ -160,10 +160,10 @@ namespace create {
prevTicksRight = totalTicksRight; prevTicksRight = totalTicksRight;
// Handle wrap around // Handle wrap around
if (fabs(ticksLeft) > 0.9 * util::V_3_MAX_ENCODER_TICKS) { if (std::abs(ticksLeft) > 0.9 * util::V_3_MAX_ENCODER_TICKS) {
ticksLeft = (ticksLeft % util::V_3_MAX_ENCODER_TICKS) + 1; ticksLeft = (ticksLeft % util::V_3_MAX_ENCODER_TICKS) + 1;
} }
if (fabs(ticksRight) > 0.9 * util::V_3_MAX_ENCODER_TICKS) { if (std::abs(ticksRight) > 0.9 * util::V_3_MAX_ENCODER_TICKS) {
ticksRight = (ticksRight % util::V_3_MAX_ENCODER_TICKS) + 1; ticksRight = (ticksRight % util::V_3_MAX_ENCODER_TICKS) + 1;
} }
@ -373,7 +373,7 @@ namespace create {
min > 59) min > 59)
return false; return false;
uint8_t cmd[4] = { OC_DATE, day, hour, min }; uint8_t cmd[4] = { OC_DATE, static_cast<uint8_t>(day), hour, min };
return serial->send(cmd, 4); return serial->send(cmd, 4);
} }