Fluid binary type adds size to the array of unsigned char, giving better access to the resource.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8292 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher
2011-01-19 23:14:09 +00:00
parent b015837b2a
commit 0ae74b5ab1
+6 -6
View File
@@ -898,8 +898,8 @@ void Fl_Data_Type::write_code1() {
if (is_in_class()) { if (is_in_class()) {
write_public(public_); write_public(public_);
write_comment_h(" "); write_comment_h(" ");
write_h(" static unsigned char %s[];\n", c); write_h(" static unsigned char %s[%d];\n", c, nData);
write_c("unsigned char %s::%s[] = /* binary data included from %s */\n", class_name(1), c, fn); write_c("unsigned char %s::%s[%d] = /* binary data included from %s */\n", class_name(1), c, nData, fn);
if (message) write_c("#error %s %s\n", message, fn); if (message) write_c("#error %s %s\n", message, fn);
write_cdata(data, nData); write_cdata(data, nData);
write_c(";\n"); write_c(";\n");
@@ -907,22 +907,22 @@ void Fl_Data_Type::write_code1() {
// the "header only" option does not apply here! // the "header only" option does not apply here!
if (public_) { if (public_) {
if (static_) { if (static_) {
write_h("extern unsigned char %s[];\n", c); write_h("extern unsigned char %s[%d];\n", c, nData);
write_comment_c(); write_comment_c();
write_c("unsigned char %s[] = /* binary data included from %s */\n", c, fn); write_c("unsigned char %s[%d] = /* binary data included from %s */\n", c, nData, fn);
if (message) write_c("#error %s %s\n", message, fn); if (message) write_c("#error %s %s\n", message, fn);
write_cdata(data, nData); write_cdata(data, nData);
write_c(";\n"); write_c(";\n");
} else { } else {
write_comment_h(); write_comment_h();
write_h("#error Unsupported declaration loading binary data %s\n", fn); write_h("#error Unsupported declaration loading binary data %s\n", fn);
write_h("unsigned char %s[] = { 1, 2, 3 };\n", c); write_h("unsigned char %s[3] = { 1, 2, 3 };\n", c);
} }
} else { } else {
write_comment_c(); write_comment_c();
if (static_) if (static_)
write_c("static "); write_c("static ");
write_c("unsigned char %s[] = /* binary data included from %s */\n", c, fn); write_c("unsigned char %s[%d] = /* binary data included from %s */\n", c, nData, fn);
if (message) write_c("#error %s %s\n", message, fn); if (message) write_c("#error %s %s\n", message, fn);
write_cdata(data, nData); write_cdata(data, nData);
write_c(";\n"); write_c(";\n");