Skip to content

Commit e2b04e7

Browse files
Minor tweak, NULL=>nullptr (#844)
1 parent f79b086 commit e2b04e7

File tree

22 files changed

+55
-55
lines changed

22 files changed

+55
-55
lines changed

cores/rp2040/FS.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class FS {
240240
}
241241
time_t (*_timeCallback)(void) = nullptr;
242242
static time_t _defaultTimeCB(void) {
243-
return time(NULL);
243+
return time(nullptr);
244244
}
245245
};
246246

cores/rp2040/RP2040USB.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ const uint16_t *tud_descriptor_string_cb(uint8_t index, uint16_t langid) {
289289
len = 1;
290290
} else {
291291
if (index >= sizeof(usbd_desc_str) / sizeof(usbd_desc_str[0])) {
292-
return NULL;
292+
return nullptr;
293293
}
294294
const char *str = usbd_desc_str[index];
295295
for (len = 0; len < DESC_STR_MAX - 1 && str[len]; ++len) {
@@ -308,7 +308,7 @@ static void usb_irq() {
308308
// if the mutex is already owned, then we are in user code
309309
// in this file which will do a tud_task itself, so we'll just do nothing
310310
// until the next tick; we won't starve
311-
if (mutex_try_enter(&__usb_mutex, NULL)) {
311+
if (mutex_try_enter(&__usb_mutex, nullptr)) {
312312
tud_task();
313313
mutex_exit(&__usb_mutex);
314314
}
@@ -338,7 +338,7 @@ void __USBStart() {
338338
irq_set_exclusive_handler(__usb_task_irq, usb_irq);
339339
irq_set_enabled(__usb_task_irq, true);
340340

341-
add_alarm_in_us(USB_TASK_INTERVAL, timer_task, NULL, true);
341+
add_alarm_in_us(USB_TASK_INTERVAL, timer_task, nullptr, true);
342342
}
343343

344344

cores/rp2040/lock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ int __retarget_lock_try_acquire(_LOCK_T lock) {
147147
auto mtx = __getFreeRTOSMutex(lock);
148148
ret = __freertos_mutex_try_take(mtx);
149149
} else {
150-
ret = mutex_try_enter((mutex_t *)lock, NULL);
150+
ret = mutex_try_enter((mutex_t *)lock, nullptr);
151151
}
152152
return ret;
153153
}
@@ -158,7 +158,7 @@ int __retarget_lock_try_acquire_recursive(_LOCK_T lock) {
158158
auto mtx = __getFreeRTOSRecursiveMutex(lock);
159159
ret = __freertos_recursive_mutex_try_take(mtx);
160160
} else {
161-
ret = recursive_mutex_try_enter((recursive_mutex_t*)lock, NULL);
161+
ret = recursive_mutex_try_enter((recursive_mutex_t*)lock, nullptr);
162162
}
163163
return ret;
164164
}

libraries/ArduinoOTA/src/ArduinoOTA.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ class ArduinoOTAClass {
5959
void setHostname(const char *hostname);
6060
String getHostname();
6161

62-
//Sets the password that will be required for OTA. Default NULL
62+
//Sets the password that will be required for OTA. Default nullptr
6363
void setPassword(const char *password);
6464

65-
//Sets the password as above but in the form MD5(password). Default NULL
65+
//Sets the password as above but in the form MD5(password). Default nullptr
6666
void setPasswordHash(const char *password);
6767

6868
//Sets if the device should be rebooted after successful update. Default true

libraries/DNSServer/src/DNSServer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,13 @@ void DNSServer::replyWithError(DNSHeader *dnsHeader,
444444

445445
_udp.beginPacket(_udp.remoteIP(), _udp.remotePort());
446446
_udp.write((unsigned char *)dnsHeader, sizeof(DNSHeader));
447-
if (query != NULL) {
447+
if (query != nullptr) {
448448
_udp.write(query, queryLength);
449449
}
450450
_udp.endPacket();
451451
}
452452

453453
void DNSServer::replyWithError(DNSHeader *dnsHeader,
454454
DNSReplyCode rcode) {
455-
replyWithError(dnsHeader, rcode, NULL, 0);
455+
replyWithError(dnsHeader, rcode, nullptr, 0);
456456
}

libraries/HTTPClient/src/HTTPClient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,7 @@ int HTTPClient::writeToPrint(Print * print) {
807807
DEBUG_HTTPCLIENT("[HTTP-Client] chunk header: '%s'\n", chunkHeader.c_str());
808808

809809
// read size of chunk
810-
len = (uint32_t) strtol((const char *) chunkHeader.c_str(), NULL, 16);
810+
len = (uint32_t) strtol((const char *) chunkHeader.c_str(), nullptr, 16);
811811
size += len;
812812
DEBUG_HTTPCLIENT("[HTTP-Client] read chunk len: %d\n", len);
813813

libraries/HTTPClient/src/HTTPClient.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ class HTTPClient {
205205
int PATCH(const uint8_t* payload, size_t size);
206206
int PATCH(const String& payload);
207207
int sendRequest(const char* type, const String& payload);
208-
int sendRequest(const char* type, const uint8_t* payload = NULL, size_t size = 0);
208+
int sendRequest(const char* type, const uint8_t* payload = nullptr, size_t size = 0);
209209
int sendRequest(const char* type, Stream * stream, size_t size = 0);
210210

211211
void addHeader(const String& name, const String& value, bool first = false, bool replace = true);

libraries/HTTPUpdateServer/src/HTTPUpdateServer-impl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static const char successResponse[] PROGMEM =
6060
template <typename ServerType, int ServerPort>
6161
HTTPUpdateServerTemplate<ServerType, ServerPort>::HTTPUpdateServerTemplate(bool serial_debug) {
6262
_serial_output = serial_debug;
63-
_server = NULL;
63+
_server = nullptr;
6464
_username = "";
6565
_password = "";
6666
_authenticated = false;

libraries/SPI/src/SPI.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ void SPIClassRP2040::transfer(const void *txbuf, void *rxbuf, size_t count) {
154154
if (_spis.getBitOrder() == MSBFIRST) {
155155
spi_set_format(_spi, 8, cpol(), cpha(), SPI_MSB_FIRST);
156156

157-
if (rxbuf == NULL) { // transmit only!
157+
if (rxbuf == nullptr) { // transmit only!
158158
spi_write_blocking(_spi, txbuff, count);
159159
return;
160160
}
161-
if (txbuf == NULL) { // receive only!
161+
if (txbuf == nullptr) { // receive only!
162162
spi_read_blocking(_spi, 0xFF, rxbuff, count);
163163
return;
164164
}

libraries/SPI/src/SPI.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class SPIClassRP2040 : public arduino::HardwareSPI {
3535
// Sends buffer in 8 bit chunks. Overwrites buffer with read data
3636
void transfer(void *buf, size_t count) override;
3737

38-
// Sends one buffer and receives into another, much faster! can set rx or txbuf to NULL
38+
// Sends one buffer and receives into another, much faster! can set rx or txbuf to nullptr
3939
void transfer(const void *txbuf, void *rxbuf, size_t count) override;
4040

4141
// Call before/after every complete transaction

0 commit comments

Comments
 (0)