Use C++ language supported 'nullptr' (#13944)
This commit is contained in:
@ -70,14 +70,14 @@ DECLARE_MENU_EDIT_TYPE(uint32_t, long5_25, ftostr5rj, 0.04f ); // 123
|
||||
typedef void (*selectFunc_t)();
|
||||
void draw_select_screen(PGM_P const yes, PGM_P const no, const bool yesno, PGM_P const pref, const char * const string, PGM_P const suff);
|
||||
void set_ui_selection(const bool sel);
|
||||
void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=NULL, PGM_P const suff=NULL);
|
||||
inline void do_select_screen_yn(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=NULL, PGM_P const suff=NULL) {
|
||||
void do_select_screen(PGM_P const yes, PGM_P const no, selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr);
|
||||
inline void do_select_screen_yn(selectFunc_t yesFunc, selectFunc_t noFunc, PGM_P const pref, const char * const string=nullptr, PGM_P const suff=nullptr) {
|
||||
do_select_screen(PSTR(MSG_YES), PSTR(MSG_NO), yesFunc, noFunc, pref, string, suff);
|
||||
}
|
||||
|
||||
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);
|
||||
void draw_menu_item(const bool sel, const uint8_t row, PGM_P const pstr, const char pre_char, const char post_char);
|
||||
void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const bool center=true, const bool invert=false, const char *valstr=NULL);
|
||||
void draw_menu_item_static(const uint8_t row, PGM_P const pstr, const bool center=true, const bool invert=false, const char *valstr=nullptr);
|
||||
void _draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data, const bool pgm);
|
||||
FORCE_INLINE void draw_menu_item_back(const bool sel, const uint8_t row, PGM_P const pstr) { draw_menu_item(sel, row, pstr, LCD_STR_UPLEVEL[0], LCD_STR_UPLEVEL[0]); }
|
||||
FORCE_INLINE void draw_menu_item_edit(const bool sel, const uint8_t row, PGM_P const pstr, const char* const data) { _draw_menu_item_edit(sel, row, pstr, data, false); }
|
||||
@ -187,7 +187,7 @@ class TMenuItem : MenuItemBase {
|
||||
static void load(void *ptr, const int16_t value) { *((type_t*)ptr) = unscale(value); }
|
||||
static char* to_string(const int16_t value) { return NAME::strfunc(unscale(value)); }
|
||||
public:
|
||||
static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=NULL, const bool live=false) {
|
||||
static void action_edit(PGM_P const pstr, type_t * const ptr, const type_t minValue, const type_t maxValue, const screenFunc_t callback=nullptr, const bool live=false) {
|
||||
// Make sure minv and maxv fit within int16_t
|
||||
const int16_t minv = MAX(scale(minValue), INT16_MIN),
|
||||
maxv = MIN(scale(maxValue), INT16_MAX);
|
||||
@ -218,7 +218,7 @@ DECLARE_MENU_EDIT_ITEM(long5_25);
|
||||
|
||||
class MenuItem_bool {
|
||||
public:
|
||||
static void action_edit(PGM_P const pstr, bool* ptr, const screenFunc_t callbackFunc=NULL);
|
||||
static void action_edit(PGM_P const pstr, bool* ptr, const screenFunc_t callbackFunc=nullptr);
|
||||
};
|
||||
|
||||
////////////////////////////////////////////
|
||||
|
Reference in New Issue
Block a user