From d3133b8fa104edf663d4dae1ad5aabc2f09b08c1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 27 May 2024 11:24:11 +1000 Subject: [PATCH] AP_HAL_Empty: use NEW_NOTHROW for new(std::nothrow) --- libraries/AP_HAL_Empty/AnalogIn.cpp | 2 +- libraries/AP_HAL_Empty/GPIO.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_Empty/AnalogIn.cpp b/libraries/AP_HAL_Empty/AnalogIn.cpp index 2ce5b286a5..9430aec6d3 100644 --- a/libraries/AP_HAL_Empty/AnalogIn.cpp +++ b/libraries/AP_HAL_Empty/AnalogIn.cpp @@ -33,7 +33,7 @@ void AnalogIn::init() {} AP_HAL::AnalogSource* AnalogIn::channel(int16_t n) { - return new AnalogSource(1.11); + return NEW_NOTHROW AnalogSource(1.11); } float AnalogIn::board_voltage(void) diff --git a/libraries/AP_HAL_Empty/GPIO.cpp b/libraries/AP_HAL_Empty/GPIO.cpp index 694f69e563..19f8245ee2 100644 --- a/libraries/AP_HAL_Empty/GPIO.cpp +++ b/libraries/AP_HAL_Empty/GPIO.cpp @@ -24,7 +24,7 @@ void GPIO::toggle(uint8_t pin) /* Alternative interface: */ AP_HAL::DigitalSource* GPIO::channel(uint16_t n) { - return new DigitalSource(0); + return NEW_NOTHROW DigitalSource(0); } bool GPIO::usb_connected(void)