diff --git a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h index 053660c619..47197c7c2d 100644 --- a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h @@ -31,10 +31,10 @@ class BufferCallbackStore { void InitializeBufferStore(); -typedef int32_t (*RegisterBufferCallbackFunc)(int32_t index, - HAL_BufferCallback callback, - void* param); -typedef void (*FreeBufferCallbackFunc)(int32_t index, int32_t uid); +using RegisterBufferCallbackFunc = int32_t (*)(int32_t index, + HAL_BufferCallback callback, + void* param); +using FreeBufferCallbackFunc = void (*)(int32_t index, int32_t uid); SIM_JniHandle AllocateBufferCallback(JNIEnv* env, jint index, jobject callback, RegisterBufferCallbackFunc createCallback); diff --git a/hal/src/main/native/cpp/jni/simulation/CallbackStore.h b/hal/src/main/native/cpp/jni/simulation/CallbackStore.h index 711edcd5d3..1cf779320d 100644 --- a/hal/src/main/native/cpp/jni/simulation/CallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/CallbackStore.h @@ -31,20 +31,20 @@ class CallbackStore { void InitializeStore(); -typedef int32_t (*RegisterCallbackFunc)(int32_t index, - HAL_NotifyCallback callback, - void* param, HAL_Bool initialNotify); -typedef void (*FreeCallbackFunc)(int32_t index, int32_t uid); -typedef int32_t (*RegisterChannelCallbackFunc)(int32_t index, int32_t channel, - HAL_NotifyCallback callback, - void* param, - HAL_Bool initialNotify); -typedef void (*FreeChannelCallbackFunc)(int32_t index, int32_t channel, - int32_t uid); -typedef int32_t (*RegisterCallbackNoIndexFunc)(HAL_NotifyCallback callback, - void* param, - HAL_Bool initialNotify); -typedef void (*FreeCallbackNoIndexFunc)(int32_t uid); +using RegisterCallbackFunc = int32_t (*)(int32_t index, + HAL_NotifyCallback callback, + void* param, HAL_Bool initialNotify); +using FreeCallbackFunc = void (*)(int32_t index, int32_t uid); +using RegisterChannelCallbackFunc = int32_t (*)(int32_t index, int32_t channel, + HAL_NotifyCallback callback, + void* param, + HAL_Bool initialNotify); +using FreeChannelCallbackFunc = void (*)(int32_t index, int32_t channel, + int32_t uid); +using RegisterCallbackNoIndexFunc = int32_t (*)(HAL_NotifyCallback callback, + void* param, + HAL_Bool initialNotify); +using FreeCallbackNoIndexFunc = void (*)(int32_t uid); SIM_JniHandle AllocateCallback(JNIEnv* env, jint index, jobject callback, jboolean initialNotify, diff --git a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h index 6ae31779d1..10d7234a1e 100644 --- a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h @@ -32,9 +32,9 @@ class ConstBufferCallbackStore { void InitializeConstBufferStore(); -typedef int32_t (*RegisterConstBufferCallbackFunc)( - int32_t index, HAL_ConstBufferCallback callback, void* param); -typedef void (*FreeConstBufferCallbackFunc)(int32_t index, int32_t uid); +using RegisterConstBufferCallbackFunc = + int32_t (*)(int32_t index, HAL_ConstBufferCallback callback, void* param); +using FreeConstBufferCallbackFunc = void (*)(int32_t index, int32_t uid); SIM_JniHandle AllocateConstBufferCallback( JNIEnv* env, jint index, jobject callback, diff --git a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp index 60d5fa3be5..061dc32ba1 100644 --- a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp @@ -206,10 +206,10 @@ static hal::UnlimitedHandleResource diff --git a/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h index b0d8efd00e..72c9a682a1 100644 --- a/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h @@ -33,9 +33,9 @@ class SpiReadAutoReceiveBufferCallbackStore { void InitializeSpiBufferStore(); -typedef int32_t (*RegisterSpiBufferCallbackFunc)( +using RegisterSpiBufferCallbackFunc = int32_t (*)( int32_t index, HAL_SpiReadAutoReceiveBufferCallback callback, void* param); -typedef void (*FreeSpiBufferCallbackFunc)(int32_t index, int32_t uid); +using FreeSpiBufferCallbackFunc = void (*)(int32_t index, int32_t uid); SIM_JniHandle AllocateSpiBufferCallback( JNIEnv* env, jint index, jobject callback, diff --git a/ntcore/src/main/native/cpp/CallbackManager.h b/ntcore/src/main/native/cpp/CallbackManager.h index 9360a92a17..34c4a6afc3 100644 --- a/ntcore/src/main/native/cpp/CallbackManager.h +++ b/ntcore/src/main/native/cpp/CallbackManager.h @@ -51,8 +51,8 @@ template ()> get_msg, std::function>)> send_msgs)> HandshakeFunc; - typedef std::function msg, - NetworkConnection* conn)> - ProcessIncomingFunc; - typedef std::vector> Outgoing; - typedef wpi::ConcurrentQueue OutgoingQueue; + using ProcessIncomingFunc = + std::function, NetworkConnection*)>; + using Outgoing = std::vector>; + using OutgoingQueue = wpi::ConcurrentQueue; NetworkConnection(unsigned int uid, std::unique_ptr stream, diff --git a/ntcore/src/main/native/cpp/Storage.h b/ntcore/src/main/native/cpp/Storage.h index 8273f8ddb8..9057f0f99e 100644 --- a/ntcore/src/main/native/cpp/Storage.h +++ b/ntcore/src/main/native/cpp/Storage.h @@ -190,11 +190,11 @@ class Storage : public IStorage { }; typedef wpi::StringMap EntriesMap; - typedef std::vector IdMap; - typedef std::vector> LocalMap; - typedef std::pair RpcIdPair; - typedef wpi::DenseMap RpcResultMap; - typedef wpi::SmallSet RpcBlockingCallSet; + using IdMap = std::vector; + using LocalMap = std::vector>; + using RpcIdPair = std::pair; + using RpcResultMap = wpi::DenseMap; + using RpcBlockingCallSet = wpi::SmallSet; mutable wpi::mutex m_mutex; EntriesMap m_entries; diff --git a/ntcore/src/main/native/cpp/Storage_load.cpp b/ntcore/src/main/native/cpp/Storage_load.cpp index f73840e731..1a1a8feebc 100644 --- a/ntcore/src/main/native/cpp/Storage_load.cpp +++ b/ntcore/src/main/native/cpp/Storage_load.cpp @@ -21,7 +21,7 @@ namespace { class LoadPersistentImpl { public: typedef std::pair> Entry; - typedef std::function WarnFunc; + using WarnFunc = std::function; LoadPersistentImpl(wpi::raw_istream& is, WarnFunc warn) : m_is(is), m_warn(warn) {} diff --git a/ntcore/src/main/native/include/ntcore_cpp.h b/ntcore/src/main/native/include/ntcore_cpp.h index 9f3c01399d..0e75afca5b 100644 --- a/ntcore/src/main/native/include/ntcore_cpp.h +++ b/ntcore/src/main/native/include/ntcore_cpp.h @@ -777,9 +777,8 @@ bool WaitForEntryListenerQueue(NT_Inst inst, double timeout); * @param connected true if event is due to connection being established * @param conn connection info */ -typedef std::function - ConnectionListenerCallback; +using ConnectionListenerCallback = + std::function; /** * Add a connection listener. @@ -1481,9 +1480,8 @@ uint64_t Now(); * @param line origin source line number * @param msg message */ -typedef std::function - LogFunc; +using LogFunc = + std::function; /** * Set logger callback function. By default, log messages are sent to stderr; diff --git a/wpilibc/src/main/native/include/frc/simulation/CallbackStore.h b/wpilibc/src/main/native/include/frc/simulation/CallbackStore.h index 56cd83dba1..8f509522cf 100644 --- a/wpilibc/src/main/native/include/frc/simulation/CallbackStore.h +++ b/wpilibc/src/main/native/include/frc/simulation/CallbackStore.h @@ -15,10 +15,10 @@ namespace sim { using NotifyCallback = std::function; using ConstBufferCallback = std::function; -typedef void (*CancelCallbackFunc)(int32_t index, int32_t uid); -typedef void (*CancelCallbackNoIndexFunc)(int32_t uid); -typedef void (*CancelCallbackChannelFunc)(int32_t index, int32_t channel, - int32_t uid); +using CancelCallbackFunc = void (*)(int32_t index, int32_t uid); +using CancelCallbackNoIndexFunc = void (*)(int32_t uid); +using CancelCallbackChannelFunc = void (*)(int32_t index, int32_t channel, + int32_t uid); void CallbackStoreThunk(const char* name, void* param, const HAL_Value* value); void ConstBufferCallbackStoreThunk(const char* name, void* param, diff --git a/wpimath/src/test/native/cpp/UnitsTest.cpp b/wpimath/src/test/native/cpp/UnitsTest.cpp index 178303ba95..2274155827 100644 --- a/wpimath/src/test/native/cpp/UnitsTest.cpp +++ b/wpimath/src/test/native/cpp/UnitsTest.cpp @@ -3093,7 +3093,7 @@ TEST_F(CompileTimeArithmetic, unit_value_t) { } TEST_F(CompileTimeArithmetic, is_unit_value_t) { - typedef unit_value_t mRatio; + using mRatio = unit_value_t; EXPECT_TRUE((traits::is_unit_value_t::value)); EXPECT_FALSE((traits::is_unit_value_t::value)); @@ -3105,7 +3105,7 @@ TEST_F(CompileTimeArithmetic, is_unit_value_t) { } TEST_F(CompileTimeArithmetic, is_unit_value_t_category) { - typedef unit_value_t mRatio; + using mRatio = unit_value_t; EXPECT_TRUE( (traits::is_unit_value_t_category::value)); EXPECT_FALSE( @@ -3117,14 +3117,14 @@ TEST_F(CompileTimeArithmetic, is_unit_value_t_category) { } TEST_F(CompileTimeArithmetic, unit_value_add) { - typedef unit_value_t mRatio; + using mRatio = unit_value_t; using sum = unit_value_add; EXPECT_EQ(meter_t(3.0), sum::value()); EXPECT_TRUE( (traits::is_unit_value_t_category::value)); - typedef unit_value_t ftRatio; + using ftRatio = unit_value_t; using sumf = unit_value_add; EXPECT_TRUE(( @@ -3134,8 +3134,8 @@ TEST_F(CompileTimeArithmetic, unit_value_add) { EXPECT_TRUE( (traits::is_unit_value_t_category::value)); - typedef unit_value_t cRatio; - typedef unit_value_t fRatio; + using cRatio = unit_value_t; + using fRatio = unit_value_t; using sumc = unit_value_add; EXPECT_TRUE(( @@ -3145,8 +3145,8 @@ TEST_F(CompileTimeArithmetic, unit_value_add) { EXPECT_TRUE((traits::is_unit_value_t_category::value)); - typedef unit_value_t rRatio; - typedef unit_value_t dRatio; + using rRatio = unit_value_t; + using dRatio = unit_value_t; using sumr = unit_value_add; EXPECT_TRUE(( @@ -3158,14 +3158,14 @@ TEST_F(CompileTimeArithmetic, unit_value_add) { } TEST_F(CompileTimeArithmetic, unit_value_subtract) { - typedef unit_value_t mRatio; + using mRatio = unit_value_t; using diff = unit_value_subtract; EXPECT_EQ(meter_t(0), diff::value()); EXPECT_TRUE( (traits::is_unit_value_t_category::value)); - typedef unit_value_t ftRatio; + using ftRatio = unit_value_t; using difff = unit_value_subtract; EXPECT_TRUE((std::is_same< @@ -3175,8 +3175,8 @@ TEST_F(CompileTimeArithmetic, unit_value_subtract) { EXPECT_TRUE( (traits::is_unit_value_t_category::value)); - typedef unit_value_t cRatio; - typedef unit_value_t fRatio; + using cRatio = unit_value_t; + using fRatio = unit_value_t; using diffc = unit_value_subtract; EXPECT_TRUE((std::is_same< @@ -3186,8 +3186,8 @@ TEST_F(CompileTimeArithmetic, unit_value_subtract) { EXPECT_TRUE((traits::is_unit_value_t_category::value)); - typedef unit_value_t rRatio; - typedef unit_value_t dRatio; + using rRatio = unit_value_t; + using dRatio = unit_value_t; using diffr = unit_value_subtract; EXPECT_TRUE((std::is_same< @@ -3199,8 +3199,8 @@ TEST_F(CompileTimeArithmetic, unit_value_subtract) { } TEST_F(CompileTimeArithmetic, unit_value_multiply) { - typedef unit_value_t mRatio; - typedef unit_value_t ftRatio; // 2 meter + using mRatio = unit_value_t; + using ftRatio = unit_value_t; // 2 meter using product = unit_value_multiply; EXPECT_EQ(square_meter_t(4), product::value()); @@ -3233,7 +3233,7 @@ TEST_F(CompileTimeArithmetic, unit_value_multiply) { EXPECT_TRUE(( traits::is_unit_value_t_category::value)); - typedef unit_value_t nRatio; + using nRatio = unit_value_t; using productN = unit_value_multiply; EXPECT_FALSE( @@ -3249,8 +3249,8 @@ TEST_F(CompileTimeArithmetic, unit_value_multiply) { EXPECT_TRUE((traits::is_unit_value_t_category::value)); - typedef unit_value_t r1Ratio; - typedef unit_value_t r2Ratio; + using r1Ratio = unit_value_t; + using r2Ratio = unit_value_t; using productR = unit_value_multiply; EXPECT_TRUE((std::is_same< @@ -3265,8 +3265,8 @@ TEST_F(CompileTimeArithmetic, unit_value_multiply) { } TEST_F(CompileTimeArithmetic, unit_value_divide) { - typedef unit_value_t mRatio; - typedef unit_value_t ftRatio; // 2 meter + using mRatio = unit_value_t; + using ftRatio = unit_value_t; // 2 meter using product = unit_value_divide; EXPECT_EQ(scalar_t(1), product::value()); @@ -3299,7 +3299,7 @@ TEST_F(CompileTimeArithmetic, unit_value_divide) { EXPECT_TRUE((traits::is_unit_value_t_category::value)); - typedef unit_value_t sRatio; + using sRatio = unit_value_t; using productMS = unit_value_divide; EXPECT_TRUE( @@ -3310,7 +3310,7 @@ TEST_F(CompileTimeArithmetic, unit_value_divide) { EXPECT_TRUE((traits::is_unit_value_t_category::value)); - typedef unit_value_t rRatio; + using rRatio = unit_value_t; using productRS = unit_value_divide; EXPECT_TRUE( @@ -3326,7 +3326,7 @@ TEST_F(CompileTimeArithmetic, unit_value_divide) { } TEST_F(CompileTimeArithmetic, unit_value_power) { - typedef unit_value_t mRatio; + using mRatio = unit_value_t; using sq = unit_value_power; EXPECT_TRUE((std::is_convertible< @@ -3336,7 +3336,7 @@ TEST_F(CompileTimeArithmetic, unit_value_power) { EXPECT_TRUE( (traits::is_unit_value_t_category::value)); - typedef unit_value_t rRatio; + using rRatio = unit_value_t; using sqr = unit_value_power; EXPECT_TRUE((std::is_convertible< @@ -3350,7 +3350,7 @@ TEST_F(CompileTimeArithmetic, unit_value_power) { } TEST_F(CompileTimeArithmetic, unit_value_sqrt) { - typedef unit_value_t mRatio; + using mRatio = unit_value_t; using root = unit_value_sqrt; EXPECT_TRUE((std::is_convertible< @@ -3360,7 +3360,7 @@ TEST_F(CompileTimeArithmetic, unit_value_sqrt) { EXPECT_TRUE( (traits::is_unit_value_t_category::value)); - typedef unit_value_t hRatio; + using hRatio = unit_value_t; using rooth = unit_value_sqrt; EXPECT_TRUE((std::is_convertible< @@ -3372,7 +3372,7 @@ TEST_F(CompileTimeArithmetic, unit_value_sqrt) { EXPECT_TRUE( (traits::is_unit_value_t_category::value)); - typedef unit_value_t rRatio; + using rRatio = unit_value_t; using rootr = unit_value_sqrt; EXPECT_TRUE((traits::is_angle_unit::value));