Fluid inlined text data must be 'const'

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13065 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2018-10-09 19:56:33 +00:00
parent b10524fce2
commit f58c1d85b8

View File

@ -931,8 +931,8 @@ void Fl_Data_Type::write_code1() {
write_public(public_); write_public(public_);
write_comment_h(" "); write_comment_h(" ");
if (text_mode_) { if (text_mode_) {
write_h(" static char *%s;\n", c); write_h(" static const char *%s;\n", c);
write_c("char *%s::%s = /* text inlined from %s */\n", class_name(1), c, fn); write_c("const char *%s::%s = /* text inlined from %s */\n", class_name(1), c, fn);
if (message) write_c("#error %s %s\n", message, fn); if (message) write_c("#error %s %s\n", message, fn);
write_cstring(data, nData); write_cstring(data, nData);
} else { } else {
@ -947,9 +947,9 @@ void Fl_Data_Type::write_code1() {
if (public_) { if (public_) {
if (static_) { if (static_) {
if (text_mode_) { if (text_mode_) {
write_h("extern char *%s;\n", c); write_h("extern const char *%s;\n", c);
write_comment_c(); write_comment_c();
write_c("char *%s = /* text inlined from %s */\n", c, fn); write_c("const char *%s = /* text inlined from %s */\n", c, fn);
if (message) write_c("#error %s %s\n", message, fn); if (message) write_c("#error %s %s\n", message, fn);
write_cstring(data, nData); write_cstring(data, nData);
} else { } else {
@ -964,7 +964,7 @@ void Fl_Data_Type::write_code1() {
write_comment_h(); write_comment_h();
write_h("#error Unsupported declaration loading inline data %s\n", fn); write_h("#error Unsupported declaration loading inline data %s\n", fn);
if (text_mode_) if (text_mode_)
write_h("char *%s = \"abc...\";\n", c); write_h("const char *%s = \"abc...\";\n", c);
else else
write_h("unsigned char %s[3] = { 1, 2, 3 };\n", c); write_h("unsigned char %s[3] = { 1, 2, 3 };\n", c);
} }
@ -973,7 +973,7 @@ void Fl_Data_Type::write_code1() {
if (static_) if (static_)
write_c("static "); write_c("static ");
if (text_mode_) { if (text_mode_) {
write_c("char *%s = /* text inlined from %s */\n", c, fn); write_c("const char *%s = /* text inlined from %s */\n", c, fn);
if (message) write_c("#error %s %s\n", message, fn); if (message) write_c("#error %s %s\n", message, fn);
write_cstring(data, nData); write_cstring(data, nData);
} else { } else {