diff --git a/hal/src/main/native/athena/Accelerometer.cpp b/hal/src/main/native/athena/Accelerometer.cpp index cd24dc21c1..bc1d19a3da 100644 --- a/hal/src/main/native/athena/Accelerometer.cpp +++ b/hal/src/main/native/athena/Accelerometer.cpp @@ -75,11 +75,9 @@ enum Register { kReg_OffZ = 0x31 }; -namespace hal { -namespace init { +namespace hal::init { void InitializeAccelerometer() {} -} // namespace init -} // namespace hal +} // namespace hal::init namespace hal { diff --git a/hal/src/main/native/athena/AddressableLED.cpp b/hal/src/main/native/athena/AddressableLED.cpp index 3f10729963..39db71c039 100644 --- a/hal/src/main/native/athena/AddressableLED.cpp +++ b/hal/src/main/native/athena/AddressableLED.cpp @@ -32,8 +32,7 @@ static LimitedHandleResource< HAL_AddressableLEDHandle, AddressableLED, kNumAddressableLEDs, HAL_HandleEnum::AddressableLED>* addressableLEDHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeAddressableLED() { static LimitedHandleResource* analogGyroHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogGyro() { static IndexedHandleResource agHandles; analogGyroHandles = &agHandles; } -} // namespace init -} // namespace hal +} // namespace hal::init static void Wait(double seconds) { if (seconds < 0.0) { diff --git a/hal/src/main/native/athena/AnalogInput.cpp b/hal/src/main/native/athena/AnalogInput.cpp index 62bcb5fe0f..4fd77a654d 100644 --- a/hal/src/main/native/athena/AnalogInput.cpp +++ b/hal/src/main/native/athena/AnalogInput.cpp @@ -13,11 +13,9 @@ #include "hal/AnalogAccumulator.h" #include "hal/handles/HandlesInternal.h" -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogInput() {} -} // namespace init -} // namespace hal +} // namespace hal::init using namespace hal; diff --git a/hal/src/main/native/athena/AnalogOutput.cpp b/hal/src/main/native/athena/AnalogOutput.cpp index 25e2d92f10..333c4a402f 100644 --- a/hal/src/main/native/athena/AnalogOutput.cpp +++ b/hal/src/main/native/athena/AnalogOutput.cpp @@ -25,16 +25,14 @@ static IndexedHandleResource* analogOutputHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogOutput() { static IndexedHandleResource aoH; analogOutputHandles = &aoH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/AnalogTrigger.cpp b/hal/src/main/native/athena/AnalogTrigger.cpp index a2211dcd71..7d438572e8 100644 --- a/hal/src/main/native/athena/AnalogTrigger.cpp +++ b/hal/src/main/native/athena/AnalogTrigger.cpp @@ -30,8 +30,7 @@ static LimitedHandleResource* analogTriggerHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogTrigger() { static LimitedHandleResource -namespace hal { -namespace init { +namespace hal::init { void InitializeCAN() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/CANAPI.cpp b/hal/src/main/native/athena/CANAPI.cpp index a6f0414a56..a7c5b37f6e 100644 --- a/hal/src/main/native/athena/CANAPI.cpp +++ b/hal/src/main/native/athena/CANAPI.cpp @@ -44,15 +44,13 @@ static uint32_t GetPacketBaseTime() { return ms & 0xFFFFFFFF; } -namespace hal { -namespace init { +namespace hal::init { void InitializeCANAPI() { static UnlimitedHandleResource cH; canHandles = &cH; } -} // namespace init -} // namespace hal +} // namespace hal::init static int32_t CreateCANId(CANStorage* storage, int32_t apiId) { int32_t createdId = 0; diff --git a/hal/src/main/native/athena/Compressor.cpp b/hal/src/main/native/athena/Compressor.cpp index b6f8a31d54..7d7f6e7c60 100644 --- a/hal/src/main/native/athena/Compressor.cpp +++ b/hal/src/main/native/athena/Compressor.cpp @@ -13,11 +13,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializeCompressor() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/Constants.cpp b/hal/src/main/native/athena/Constants.cpp index 905b37c4fb..a3129357d7 100644 --- a/hal/src/main/native/athena/Constants.cpp +++ b/hal/src/main/native/athena/Constants.cpp @@ -8,11 +8,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializeConstants() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/Counter.cpp b/hal/src/main/native/athena/Counter.cpp index 7577da248d..2605279ed3 100644 --- a/hal/src/main/native/athena/Counter.cpp +++ b/hal/src/main/native/athena/Counter.cpp @@ -25,16 +25,14 @@ struct Counter { static LimitedHandleResource* counterHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeCounter() { static LimitedHandleResource ch; counterHandles = &ch; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/DIO.cpp b/hal/src/main/native/athena/DIO.cpp index ba818f48ce..23c5ab331b 100644 --- a/hal/src/main/native/athena/DIO.cpp +++ b/hal/src/main/native/athena/DIO.cpp @@ -25,8 +25,7 @@ static LimitedHandleResource* digitalPWMHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeDIO() { static LimitedHandleResource* dmaHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeDMA() { static hal::LimitedHandleResource dH; dmaHandles = &dH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/Encoder.cpp b/hal/src/main/native/athena/Encoder.cpp index 5e04e8ade8..e63eede3d1 100644 --- a/hal/src/main/native/athena/Encoder.cpp +++ b/hal/src/main/native/athena/Encoder.cpp @@ -231,8 +231,7 @@ static LimitedClassedHandleResource* encoderHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeEncoder() { static LimitedClassedHandleResource* fpgaEncoderHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeFPGAEncoder() { static LimitedHandleResource feH; fpgaEncoderHandles = &feH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/FRCDriverStation.cpp b/hal/src/main/native/athena/FRCDriverStation.cpp index 2e09c8d732..40c2f24baa 100644 --- a/hal/src/main/native/athena/FRCDriverStation.cpp +++ b/hal/src/main/native/athena/FRCDriverStation.cpp @@ -123,16 +123,14 @@ static wpi::mutex* newDSDataAvailableMutex; static wpi::condition_variable* newDSDataAvailableCond; static int newDSDataAvailableCounter{0}; -namespace hal { -namespace init { +namespace hal::init { void InitializeFRCDriverStation() { static wpi::mutex newMutex; newDSDataAvailableMutex = &newMutex; static wpi::condition_variable newCond; newDSDataAvailableCond = &newCond; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/HALInitializer.cpp b/hal/src/main/native/athena/HALInitializer.cpp index 1905c9b1d6..50cc9ab42d 100644 --- a/hal/src/main/native/athena/HALInitializer.cpp +++ b/hal/src/main/native/athena/HALInitializer.cpp @@ -6,11 +6,9 @@ #include "hal/HALBase.h" -namespace hal { -namespace init { +namespace hal::init { std::atomic_bool HAL_IsInitialized{false}; void RunInitialize() { HAL_Initialize(500, 0); } -} // namespace init -} // namespace hal +} // namespace hal::init diff --git a/hal/src/main/native/athena/I2C.cpp b/hal/src/main/native/athena/I2C.cpp index 9f4216e30d..17d6e9fbb3 100644 --- a/hal/src/main/native/athena/I2C.cpp +++ b/hal/src/main/native/athena/I2C.cpp @@ -30,11 +30,9 @@ static int i2CMXPHandle{-1}; static HAL_DigitalHandle i2CMXPDigitalHandle1{HAL_kInvalidHandle}; static HAL_DigitalHandle i2CMXPDigitalHandle2{HAL_kInvalidHandle}; -namespace hal { -namespace init { +namespace hal::init { void InitializeI2C() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/Interrupts.cpp b/hal/src/main/native/athena/Interrupts.cpp index 4e22c27446..4ec34cd191 100644 --- a/hal/src/main/native/athena/Interrupts.cpp +++ b/hal/src/main/native/athena/Interrupts.cpp @@ -83,16 +83,14 @@ static void threadedInterruptHandler(uint32_t mask, void* param) { static LimitedHandleResource* interruptHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeInterrupts() { static LimitedHandleResource iH; interruptHandles = &iH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/Notifier.cpp b/hal/src/main/native/athena/Notifier.cpp index c4778e86b1..e672a96e78 100644 --- a/hal/src/main/native/athena/Notifier.cpp +++ b/hal/src/main/native/athena/Notifier.cpp @@ -125,14 +125,12 @@ static void cleanupNotifierAtExit() { } } -namespace hal { -namespace init { +namespace hal::init { void InitializeNotifier() { static NotifierHandleContainer nH; notifierHandles = &nH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/PDP.cpp b/hal/src/main/native/athena/PDP.cpp index 4739780b72..7db4dd2db5 100644 --- a/hal/src/main/native/athena/PDP.cpp +++ b/hal/src/main/native/athena/PDP.cpp @@ -103,15 +103,13 @@ union PdpStatusEnergy { static wpi::mutex pdpHandleMutex; static HAL_PDPHandle pdpHandles[kNumPDPModules]; -namespace hal { -namespace init { +namespace hal::init { void InitializePDP() { for (int i = 0; i < kNumPDPModules; i++) { pdpHandles[i] = HAL_kInvalidHandle; } } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/PWM.cpp b/hal/src/main/native/athena/PWM.cpp index 730a786a9d..873d447ee4 100644 --- a/hal/src/main/native/athena/PWM.cpp +++ b/hal/src/main/native/athena/PWM.cpp @@ -58,11 +58,9 @@ static inline int32_t GetFullRangeScaleFactor(DigitalPort* port) { return GetMaxPositivePwm(port) - GetMinNegativePwm(port); } ///< The scale for positions. -namespace hal { -namespace init { +namespace hal::init { void InitializePWM() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/Ports.cpp b/hal/src/main/native/athena/Ports.cpp index 148e15d3b2..aaf9389a9b 100644 --- a/hal/src/main/native/athena/Ports.cpp +++ b/hal/src/main/native/athena/Ports.cpp @@ -8,11 +8,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializePorts() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/Power.cpp b/hal/src/main/native/athena/Power.cpp index 4a89da9612..b80df0f4ad 100644 --- a/hal/src/main/native/athena/Power.cpp +++ b/hal/src/main/native/athena/Power.cpp @@ -24,11 +24,9 @@ static void initializePower(int32_t* status) { } // namespace hal -namespace hal { -namespace init { +namespace hal::init { void InitializePower() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/Relay.cpp b/hal/src/main/native/athena/Relay.cpp index f6f8819a94..368ce1b730 100644 --- a/hal/src/main/native/athena/Relay.cpp +++ b/hal/src/main/native/athena/Relay.cpp @@ -26,16 +26,14 @@ static IndexedHandleResource rH; relayHandles = &rH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/SPI.cpp b/hal/src/main/native/athena/SPI.cpp index b8ab439b2f..a237f668ea 100644 --- a/hal/src/main/native/athena/SPI.cpp +++ b/hal/src/main/native/athena/SPI.cpp @@ -59,11 +59,9 @@ static bool SPIInUseByAuto(HAL_SPIPort port) { (spiAutoPort == 4 && port == 4); } -namespace hal { -namespace init { +namespace hal::init { void InitializeSPI() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/athena/SerialPort.cpp b/hal/src/main/native/athena/SerialPort.cpp index bd26281587..27f17397ed 100644 --- a/hal/src/main/native/athena/SerialPort.cpp +++ b/hal/src/main/native/athena/SerialPort.cpp @@ -41,16 +41,14 @@ IndexedHandleResource* serialPortHandles; } // namespace hal -namespace hal { -namespace init { +namespace hal::init { void InitializeSerialPort() { static IndexedHandleResource spH; serialPortHandles = &spH; } -} // namespace init -} // namespace hal +} // namespace hal::init using namespace hal; diff --git a/hal/src/main/native/athena/Solenoid.cpp b/hal/src/main/native/athena/Solenoid.cpp index dea191f7aa..669b87674f 100644 --- a/hal/src/main/native/athena/Solenoid.cpp +++ b/hal/src/main/native/athena/Solenoid.cpp @@ -27,8 +27,7 @@ static IndexedHandleResource* solenoidHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeSolenoid() { static IndexedHandleResourcegExitCv.notify_all(); } -namespace hal { -namespace init { +namespace hal::init { void InitializeMain() { static MainObj mO; mainObj = &mO; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp index 7f1b5903cb..261a7cab0b 100644 --- a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.cpp @@ -22,16 +22,14 @@ static hal::UnlimitedHandleResource* callbackHandles; -namespace hal { -namespace sim { +namespace hal::sim { void InitializeBufferStore() { static hal::UnlimitedHandleResource cb; callbackHandles = &cb; } -} // namespace sim -} // namespace hal +} // namespace hal::sim void BufferCallbackStore::create(JNIEnv* env, jobject obj) { m_call = JGlobal(env, obj); diff --git a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h index 47197c7c2d..73cf9578db 100644 --- a/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/BufferCallbackStore.h @@ -14,8 +14,7 @@ #include "hal/handles/UnlimitedHandleResource.h" #include "hal/simulation/NotifyListener.h" -namespace hal { -namespace sim { +namespace hal::sim { class BufferCallbackStore { public: void create(JNIEnv* env, jobject obj); @@ -40,5 +39,4 @@ SIM_JniHandle AllocateBufferCallback(JNIEnv* env, jint index, jobject callback, RegisterBufferCallbackFunc createCallback); void FreeBufferCallback(JNIEnv* env, SIM_JniHandle handle, jint index, FreeBufferCallbackFunc freeCallback); -} // namespace sim -} // namespace hal +} // namespace hal::sim diff --git a/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp index d0f30d41d1..3d3e1c03a1 100644 --- a/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/CallbackStore.cpp @@ -22,16 +22,14 @@ static hal::UnlimitedHandleResource* callbackHandles; -namespace hal { -namespace sim { +namespace hal::sim { void InitializeStore() { static hal::UnlimitedHandleResource cb; callbackHandles = &cb; } -} // namespace sim -} // namespace hal +} // namespace hal::sim void CallbackStore::create(JNIEnv* env, jobject obj) { m_call = JGlobal(env, obj); diff --git a/hal/src/main/native/cpp/jni/simulation/CallbackStore.h b/hal/src/main/native/cpp/jni/simulation/CallbackStore.h index 1cf779320d..59e10184c0 100644 --- a/hal/src/main/native/cpp/jni/simulation/CallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/CallbackStore.h @@ -14,8 +14,7 @@ #include "hal/handles/UnlimitedHandleResource.h" #include "hal/simulation/NotifyListener.h" -namespace hal { -namespace sim { +namespace hal::sim { class CallbackStore { public: void create(JNIEnv* env, jobject obj); @@ -61,5 +60,4 @@ void FreeChannelCallback(JNIEnv* env, SIM_JniHandle handle, jint index, jint channel, FreeChannelCallbackFunc freeCallback); void FreeCallbackNoIndex(JNIEnv* env, SIM_JniHandle handle, FreeCallbackNoIndexFunc freeCallback); -} // namespace sim -} // namespace hal +} // namespace hal::sim diff --git a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp index c2fb690018..ce4c535671 100644 --- a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.cpp @@ -22,16 +22,14 @@ static hal::UnlimitedHandleResource* callbackHandles; -namespace hal { -namespace sim { +namespace hal::sim { void InitializeConstBufferStore() { static hal::UnlimitedHandleResource cb; callbackHandles = &cb; } -} // namespace sim -} // namespace hal +} // namespace hal::sim void ConstBufferCallbackStore::create(JNIEnv* env, jobject obj) { m_call = JGlobal(env, obj); diff --git a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h index 10d7234a1e..0998d3c190 100644 --- a/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/ConstBufferCallbackStore.h @@ -14,8 +14,7 @@ #include "hal/handles/UnlimitedHandleResource.h" #include "hal/simulation/NotifyListener.h" -namespace hal { -namespace sim { +namespace hal::sim { class ConstBufferCallbackStore { public: void create(JNIEnv* env, jobject obj); @@ -41,5 +40,4 @@ SIM_JniHandle AllocateConstBufferCallback( RegisterConstBufferCallbackFunc createCallback); void FreeConstBufferCallback(JNIEnv* env, SIM_JniHandle handle, jint index, FreeConstBufferCallbackFunc freeCallback); -} // namespace sim -} // namespace hal +} // namespace hal::sim diff --git a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp index 061dc32ba1..b986548ce6 100644 --- a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.cpp @@ -310,8 +310,7 @@ static void FreeValueCallback(JNIEnv* env, SIM_JniHandle handle, callback->free(env); } -namespace hal { -namespace sim { +namespace hal::sim { bool InitializeSimDeviceDataJNI(JNIEnv* env) { simDeviceInfoCls = JClass( @@ -370,8 +369,7 @@ void FreeSimDeviceDataJNI(JNIEnv* env) { simValueCallbackCls.free(env); } -} // namespace sim -} // namespace hal +} // namespace hal::sim extern "C" { diff --git a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h index a9b7cb95e0..08c47b9ed4 100644 --- a/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h +++ b/hal/src/main/native/cpp/jni/simulation/SimDeviceDataJNI.h @@ -6,9 +6,7 @@ #include -namespace hal { -namespace sim { +namespace hal::sim { bool InitializeSimDeviceDataJNI(JNIEnv* env); void FreeSimDeviceDataJNI(JNIEnv* env); -} // namespace sim -} // namespace hal +} // namespace hal::sim diff --git a/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp index 6b52e3ae45..859c7f5b73 100644 --- a/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp +++ b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.cpp @@ -28,8 +28,7 @@ static jmethodID bufferCallbackCallback; static jmethodID constBufferCallbackCallback; static jmethodID spiReadAutoReceiveBufferCallbackCallback; -namespace hal { -namespace sim { +namespace hal::sim { jint SimOnLoad(JavaVM* vm, void* reserved) { jvm = vm; @@ -131,8 +130,7 @@ jmethodID GetConstBufferCallback() { jmethodID GetSpiReadAutoReceiveBufferCallback() { return spiReadAutoReceiveBufferCallbackCallback; } -} // namespace sim -} // namespace hal +} // namespace hal::sim extern "C" { /* diff --git a/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h index d017168263..38e074330f 100644 --- a/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h +++ b/hal/src/main/native/cpp/jni/simulation/SimulatorJNI.h @@ -9,13 +9,11 @@ typedef HAL_Handle SIM_JniHandle; -namespace hal { -namespace sim { +namespace hal::sim { JavaVM* GetJVM(); jmethodID GetNotifyCallback(); jmethodID GetBufferCallback(); jmethodID GetConstBufferCallback(); jmethodID GetSpiReadAutoReceiveBufferCallback(); -} // namespace sim -} // namespace hal +} // namespace hal::sim diff --git a/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.cpp b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.cpp index 634d869a00..558d1c5c28 100644 --- a/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.cpp +++ b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.cpp @@ -22,8 +22,7 @@ static hal::UnlimitedHandleResource< SIM_JniHandle, SpiReadAutoReceiveBufferCallbackStore, hal::HAL_HandleEnum::SimulationJni>* callbackHandles; -namespace hal { -namespace sim { +namespace hal::sim { void InitializeSpiBufferStore() { static hal::UnlimitedHandleResource(env, obj); diff --git a/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h index 72c9a682a1..18e8a44171 100644 --- a/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h +++ b/hal/src/main/native/cpp/jni/simulation/SpiReadAutoReceiveBufferCallbackStore.h @@ -15,8 +15,7 @@ #include "hal/simulation/NotifyListener.h" #include "hal/simulation/SPIData.h" -namespace hal { -namespace sim { +namespace hal::sim { class SpiReadAutoReceiveBufferCallbackStore { public: void create(JNIEnv* env, jobject obj); @@ -42,5 +41,4 @@ SIM_JniHandle AllocateSpiBufferCallback( RegisterSpiBufferCallbackFunc createCallback); void FreeSpiBufferCallback(JNIEnv* env, SIM_JniHandle handle, jint index, FreeSpiBufferCallbackFunc freeCallback); -} // namespace sim -} // namespace hal +} // namespace hal::sim diff --git a/hal/src/main/native/sim/Accelerometer.cpp b/hal/src/main/native/sim/Accelerometer.cpp index 9fc4efd3ba..2756c9958c 100644 --- a/hal/src/main/native/sim/Accelerometer.cpp +++ b/hal/src/main/native/sim/Accelerometer.cpp @@ -8,11 +8,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializeAccelerometer() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { void HAL_SetAccelerometerActive(HAL_Bool active) { diff --git a/hal/src/main/native/sim/AddressableLED.cpp b/hal/src/main/native/sim/AddressableLED.cpp index 9e60a9b77f..b4a3ed80ae 100644 --- a/hal/src/main/native/sim/AddressableLED.cpp +++ b/hal/src/main/native/sim/AddressableLED.cpp @@ -24,8 +24,7 @@ static LimitedHandleResource* ledHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeAddressableLED() { static LimitedHandleResource* analogGyroHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogGyro() { static IndexedHandleResource agH; analogGyroHandles = &agH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_GyroHandle HAL_InitializeAnalogGyro(HAL_AnalogInputHandle analogHandle, diff --git a/hal/src/main/native/sim/AnalogInput.cpp b/hal/src/main/native/sim/AnalogInput.cpp index 8244aa4e59..3a9f572f05 100644 --- a/hal/src/main/native/sim/AnalogInput.cpp +++ b/hal/src/main/native/sim/AnalogInput.cpp @@ -13,11 +13,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogInput() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_AnalogInputHandle HAL_InitializeAnalogInputPort(HAL_PortHandle portHandle, diff --git a/hal/src/main/native/sim/AnalogInternal.cpp b/hal/src/main/native/sim/AnalogInternal.cpp index 3f34df9a2a..9b2c22571e 100644 --- a/hal/src/main/native/sim/AnalogInternal.cpp +++ b/hal/src/main/native/sim/AnalogInternal.cpp @@ -12,13 +12,11 @@ IndexedHandleResource* analogInputHandles; } // namespace hal -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogInternal() { static IndexedHandleResource aiH; analogInputHandles = &aiH; } -} // namespace init -} // namespace hal +} // namespace hal::init diff --git a/hal/src/main/native/sim/AnalogOutput.cpp b/hal/src/main/native/sim/AnalogOutput.cpp index 96e411ac9f..fc5367bc25 100644 --- a/hal/src/main/native/sim/AnalogOutput.cpp +++ b/hal/src/main/native/sim/AnalogOutput.cpp @@ -23,16 +23,14 @@ static IndexedHandleResource* analogOutputHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogOutput() { static IndexedHandleResource aoH; analogOutputHandles = &aoH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_AnalogOutputHandle HAL_InitializeAnalogOutputPort(HAL_PortHandle portHandle, diff --git a/hal/src/main/native/sim/AnalogTrigger.cpp b/hal/src/main/native/sim/AnalogTrigger.cpp index 8729f5fb0e..ae236bc04a 100644 --- a/hal/src/main/native/sim/AnalogTrigger.cpp +++ b/hal/src/main/native/sim/AnalogTrigger.cpp @@ -28,8 +28,7 @@ static LimitedHandleResource* analogTriggerHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeAnalogTrigger() { static LimitedHandleResource* counterHandles; } // namespace hal -namespace hal { -namespace init { +namespace hal::init { void InitializeCounter() { static LimitedHandleResource cH; counterHandles = &cH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_CounterHandle HAL_InitializeCounter(HAL_Counter_Mode mode, int32_t* index, diff --git a/hal/src/main/native/sim/DIO.cpp b/hal/src/main/native/sim/DIO.cpp index 7d9eeb5369..4cb3d38810 100644 --- a/hal/src/main/native/sim/DIO.cpp +++ b/hal/src/main/native/sim/DIO.cpp @@ -18,8 +18,7 @@ static LimitedHandleResource* digitalPWMHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeDIO() { static LimitedHandleResource sendErrorHandler{nullptr}; static std::atomic sendConsoleLineHandler{ nullptr}; -namespace hal { -namespace init { +namespace hal::init { void InitializeDriverStation() { static wpi::condition_variable nddaC; newDSDataAvailableCond = &nddaC; } -} // namespace init -} // namespace hal +} // namespace hal::init using namespace hal; diff --git a/hal/src/main/native/sim/DutyCycle.cpp b/hal/src/main/native/sim/DutyCycle.cpp index 68077758e7..51c6506f59 100644 --- a/hal/src/main/native/sim/DutyCycle.cpp +++ b/hal/src/main/native/sim/DutyCycle.cpp @@ -23,16 +23,14 @@ struct Empty {}; static LimitedHandleResource* dutyCycleHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeDutyCycle() { static LimitedHandleResource dcH; dutyCycleHandles = &dcH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_DutyCycleHandle HAL_InitializeDutyCycle(HAL_Handle digitalSourceHandle, diff --git a/hal/src/main/native/sim/Encoder.cpp b/hal/src/main/native/sim/Encoder.cpp index c59e7019c9..765288caf6 100644 --- a/hal/src/main/native/sim/Encoder.cpp +++ b/hal/src/main/native/sim/Encoder.cpp @@ -31,8 +31,7 @@ static LimitedHandleResource* fpgaEncoderHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeEncoder() { static LimitedHandleResource @@ -44,8 +43,7 @@ void InitializeEncoder() { eH; encoderHandles = &eH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_EncoderHandle HAL_InitializeEncoder( diff --git a/hal/src/main/native/sim/Extensions.cpp b/hal/src/main/native/sim/Extensions.cpp index 4131ddcd9a..ca5bccd4af 100644 --- a/hal/src/main/native/sim/Extensions.cpp +++ b/hal/src/main/native/sim/Extensions.cpp @@ -40,11 +40,9 @@ static std::vector> gExtensionRegistry; static std::vector> gExtensionListeners; -namespace hal { -namespace init { +namespace hal::init { void InitializeExtensions() {} -} // namespace init -} // namespace hal +} // namespace hal::init static bool& GetShowNotFoundMessage() { static bool showMsg = true; diff --git a/hal/src/main/native/sim/HAL.cpp b/hal/src/main/native/sim/HAL.cpp index 5629993ef3..97ad1b9bba 100644 --- a/hal/src/main/native/sim/HAL.cpp +++ b/hal/src/main/native/sim/HAL.cpp @@ -57,8 +57,7 @@ static std::vector> gOnShutdown; static SimPeriodicCallbackRegistry gSimPeriodicBefore; static SimPeriodicCallbackRegistry gSimPeriodicAfter; -namespace hal { -namespace init { +namespace hal::init { void InitializeHAL() { InitializeAccelerometerData(); InitializeAddressableLEDData(); @@ -116,8 +115,7 @@ void InitializeHAL() { InitializeSPI(); InitializeThreads(); } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/sim/HALInitializer.cpp b/hal/src/main/native/sim/HALInitializer.cpp index 1905c9b1d6..50cc9ab42d 100644 --- a/hal/src/main/native/sim/HALInitializer.cpp +++ b/hal/src/main/native/sim/HALInitializer.cpp @@ -6,11 +6,9 @@ #include "hal/HALBase.h" -namespace hal { -namespace init { +namespace hal::init { std::atomic_bool HAL_IsInitialized{false}; void RunInitialize() { HAL_Initialize(500, 0); } -} // namespace init -} // namespace hal +} // namespace hal::init diff --git a/hal/src/main/native/sim/I2C.cpp b/hal/src/main/native/sim/I2C.cpp index 87bda51e11..0b50fe6687 100644 --- a/hal/src/main/native/sim/I2C.cpp +++ b/hal/src/main/native/sim/I2C.cpp @@ -9,11 +9,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializeI2C() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { void HAL_InitializeI2C(HAL_I2CPort port, int32_t* status) { diff --git a/hal/src/main/native/sim/Interrupts.cpp b/hal/src/main/native/sim/Interrupts.cpp index 34deca47c4..4bfd7819aa 100644 --- a/hal/src/main/native/sim/Interrupts.cpp +++ b/hal/src/main/native/sim/Interrupts.cpp @@ -69,8 +69,7 @@ static UnlimitedHandleResource* synchronousInterruptHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeInterrupts() { static LimitedHandleResource @@ -81,8 +80,7 @@ void InitializeInterrupts() { siH; synchronousInterruptHandles = &siH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_InterruptHandle HAL_InitializeInterrupts(HAL_Bool watcher, diff --git a/hal/src/main/native/sim/MockHooks.cpp b/hal/src/main/native/sim/MockHooks.cpp index 24a7588493..e4751f7d76 100644 --- a/hal/src/main/native/sim/MockHooks.cpp +++ b/hal/src/main/native/sim/MockHooks.cpp @@ -20,13 +20,11 @@ static std::atomic programStartTime{0}; static std::atomic programPauseTime{0}; static std::atomic programStepTime{0}; -namespace hal { -namespace init { +namespace hal::init { void InitializeMockHooks() { wpi::SetNowImpl(GetFPGATime); } -} // namespace init -} // namespace hal +} // namespace hal::init namespace hal { void RestartTiming() { diff --git a/hal/src/main/native/sim/PDP.cpp b/hal/src/main/native/sim/PDP.cpp index 35fde90874..36fb50e45d 100644 --- a/hal/src/main/native/sim/PDP.cpp +++ b/hal/src/main/native/sim/PDP.cpp @@ -19,11 +19,9 @@ static constexpr HAL_CANManufacturer manufacturer = static constexpr HAL_CANDeviceType deviceType = HAL_CANDeviceType::HAL_CAN_Dev_kPowerDistribution; -namespace hal { -namespace init { +namespace hal::init { void InitializePDP() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_PDPHandle HAL_InitializePDP(int32_t module, int32_t* status) { diff --git a/hal/src/main/native/sim/PWM.cpp b/hal/src/main/native/sim/PWM.cpp index bc14657b08..06105e9981 100644 --- a/hal/src/main/native/sim/PWM.cpp +++ b/hal/src/main/native/sim/PWM.cpp @@ -13,11 +13,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializePWM() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/sim/Ports.cpp b/hal/src/main/native/sim/Ports.cpp index 9de99e3a08..1e322dcc23 100644 --- a/hal/src/main/native/sim/Ports.cpp +++ b/hal/src/main/native/sim/Ports.cpp @@ -8,11 +8,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializePorts() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { int32_t HAL_GetNumAccumulators(void) { diff --git a/hal/src/main/native/sim/Power.cpp b/hal/src/main/native/sim/Power.cpp index bc779329e2..e187a27eaf 100644 --- a/hal/src/main/native/sim/Power.cpp +++ b/hal/src/main/native/sim/Power.cpp @@ -8,11 +8,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializePower() {} -} // namespace init -} // namespace hal +} // namespace hal::init // TODO: Fix the naming in here extern "C" { diff --git a/hal/src/main/native/sim/Relay.cpp b/hal/src/main/native/sim/Relay.cpp index a5f41f6b5c..7ba0438d50 100644 --- a/hal/src/main/native/sim/Relay.cpp +++ b/hal/src/main/native/sim/Relay.cpp @@ -21,16 +21,14 @@ struct Relay { static IndexedHandleResource* relayHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeRelay() { static IndexedHandleResource rH; relayHandles = &rH; } -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_RelayHandle HAL_InitializeRelayPort(HAL_PortHandle portHandle, HAL_Bool fwd, diff --git a/hal/src/main/native/sim/SPI.cpp b/hal/src/main/native/sim/SPI.cpp index e3c479d9da..bf362a80bd 100644 --- a/hal/src/main/native/sim/SPI.cpp +++ b/hal/src/main/native/sim/SPI.cpp @@ -9,11 +9,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializeSPI() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/sim/SerialPort.cpp b/hal/src/main/native/sim/SerialPort.cpp index 6ef12089ad..83ba9710a9 100644 --- a/hal/src/main/native/sim/SerialPort.cpp +++ b/hal/src/main/native/sim/SerialPort.cpp @@ -6,11 +6,9 @@ #include "HALInitializer.h" -namespace hal { -namespace init { +namespace hal::init { void InitializeSerialPort() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { HAL_SerialPortHandle HAL_InitializeSerialPort(HAL_SerialPort port, diff --git a/hal/src/main/native/sim/SimDevice.cpp b/hal/src/main/native/sim/SimDevice.cpp index 06949778ce..9d7ae1c678 100644 --- a/hal/src/main/native/sim/SimDevice.cpp +++ b/hal/src/main/native/sim/SimDevice.cpp @@ -12,11 +12,9 @@ using namespace hal; -namespace hal { -namespace init { +namespace hal::init { void InitializeSimDevice() {} -} // namespace init -} // namespace hal +} // namespace hal::init extern "C" { diff --git a/hal/src/main/native/sim/Solenoid.cpp b/hal/src/main/native/sim/Solenoid.cpp index 14d6330477..81be01a351 100644 --- a/hal/src/main/native/sim/Solenoid.cpp +++ b/hal/src/main/native/sim/Solenoid.cpp @@ -24,8 +24,7 @@ static IndexedHandleResource* solenoidHandles; -namespace hal { -namespace init { +namespace hal::init { void InitializeSolenoid() { static IndexedHandleResource -namespace frc { -namespace sim { +namespace frc::sim { void SetRuntimeType(HAL_RuntimeType type) { HALSIM_SetRuntimeType(type); @@ -49,5 +48,4 @@ void StepTimingAsync(units::second_t delta) { HALSIM_StepTimingAsync(static_cast(delta.to() * 1e6)); } -} // namespace sim -} // namespace frc +} // namespace frc::sim diff --git a/wpilibc/src/main/native/include/frc/Filesystem.h b/wpilibc/src/main/native/include/frc/Filesystem.h index 9de0740869..f743f683cf 100644 --- a/wpilibc/src/main/native/include/frc/Filesystem.h +++ b/wpilibc/src/main/native/include/frc/Filesystem.h @@ -6,9 +6,8 @@ #include -namespace frc { /** WPILib FileSystem namespace */ -namespace filesystem { +namespace frc::filesystem { /** * Obtains the current working path that the program was launched with. @@ -37,5 +36,4 @@ void GetOperatingDirectory(wpi::SmallVectorImpl& result); */ void GetDeployDirectory(wpi::SmallVectorImpl& result); -} // namespace filesystem -} // namespace frc +} // namespace frc::filesystem diff --git a/wpilibc/src/main/native/include/frc/shuffleboard/RecordingController.h b/wpilibc/src/main/native/include/frc/shuffleboard/RecordingController.h index da5c96ecf7..716597c7bb 100644 --- a/wpilibc/src/main/native/include/frc/shuffleboard/RecordingController.h +++ b/wpilibc/src/main/native/include/frc/shuffleboard/RecordingController.h @@ -14,8 +14,7 @@ #include "frc/shuffleboard/ShuffleboardEventImportance.h" -namespace frc { -namespace detail { +namespace frc::detail { class RecordingController final { public: @@ -36,5 +35,4 @@ class RecordingController final { std::shared_ptr m_eventsTable; }; -} // namespace detail -} // namespace frc +} // namespace frc::detail diff --git a/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardInstance.h b/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardInstance.h index 8891372d9c..20ddc6bfb3 100644 --- a/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardInstance.h +++ b/wpilibc/src/main/native/include/frc/shuffleboard/ShuffleboardInstance.h @@ -9,8 +9,7 @@ #include "frc/shuffleboard/ShuffleboardRoot.h" #include "frc/shuffleboard/ShuffleboardTab.h" -namespace frc { -namespace detail { +namespace frc::detail { class ShuffleboardInstance final : public ShuffleboardRoot { public: @@ -37,5 +36,4 @@ class ShuffleboardInstance final : public ShuffleboardRoot { std::unique_ptr m_impl; }; -} // namespace detail -} // namespace frc +} // namespace frc::detail diff --git a/wpilibc/src/main/native/include/frc/simulation/CallbackStore.h b/wpilibc/src/main/native/include/frc/simulation/CallbackStore.h index 8f509522cf..bdc861413e 100644 --- a/wpilibc/src/main/native/include/frc/simulation/CallbackStore.h +++ b/wpilibc/src/main/native/include/frc/simulation/CallbackStore.h @@ -9,8 +9,7 @@ #include #include -namespace frc { -namespace sim { +namespace frc::sim { using NotifyCallback = std::function; using ConstBufferCallback = std::function #include -namespace frc { -namespace sim { +namespace frc::sim { /** * Class to control the simulation side of a SimDevice. @@ -62,5 +61,4 @@ class SimDeviceSim { private: HAL_SimDeviceHandle m_handle; }; -} // namespace sim -} // namespace frc +} // namespace frc::sim diff --git a/wpilibc/src/main/native/include/frc/simulation/SimHooks.h b/wpilibc/src/main/native/include/frc/simulation/SimHooks.h index 966b2a0245..dfde4fcd47 100644 --- a/wpilibc/src/main/native/include/frc/simulation/SimHooks.h +++ b/wpilibc/src/main/native/include/frc/simulation/SimHooks.h @@ -9,8 +9,7 @@ #include #include -namespace frc { -namespace sim { +namespace frc::sim { void SetRuntimeType(HAL_RuntimeType type); @@ -32,5 +31,4 @@ void StepTiming(units::second_t delta); void StepTimingAsync(units::second_t delta); -} // namespace sim -} // namespace frc +} // namespace frc::sim diff --git a/wpimath/src/main/native/include/units/constants.h b/wpimath/src/main/native/include/units/constants.h index 9d1011d738..efadaf75fe 100644 --- a/wpimath/src/main/native/include/units/constants.h +++ b/wpimath/src/main/native/include/units/constants.h @@ -43,13 +43,7 @@ #include "units/time.h" #include "units/velocity.h" -namespace units { -/** - * @brief namespace for physical constants like PI and Avogadro's Number. - * @sa See unit_t for more information on unit type containers. - */ -#if !defined(DISABLE_PREDEFINED_UNITS) -namespace constants { +namespace units::constants { /** * @name Unit Containers * @anchor constantContainers @@ -105,6 +99,4 @@ static constexpr const unit_t< (15 * math::cpow<3>(h) * math::cpow<2>(c) * math::cpow<4>(N_A))); ///< Stefan-Boltzmann constant. /** @} */ -} // namespace constants -#endif -} // namespace units +} // namespace units::constants diff --git a/wpimath/src/main/native/include/units/math.h b/wpimath/src/main/native/include/units/math.h index 6fd25db2c9..43b212e89e 100644 --- a/wpimath/src/main/native/include/units/math.h +++ b/wpimath/src/main/native/include/units/math.h @@ -34,7 +34,6 @@ #include "units/base.h" #include "units/dimensionless.h" -namespace units { //---------------------------------- // UNIT-ENABLED CMATH FUNCTIONS //---------------------------------- @@ -45,7 +44,7 @@ namespace units { * rounding functions, etc. * @sa See `unit_t` for more information on unit type containers. */ -namespace math { +namespace units::math { //---------------------------------- // TRIGONOMETRIC FUNCTIONS //---------------------------------- @@ -772,5 +771,4 @@ constexpr units::radian_t NormalizeAngle(units::radian_t theta) { return theta; } -} // namespace math -} // namespace units +} // namespace units::math diff --git a/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp b/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp index 402fb81a15..8420d52530 100644 --- a/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp +++ b/wpimath/src/test/native/cpp/estimator/MerweScaledSigmaPointsTest.cpp @@ -7,8 +7,7 @@ #include "frc/StateSpaceUtil.h" #include "frc/estimator/MerweScaledSigmaPoints.h" -namespace drake { -namespace math { +namespace drake::math { namespace { TEST(MerweScaledSigmaPointsTest, TestZeroMean) { frc::MerweScaledSigmaPoints<2> sigmaPoints; @@ -34,5 +33,4 @@ TEST(MerweScaledSigmaPointsTest, TestNonzeroMean) { .norm() < 1e-3); } } // namespace -} // namespace math -} // namespace drake +} // namespace drake::math diff --git a/wpiutil/src/main/native/cpp/uv/Async.cpp b/wpiutil/src/main/native/cpp/uv/Async.cpp index 06c4e90a0e..c9d698e974 100644 --- a/wpiutil/src/main/native/cpp/uv/Async.cpp +++ b/wpiutil/src/main/native/cpp/uv/Async.cpp @@ -6,8 +6,7 @@ #include "wpi/uv/Loop.h" -namespace wpi { -namespace uv { +namespace wpi::uv { Async<>::~Async() noexcept { if (auto loop = m_loop.lock()) { @@ -31,5 +30,4 @@ std::shared_ptr> Async<>::Create(const std::shared_ptr& loop) { return h; } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/Check.cpp b/wpiutil/src/main/native/cpp/uv/Check.cpp index a2bd0e3230..97265d40a6 100644 --- a/wpiutil/src/main/native/cpp/uv/Check.cpp +++ b/wpiutil/src/main/native/cpp/uv/Check.cpp @@ -6,8 +6,7 @@ #include "wpi/uv/Loop.h" -namespace wpi { -namespace uv { +namespace wpi::uv { std::shared_ptr Check::Create(Loop& loop) { auto h = std::make_shared(private_init{}); @@ -27,5 +26,4 @@ void Check::Start() { }); } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/FsEvent.cpp b/wpiutil/src/main/native/cpp/uv/FsEvent.cpp index e91104e340..0b9dfe85ef 100644 --- a/wpiutil/src/main/native/cpp/uv/FsEvent.cpp +++ b/wpiutil/src/main/native/cpp/uv/FsEvent.cpp @@ -9,8 +9,7 @@ #include "wpi/SmallString.h" #include "wpi/uv/Loop.h" -namespace wpi { -namespace uv { +namespace wpi::uv { std::shared_ptr FsEvent::Create(Loop& loop) { auto h = std::make_shared(private_init{}); @@ -61,5 +60,4 @@ std::string FsEvent::GetPath() { return std::string{}; } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/GetAddrInfo.cpp b/wpiutil/src/main/native/cpp/uv/GetAddrInfo.cpp index b390ffdb52..cb0a679e61 100644 --- a/wpiutil/src/main/native/cpp/uv/GetAddrInfo.cpp +++ b/wpiutil/src/main/native/cpp/uv/GetAddrInfo.cpp @@ -7,8 +7,7 @@ #include "wpi/uv/Loop.h" #include "wpi/uv/util.h" -namespace wpi { -namespace uv { +namespace wpi::uv { GetAddrInfoReq::GetAddrInfoReq() { error = [this](Error err) { GetLoop().error(err); }; @@ -50,5 +49,4 @@ void GetAddrInfo(Loop& loop, std::function callback, GetAddrInfo(loop, req, node, service, hints); } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/GetNameInfo.cpp b/wpiutil/src/main/native/cpp/uv/GetNameInfo.cpp index 10e7d13e7a..701fc77fb7 100644 --- a/wpiutil/src/main/native/cpp/uv/GetNameInfo.cpp +++ b/wpiutil/src/main/native/cpp/uv/GetNameInfo.cpp @@ -7,8 +7,7 @@ #include "wpi/uv/Loop.h" #include "wpi/uv/util.h" -namespace wpi { -namespace uv { +namespace wpi::uv { GetNameInfoReq::GetNameInfoReq() { error = [this](Error err) { GetLoop().error(err); }; @@ -90,5 +89,4 @@ void GetNameInfo6(Loop& loop, } } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/Idle.cpp b/wpiutil/src/main/native/cpp/uv/Idle.cpp index 08ae089c84..6bf8602aa6 100644 --- a/wpiutil/src/main/native/cpp/uv/Idle.cpp +++ b/wpiutil/src/main/native/cpp/uv/Idle.cpp @@ -6,8 +6,7 @@ #include "wpi/uv/Loop.h" -namespace wpi { -namespace uv { +namespace wpi::uv { std::shared_ptr Idle::Create(Loop& loop) { auto h = std::make_shared(private_init{}); @@ -27,5 +26,4 @@ void Idle::Start() { }); } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/NameToAddr.cpp b/wpiutil/src/main/native/cpp/uv/NameToAddr.cpp index 0a4c083e98..55ec9c14fe 100644 --- a/wpiutil/src/main/native/cpp/uv/NameToAddr.cpp +++ b/wpiutil/src/main/native/cpp/uv/NameToAddr.cpp @@ -8,8 +8,7 @@ #include "wpi/SmallString.h" -namespace wpi { -namespace uv { +namespace wpi::uv { int NameToAddr(const Twine& ip, unsigned int port, sockaddr_in* addr) { SmallString<128> tmp; @@ -61,5 +60,4 @@ int NameToAddr(const Twine& ip, in6_addr* addr) { } } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/NetworkStream.cpp b/wpiutil/src/main/native/cpp/uv/NetworkStream.cpp index 62c3aaf43b..9188cbbbe2 100644 --- a/wpiutil/src/main/native/cpp/uv/NetworkStream.cpp +++ b/wpiutil/src/main/native/cpp/uv/NetworkStream.cpp @@ -4,8 +4,7 @@ #include "wpi/uv/NetworkStream.h" -namespace wpi { -namespace uv { +namespace wpi::uv { ConnectReq::ConnectReq() { error = [this](Error err) { GetStream().error(err); }; @@ -28,5 +27,4 @@ void NetworkStream::Listen(std::function callback, int backlog) { Listen(backlog); } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/Pipe.cpp b/wpiutil/src/main/native/cpp/uv/Pipe.cpp index e26c0831a3..4834d69988 100644 --- a/wpiutil/src/main/native/cpp/uv/Pipe.cpp +++ b/wpiutil/src/main/native/cpp/uv/Pipe.cpp @@ -8,8 +8,7 @@ #include "wpi/SmallString.h" -namespace wpi { -namespace uv { +namespace wpi::uv { std::shared_ptr Pipe::Create(Loop& loop, bool ipc) { auto h = std::make_shared(private_init{}); @@ -138,5 +137,4 @@ std::string Pipe::GetPeer() { return std::string{}; } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/Poll.cpp b/wpiutil/src/main/native/cpp/uv/Poll.cpp index 6426441489..914a6a42ec 100644 --- a/wpiutil/src/main/native/cpp/uv/Poll.cpp +++ b/wpiutil/src/main/native/cpp/uv/Poll.cpp @@ -6,8 +6,7 @@ #include "wpi/uv/Loop.h" -namespace wpi { -namespace uv { +namespace wpi::uv { std::shared_ptr Poll::Create(Loop& loop, int fd) { auto h = std::make_shared(private_init{}); @@ -93,5 +92,4 @@ void Poll::Start(int events) { }); } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/Prepare.cpp b/wpiutil/src/main/native/cpp/uv/Prepare.cpp index 72f08c96a0..048fd08029 100644 --- a/wpiutil/src/main/native/cpp/uv/Prepare.cpp +++ b/wpiutil/src/main/native/cpp/uv/Prepare.cpp @@ -6,8 +6,7 @@ #include "wpi/uv/Loop.h" -namespace wpi { -namespace uv { +namespace wpi::uv { std::shared_ptr Prepare::Create(Loop& loop) { auto h = std::make_shared(private_init{}); @@ -27,5 +26,4 @@ void Prepare::Start() { }); } -} // namespace uv -} // namespace wpi +} // namespace wpi::uv diff --git a/wpiutil/src/main/native/cpp/uv/Process.cpp b/wpiutil/src/main/native/cpp/uv/Process.cpp index 6480306f26..90be6d5bed 100644 --- a/wpiutil/src/main/native/cpp/uv/Process.cpp +++ b/wpiutil/src/main/native/cpp/uv/Process.cpp @@ -8,8 +8,7 @@ #include "wpi/uv/Loop.h" #include "wpi/uv/Pipe.h" -namespace wpi { -namespace uv { +namespace wpi::uv { std::shared_ptr Process::SpawnArray(Loop& loop, const Twine& file, ArrayRef