diff --git a/cscore/src/main/native/cpp/Frame.h b/cscore/src/main/native/cpp/Frame.h index 07bf5b0ae1..b977f247e3 100644 --- a/cscore/src/main/native/cpp/Frame.h +++ b/cscore/src/main/native/cpp/Frame.h @@ -29,7 +29,7 @@ class Frame { friend class SourceImpl; public: - typedef uint64_t Time; + using Time = uint64_t; private: struct Impl { diff --git a/cscore/src/main/native/cpp/Notifier.cpp b/cscore/src/main/native/cpp/Notifier.cpp index 9fcaea1e5d..88fd1c37c8 100644 --- a/cscore/src/main/native/cpp/Notifier.cpp +++ b/cscore/src/main/native/cpp/Notifier.cpp @@ -24,7 +24,7 @@ namespace { template class UidVector { public: - typedef typename std::vector::size_type size_type; + using size_type = typename std::vector::size_type; size_type size() const { return m_vector.size(); } T& operator[](size_type i) { return m_vector[i]; } diff --git a/cscore/src/main/native/cpp/default_init_allocator.h b/cscore/src/main/native/cpp/default_init_allocator.h index ba40e0e737..089cac7b59 100644 --- a/cscore/src/main/native/cpp/default_init_allocator.h +++ b/cscore/src/main/native/cpp/default_init_allocator.h @@ -14,7 +14,7 @@ namespace cs { // convert value initialization into default initialization. template > class default_init_allocator : public A { - typedef std::allocator_traits a_t; + using a_t = std::allocator_traits; public: template diff --git a/cscore/src/main/native/include/cscore_cpp.h b/cscore/src/main/native/include/cscore_cpp.h index a5c345d4de..8272a9fb2c 100644 --- a/cscore/src/main/native/include/cscore_cpp.h +++ b/cscore/src/main/native/include/cscore_cpp.h @@ -371,9 +371,8 @@ double GetTelemetryAverageValue(CS_Handle handle, CS_TelemetryKind kind, * @defgroup cscore_logging_func Logging Functions * @{ */ -typedef std::function - LogFunc; +using LogFunc = std::function; void SetLogger(LogFunc func, unsigned int min_level); void SetDefaultLogger(unsigned int min_level); /** @} */ diff --git a/hal/src/main/native/include/hal/cpp/Log.h b/hal/src/main/native/include/hal/cpp/Log.h index 1fabae6afe..bcc3995523 100644 --- a/hal/src/main/native/include/hal/cpp/Log.h +++ b/hal/src/main/native/include/hal/cpp/Log.h @@ -90,7 +90,7 @@ inline TLogLevel Log::FromString(const std::string& level) { return logINFO; } -typedef Log FILELog; +using FILELog = Log; // NOLINT #define FILE_LOG(level) \ if (level > FILELog::ReportingLevel()) \ diff --git a/hal/src/main/native/include/hal/cpp/fpga_clock.h b/hal/src/main/native/include/hal/cpp/fpga_clock.h index b217fdc636..94031b15e2 100644 --- a/hal/src/main/native/include/hal/cpp/fpga_clock.h +++ b/hal/src/main/native/include/hal/cpp/fpga_clock.h @@ -18,10 +18,10 @@ namespace hal { */ class fpga_clock { public: - typedef std::chrono::microseconds::rep rep; - typedef std::chrono::microseconds::period period; - typedef std::chrono::microseconds duration; - typedef std::chrono::time_point time_point; + using rep = std::chrono::microseconds::rep; + using period = std::chrono::microseconds::period; + using duration = std::chrono::microseconds; + using time_point = std::chrono::time_point; static fpga_clock::time_point now() noexcept; static constexpr bool is_steady = true; diff --git a/wpilibc/src/main/native/cpp/commands/Scheduler.cpp b/wpilibc/src/main/native/cpp/commands/Scheduler.cpp index 31a8c6d9a1..8a7af76cad 100644 --- a/wpilibc/src/main/native/cpp/commands/Scheduler.cpp +++ b/wpilibc/src/main/native/cpp/commands/Scheduler.cpp @@ -28,15 +28,15 @@ struct Scheduler::Impl { void Remove(Command* command); void ProcessCommandAddition(Command* command); - typedef std::set SubsystemSet; + using SubsystemSet = std::set; SubsystemSet subsystems; wpi::mutex buttonsMutex; - typedef std::vector> ButtonVector; + using ButtonVector = std::vector>; ButtonVector buttons; - typedef std::vector CommandVector; + using CommandVector = std::vector; wpi::mutex additionsMutex; CommandVector additions; - typedef std::set CommandSet; + using CommandSet = std::set; CommandSet commands; bool adding = false; bool enabled = true; diff --git a/wpilibc/src/main/native/include/frc/Error.h b/wpilibc/src/main/native/include/frc/Error.h index 3a4ba6b1a9..5a74ae14e3 100644 --- a/wpilibc/src/main/native/include/frc/Error.h +++ b/wpilibc/src/main/native/include/frc/Error.h @@ -31,7 +31,7 @@ class ErrorBase; */ class Error { public: - typedef int Code; + using Code = int; Error() = default; Error(Code code, const wpi::Twine& contextMessage, wpi::StringRef filename, diff --git a/wpilibc/src/main/native/include/frc/Notifier.h b/wpilibc/src/main/native/include/frc/Notifier.h index 039f8c8093..399f742c58 100644 --- a/wpilibc/src/main/native/include/frc/Notifier.h +++ b/wpilibc/src/main/native/include/frc/Notifier.h @@ -21,7 +21,7 @@ namespace frc { -typedef std::function TimerEventHandler; +using TimerEventHandler = std::function; class Notifier : public ErrorBase { public: diff --git a/wpilibc/src/main/native/include/frc/Timer.h b/wpilibc/src/main/native/include/frc/Timer.h index 77bd9aa3ad..f665c83ccd 100644 --- a/wpilibc/src/main/native/include/frc/Timer.h +++ b/wpilibc/src/main/native/include/frc/Timer.h @@ -14,7 +14,7 @@ namespace frc { -typedef void (*TimerInterruptHandler)(void* param); +using TimerInterruptHandler = void (*)(void* param); /** * Pause the task for a specified time. diff --git a/wpilibc/src/main/native/include/frc/circular_buffer.h b/wpilibc/src/main/native/include/frc/circular_buffer.h index 1bc68d31d2..b5ebd16bd9 100644 --- a/wpilibc/src/main/native/include/frc/circular_buffer.h +++ b/wpilibc/src/main/native/include/frc/circular_buffer.h @@ -21,13 +21,13 @@ class circular_buffer { public: explicit circular_buffer(size_t size); - typedef T value_type; - typedef value_type& reference; - typedef const value_type& const_reference; - typedef value_type* pointer; - typedef size_t size_type; - typedef std::forward_iterator_tag iterator_category; - typedef std::ptrdiff_t difference_type; + using value_type = T; + using reference = value_type&; + using const_reference = const value_type&; + using pointer = value_type*; + using size_type = size_t; + using iterator_category = std::forward_iterator_tag; + using difference_type = std::ptrdiff_t; size_type size() const; T& front(); diff --git a/wpilibc/src/main/native/include/frc/commands/Command.h b/wpilibc/src/main/native/include/frc/commands/Command.h index 7323c29beb..f1990c7101 100644 --- a/wpilibc/src/main/native/include/frc/commands/Command.h +++ b/wpilibc/src/main/native/include/frc/commands/Command.h @@ -221,7 +221,7 @@ class Command : public ErrorBase, public SendableBase { */ bool DoesRequire(Subsystem* subsystem) const; - typedef wpi::SmallPtrSetImpl SubsystemSet; + using SubsystemSet = wpi::SmallPtrSetImpl; /** * Returns the requirements (as an std::set of Subsystem pointers) of this diff --git a/wpilibc/src/main/native/include/frc/commands/CommandGroupEntry.h b/wpilibc/src/main/native/include/frc/commands/CommandGroupEntry.h index 2147aeabe3..2de1e43c6f 100644 --- a/wpilibc/src/main/native/include/frc/commands/CommandGroupEntry.h +++ b/wpilibc/src/main/native/include/frc/commands/CommandGroupEntry.h @@ -13,11 +13,11 @@ class Command; class CommandGroupEntry { public: - typedef enum { + enum Sequence { kSequence_InSequence, kSequence_BranchPeer, kSequence_BranchChild - } Sequence; + }; CommandGroupEntry() = default; CommandGroupEntry(Command* command, Sequence state, double timeout = -1.0); diff --git a/wpiutil/src/main/native/include/wpi/Logger.h b/wpiutil/src/main/native/include/wpi/Logger.h index 8b08acac3f..409354645f 100644 --- a/wpiutil/src/main/native/include/wpi/Logger.h +++ b/wpiutil/src/main/native/include/wpi/Logger.h @@ -29,9 +29,8 @@ enum LogLevel { class Logger { public: - typedef std::function - LogFunc; + using LogFunc = std::function; Logger() = default; explicit Logger(const LogFunc& func) : m_func(func) {} diff --git a/wpiutil/src/main/native/include/wpi/priority_mutex.h b/wpiutil/src/main/native/include/wpi/priority_mutex.h index f9d6e6bd84..4e23fac555 100644 --- a/wpiutil/src/main/native/include/wpi/priority_mutex.h +++ b/wpiutil/src/main/native/include/wpi/priority_mutex.h @@ -26,7 +26,7 @@ namespace wpi { class priority_recursive_mutex { public: - typedef pthread_mutex_t* native_handle_type; + using native_handle_type = pthread_mutex_t*; constexpr priority_recursive_mutex() noexcept = default; priority_recursive_mutex(const priority_recursive_mutex&) = delete; @@ -57,7 +57,7 @@ class priority_recursive_mutex { class priority_mutex { public: - typedef pthread_mutex_t* native_handle_type; + using native_handle_type = pthread_mutex_t*; constexpr priority_mutex() noexcept = default; priority_mutex(const priority_mutex&) = delete;