mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
Switches the HAL structs to use unique_ptr (#183)
This commit is contained in:
committed by
Peter Johnson
parent
1ca291f20b
commit
0901ae0808
@@ -9,10 +9,11 @@
|
||||
|
||||
#include "HAL/Errors.h"
|
||||
#include "HAL/Solenoid.h"
|
||||
#include "HAL/cpp/make_unique.h"
|
||||
#include "PortsInternal.h"
|
||||
|
||||
namespace hal {
|
||||
PCM* PCM_modules[kNumPCMModules] = {nullptr};
|
||||
std::unique_ptr<PCM> PCM_modules[kNumPCMModules];
|
||||
|
||||
void initializePCM(int32_t module, int32_t* status) {
|
||||
if (!HAL_CheckSolenoidModule(module)) {
|
||||
@@ -20,7 +21,7 @@ void initializePCM(int32_t module, int32_t* status) {
|
||||
return;
|
||||
}
|
||||
if (!PCM_modules[module]) {
|
||||
PCM_modules[module] = new PCM(module);
|
||||
PCM_modules[module] = std::make_unique<PCM>(module);
|
||||
}
|
||||
}
|
||||
} // namespace hal
|
||||
|
||||
Reference in New Issue
Block a user