Use C++ language supported 'nullptr' (#13944)

This commit is contained in:
Scott Lahteine
2019-05-09 11:45:55 -05:00
committed by GitHub
parent e53d7e5517
commit ad4ffa1d2f
70 changed files with 670 additions and 668 deletions

View File

@ -889,7 +889,7 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
int ret;
size_t idx = 0;
hd44780_charmap_t pinval;
hd44780_charmap_t *copy_address = NULL;
hd44780_charmap_t *copy_address = nullptr;
pinval.uchar = c;
pinval.idx = -1;
@ -900,7 +900,7 @@ int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
lcd.write((uint8_t)c);
return 1;
}
copy_address = NULL;
copy_address = nullptr;
ret = pf_bsearch_r((void *)g_hd44780_charmap_device, COUNT(g_hd44780_charmap_device), pf_bsearch_cb_comp_hd4map_pgm, (void *)&pinval, &idx);
if (ret >= 0) {
copy_address = (hd44780_charmap_t *)(g_hd44780_charmap_device + idx);

View File

@ -992,7 +992,7 @@ void MarlinUI::draw_status_screen() {
#endif // ADVANCED_PAUSE_FEATURE
void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char *valstr/*=NULL*/) {
void draw_menu_item_static(const uint8_t row, PGM_P pstr, const bool center/*=true*/, const bool invert/*=false*/, const char *valstr/*=nullptr*/) {
UNUSED(invert);
int8_t n = LCD_WIDTH;
lcd_moveto(0, row);
@ -1024,10 +1024,10 @@ void MarlinUI::draw_status_screen() {
if (pgm) lcd_put_u8str_P(data); else lcd_put_u8str(data);
}
void draw_edit_screen(PGM_P const pstr, const char* const value/*=NULL*/) {
void draw_edit_screen(PGM_P const pstr, const char* const value/*=nullptr*/) {
lcd_moveto(0, 1);
lcd_put_u8str_P(pstr);
if (value != NULL) {
if (value != nullptr) {
lcd_put_wchar(':');
int len = utf8_strlen(value);
const uint8_t valrow = (utf8_strlen_P(pstr) + 1 + len + 1) > (LCD_WIDTH - 2) ? 2 : 1; // Value on the next row if it won't fit