Browse Source

Revert some const changes (for now)

Scott Lahteine 6 years ago
parent
commit
0946cbcdca

+ 7
- 7
Marlin/src/lcd/HD44780/lcdprint_hd44780.cpp View File

@@ -866,11 +866,11 @@ static const hd44780_charmap_t g_hd44780_charmap_common[] PROGMEM = {
866 866
 };
867 867
 
868 868
 /* return v1 - v2 */
869
-static int hd44780_charmap_compare(const hd44780_charmap_t * const v1, const hd44780_charmap_t * const v2) {
869
+static int hd44780_charmap_compare(hd44780_charmap_t * v1, hd44780_charmap_t * v2) {
870 870
   return (v1->uchar < v2->uchar) ? -1 : (v1->uchar > v2->uchar) ? 1 : 0;
871 871
 }
872 872
 
873
-static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, const size_t idx, const void * const data_pin) {
873
+static int pf_bsearch_cb_comp_hd4map_pgm(void *userdata, size_t idx, void * data_pin) {
874 874
   hd44780_charmap_t localval;
875 875
   hd44780_charmap_t *p_hd44780_charmap = (hd44780_charmap_t *)userdata;
876 876
   memcpy_P(&localval, p_hd44780_charmap + idx, sizeof(localval));
@@ -883,7 +883,7 @@ void lcd_put_int(const int i) { lcd.print(i); }
883 883
 
884 884
 // return < 0 on error
885 885
 // return the advanced cols
886
-int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length) {
886
+int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
887 887
 
888 888
   // find the HD44780 internal ROM first
889 889
   int ret;
@@ -938,7 +938,7 @@ int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length) {
938 938
  *
939 939
  * Draw a UTF-8 string
940 940
  */
941
-static int lcd_put_u8str_max_cb(const char * const utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) {
941
+static int lcd_put_u8str_max_cb(const char * utf8_str, uint8_t (*cb_read_byte)(uint8_t * str), pixel_len_t max_length) {
942 942
   pixel_len_t ret = 0;
943 943
   uint8_t *p = (uint8_t *)utf8_str;
944 944
   while (ret < max_length) {
@@ -950,17 +950,17 @@ static int lcd_put_u8str_max_cb(const char * const utf8_str, uint8_t (*cb_read_b
950 950
   return (int)ret;
951 951
 }
952 952
 
953
-int lcd_put_u8str_max(const char * const utf8_str, pixel_len_t max_length) {
953
+int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) {
954 954
   return lcd_put_u8str_max_cb(utf8_str, read_byte_ram, max_length);
955 955
 }
956 956
 
957
-int lcd_put_u8str_max_P(PGM_P const utf8_str_P, pixel_len_t max_length) {
957
+int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
958 958
   return lcd_put_u8str_max_cb(utf8_str_P, read_byte_rom, max_length);
959 959
 }
960 960
 
961 961
 #if ENABLED(DEBUG_LCDPRINT)
962 962
 
963
-  int test_hd44780_charmap(hd44780_charmap_t *data, const size_t size, const char * const name, const bool flg_show_contents) {
963
+  int test_hd44780_charmap(hd44780_charmap_t *data, size_t size, char *name, char flg_show_contents) {
964 964
     int ret;
965 965
     size_t idx = 0;
966 966
     hd44780_charmap_t preval = {0, 0, 0};

+ 3
- 3
Marlin/src/lcd/dogm/lcdprint_u8g.cpp View File

@@ -28,7 +28,7 @@ void lcd_put_int(const int i) { u8g.print(i); }
28 28
 
29 29
 // return < 0 on error
30 30
 // return the advanced pixels
31
-int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length) {
31
+int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length) {
32 32
   if (c < 256) {
33 33
     u8g.print((char)c);
34 34
     return u8g_GetFontBBXWidth(u8g.getU8g());
@@ -41,7 +41,7 @@ int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length) {
41 41
   return ret;
42 42
 }
43 43
 
44
-int lcd_put_u8str_max(const char * const utf8_str, pixel_len_t max_length) {
44
+int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length) {
45 45
   unsigned int x = u8g.getPrintCol(),
46 46
                y = u8g.getPrintRow(),
47 47
                ret = uxg_DrawUtf8Str(u8g.getU8g(), x, y, utf8_str, max_length);
@@ -49,7 +49,7 @@ int lcd_put_u8str_max(const char * const utf8_str, pixel_len_t max_length) {
49 49
   return ret;
50 50
 }
51 51
 
52
-int lcd_put_u8str_max_P(PGM_P const utf8_str_P, pixel_len_t max_length) {
52
+int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length) {
53 53
   unsigned int x = u8g.getPrintCol(),
54 54
                y = u8g.getPrintRow(),
55 55
                ret = uxg_DrawUtf8StrP(u8g.getU8g(), x, y, utf8_str_P, max_length);

+ 6
- 6
Marlin/src/lcd/dogm/u8g_fontutf8.cpp View File

@@ -42,7 +42,7 @@ static int fontinfo_compare(uxg_fontinfo_t * v1, uxg_fontinfo_t * v2) {
42 42
 }
43 43
 
44 44
 /*"data_list[idx] - *data_pin"*/
45
-static int pf_bsearch_cb_comp_fntifo_pgm(void *userdata, const size_t idx, void *data_pin) {
45
+static int pf_bsearch_cb_comp_fntifo_pgm (void *userdata, size_t idx, void *data_pin) {
46 46
   uxg_fontinfo_t *fntinfo = (uxg_fontinfo_t*)userdata;
47 47
   uxg_fontinfo_t localval;
48 48
   memcpy_P(&localval, fntinfo + idx, sizeof(localval));
@@ -103,7 +103,7 @@ static void fontgroup_drawwchar(font_group_t *group, const font_t *fnt_default,
103 103
  *
104 104
  * Get the screen pixel width of a ROM UTF-8 string
105 105
  */
106
-static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char * const utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) {
106
+static void fontgroup_drawstring(font_group_t *group, const font_t *fnt_default, const char *utf8_msg, read_byte_cb_t cb_read_byte, void * userdata, fontgroup_cb_draw_t cb_draw_ram) {
107 107
   uint8_t *p = (uint8_t*)utf8_msg;
108 108
   for (;;) {
109 109
     wchar_t val = 0;
@@ -196,7 +196,7 @@ unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t
196 196
  *
197 197
  * Draw a UTF-8 string at the specified position
198 198
  */
199
-unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char * const utf8_msg, pixel_len_t max_width) {
199
+unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_width) {
200 200
   struct _uxg_drawu8_data_t data;
201 201
   font_group_t *group = &g_fontgroup_root;
202 202
   const font_t *fnt_default = uxg_GetFont(pu8g);
@@ -230,7 +230,7 @@ unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const
230 230
  *
231 231
  * Draw a ROM UTF-8 string at the specified position
232 232
  */
233
-unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P const utf8_msg, pixel_len_t max_width) {
233
+unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_width) {
234 234
   struct _uxg_drawu8_data_t data;
235 235
   font_group_t *group = &g_fontgroup_root;
236 236
   const font_t *fnt_default = uxg_GetFont(pu8g);
@@ -273,7 +273,7 @@ static int fontgroup_cb_draw_u8gstrlen(void *userdata, const font_t *fnt_current
273 273
  *
274 274
  * Get the screen pixel width of a UTF-8 string
275 275
  */
276
-int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char * const utf8_msg) {
276
+int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg) {
277 277
   struct _uxg_drawu8_data_t data;
278 278
   font_group_t *group = &g_fontgroup_root;
279 279
   const font_t *fnt_default = uxg_GetFont(pu8g);
@@ -299,7 +299,7 @@ int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char * const utf8_msg) {
299 299
  *
300 300
  * Get the screen pixel width of a ROM UTF-8 string
301 301
  */
302
-int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P const utf8_msg) {
302
+int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg) {
303 303
   struct _uxg_drawu8_data_t data;
304 304
   font_group_t *group = &g_fontgroup_root;
305 305
   const font_t *fnt_default = uxg_GetFont(pu8g);

+ 4
- 4
Marlin/src/lcd/dogm/u8g_fontutf8.h View File

@@ -28,10 +28,10 @@ int uxg_SetUtf8Fonts(const uxg_fontinfo_t * fntinfo, int number); // fntinfo is
28 28
 
29 29
 unsigned int uxg_DrawWchar(u8g_t *pu8g, unsigned int x, unsigned int y, wchar_t ch, pixel_len_t max_length);
30 30
 
31
-unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char * const utf8_msg, pixel_len_t max_length);
32
-unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P const utf8_msg, pixel_len_t max_length);
31
+unsigned int uxg_DrawUtf8Str(u8g_t *pu8g, unsigned int x, unsigned int y, const char *utf8_msg, pixel_len_t max_length);
32
+unsigned int uxg_DrawUtf8StrP(u8g_t *pu8g, unsigned int x, unsigned int y, PGM_P utf8_msg, pixel_len_t max_length);
33 33
 
34
-int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char * const utf8_msg);
35
-int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P const utf8_msg);
34
+int uxg_GetUtf8StrPixelWidth(u8g_t *pu8g, const char *utf8_msg);
35
+int uxg_GetUtf8StrPixelWidthP(u8g_t *pu8g, PGM_P utf8_msg);
36 36
 
37 37
 #define uxg_GetFont(puxg) ((puxg)->font)

+ 5
- 5
Marlin/src/lcd/lcdprint.h View File

@@ -22,7 +22,7 @@
22 22
 
23 23
 int lcd_glyph_height(void);
24 24
 
25
-int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length);
25
+int lcd_put_wchar_max(wchar_t c, pixel_len_t max_length);
26 26
 
27 27
 /**
28 28
  * @brief Draw a UTF-8 string
@@ -34,7 +34,7 @@ int lcd_put_wchar_max(const wchar_t c, pixel_len_t max_length);
34 34
  *
35 35
  * Draw a UTF-8 string
36 36
  */
37
-int lcd_put_u8str_max(const char * const utf8_str, pixel_len_t max_length);
37
+int lcd_put_u8str_max(const char * utf8_str, pixel_len_t max_length);
38 38
 
39 39
 /**
40 40
  * @brief Draw a ROM UTF-8 string
@@ -46,14 +46,14 @@ int lcd_put_u8str_max(const char * const utf8_str, pixel_len_t max_length);
46 46
  *
47 47
  * Draw a ROM UTF-8 string
48 48
  */
49
-int lcd_put_u8str_max_P(PGM_P const utf8_str_P, pixel_len_t max_length);
49
+int lcd_put_u8str_max_P(PGM_P utf8_str_P, pixel_len_t max_length);
50 50
 
51 51
 void lcd_moveto(const uint8_t col, const uint8_t row);
52 52
 
53 53
 void lcd_put_int(const int i);
54 54
 
55
-inline int lcd_put_u8str_P(PGM_P const str) { return lcd_put_u8str_max_P(str, PIXEL_LEN_NOLIMIT); }
55
+inline int lcd_put_u8str_P(PGM_P str) { return lcd_put_u8str_max_P(str, PIXEL_LEN_NOLIMIT); }
56 56
 
57
-inline int lcd_put_u8str(const char * const str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); }
57
+inline int lcd_put_u8str(const char* str) { return lcd_put_u8str_max(str, PIXEL_LEN_NOLIMIT); }
58 58
 
59 59
 inline int lcd_put_wchar(const wchar_t c) { return lcd_put_wchar_max(c, PIXEL_LEN_NOLIMIT); }

Loading…
Cancel
Save