Replace use of deprecated C Standard library headers in C++ code.
Change-Id: I9fa6630c7e4bdb2897df34d417635d8c7d8253bc
Signed-off-by: Tyler Chatow <tchatow@gmail.com>
diff --git a/y2019/jevois/teensy.cc b/y2019/jevois/teensy.cc
index 4da89a8..038ece9 100644
--- a/y2019/jevois/teensy.cc
+++ b/y2019/jevois/teensy.cc
@@ -1,6 +1,5 @@
-#include <inttypes.h>
-#include <stdio.h>
-
+#include <cinttypes>
+#include <cstdio>
#include <optional>
#include "aos/time/time.h"
@@ -17,8 +16,8 @@
#include "y2019/jevois/uart.h"
#include "y2019/vision/constants.h"
-using frc971::teensy::InterruptBufferedUart;
using frc971::teensy::InterruptBufferedSpi;
+using frc971::teensy::InterruptBufferedUart;
// All indices here refer to the ports as numbered on the PCB.
@@ -126,7 +125,8 @@
}
const auto now = aos::monotonic_clock::now();
if (TransferTimedOut(now)) {
- printf("SPI timeout with %d left\n", static_cast<int>(to_receive_.size()));
+ printf("SPI timeout with %d left\n",
+ static_cast<int>(to_receive_.size()));
WaitForNextTransfer();
return std::nullopt;
}
@@ -138,7 +138,8 @@
}
}
if (DeassertHappened(now)) {
- printf("CS deasserted with %d left\n", static_cast<int>(to_receive_.size()));
+ printf("CS deasserted with %d left\n",
+ static_cast<int>(to_receive_.size()));
WaitForNextTransfer();
return std::nullopt;
}
@@ -441,9 +442,7 @@
global_spi_instance->HandleInterrupt(disable_interrupts);
}
-void porta_isr(void) {
- SpiQueue::global_instance->HandleInterrupt();
-}
+void porta_isr(void) { SpiQueue::global_instance->HandleInterrupt(); }
} // extern "C"
@@ -1016,9 +1015,7 @@
extern "C" {
-int main(void) {
- return Main();
-}
+int main(void) { return Main(); }
} // extern "C"