浏览代码

Use nullptr

Scott Lahteine 4 年前
父节点
当前提交
97d7af7a23

+ 1
- 1
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extended/unicode/western_char_set.cpp 查看文件

435
       base_char   = base_special ? NO_DOT_I : std_char;
435
       base_char   = base_special ? NO_DOT_I : std_char;
436
     }
436
     }
437
 
437
 
438
-    // If cmd != NULL, draw the glyph to the screen
438
+    // If cmd != nullptr, draw the glyph to the screen
439
     if (cmd) {
439
     if (cmd) {
440
       ext_vertex2ii(*cmd, x, y, base_special ? alt_font : std_font, base_char);
440
       ext_vertex2ii(*cmd, x, y, base_special ? alt_font : std_font, base_char);
441
       if (accent_char)
441
       if (accent_char)

+ 2
- 2
Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/ftdi_eve_lib/extras/poly_ui.h 查看文件

90
         if (start_x != eol)
90
         if (start_x != eol)
91
           close_loop();
91
           close_loop();
92
         else
92
         else
93
-          p = NULL;
93
+          p = nullptr;
94
       }
94
       }
95
       else {
95
       else {
96
         x = pgm_read_word_far(p++);
96
         x = pgm_read_word_far(p++);
106
       }
106
       }
107
     }
107
     }
108
 
108
 
109
-    bool has_more()       { return p != NULL; }
109
+    bool has_more()       { return p != nullptr; }
110
     bool end_of_loop()    { return start_x == eol; }
110
     bool end_of_loop()    { return start_x == eol; }
111
 };
111
 };
112
 
112
 

+ 7
- 7
Marlin/src/lcd/tft/tft_string.h 查看文件

80
 
80
 
81
     static font_t *font() { return font_header; };
81
     static font_t *font() { return font_header; };
82
     static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; }
82
     static uint16_t font_height() { return font_header->FontAscent - font_header->FontDescent; }
83
-    static glyph_t *glyph(uint8_t character) { return glyphs[character] == NULL ? glyphs[0x3F] : glyphs[character]; }  /* Use '?' for unknown glyphs */
83
+    static glyph_t *glyph(uint8_t character) { return glyphs[character] ?: glyphs[0x3F]; }  /* Use '?' for unknown glyphs */
84
     static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); }
84
     static inline glyph_t *glyph(uint8_t *character) { return glyph(*character); }
85
 
85
 
86
     static void set();
86
     static void set();
87
     static void add(uint8_t character) { add_character(character); eol(); }
87
     static void add(uint8_t character) { add_character(character); eol(); }
88
     static void add(uint8_t *string);
88
     static void add(uint8_t *string);
89
-    static void add(uint8_t *string, int8_t index, uint8_t *itemString = NULL);
89
+    static void add(uint8_t *string, int8_t index, uint8_t *itemString=nullptr);
90
     static void set(uint8_t *string) { set(); add(string); };
90
     static void set(uint8_t *string) { set(); add(string); };
91
-    static void set(uint8_t *string, int8_t index, const char *itemString = NULL) { set(); add(string, index, (uint8_t *)itemString); };
91
+    static void set(uint8_t *string, int8_t index, const char *itemString=nullptr) { set(); add(string, index, (uint8_t *)itemString); };
92
     static inline void set(const char *string) { set((uint8_t *)string); }
92
     static inline void set(const char *string) { set((uint8_t *)string); }
93
-    static inline void set(const char *string, int8_t index, const char *itemString = NULL) { set((uint8_t *)string, index, itemString); }
93
+    static inline void set(const char *string, int8_t index, const char *itemString=nullptr) { set((uint8_t *)string, index, itemString); }
94
     static inline void add(const char *string) { add((uint8_t *)string); }
94
     static inline void add(const char *string) { add((uint8_t *)string); }
95
 
95
 
96
-    static void trim(uint8_t character = 0x20);
97
-    static void rtrim(uint8_t character = 0x20);
98
-    static void ltrim(uint8_t character = 0x20);
96
+    static void trim(uint8_t character=0x20);
97
+    static void rtrim(uint8_t character=0x20);
98
+    static void ltrim(uint8_t character=0x20);
99
     static uint16_t width() { return span; }
99
     static uint16_t width() { return span; }
100
     static uint8_t *string() { return data; }
100
     static uint8_t *string() { return data; }
101
     static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; }
101
     static uint16_t center(uint16_t width) { return span > width ? 0 : (width - span) / 2; }

正在加载...
取消
保存