Changeset View
Changeset View
Standalone View
Standalone View
source/blender/datatoc/datatoc.c
| Show First 20 Lines • Show All 88 Lines • ▼ Show 20 Lines | #endif | ||||
| if (!fpout) { | if (!fpout) { | ||||
| fprintf(stderr, "Unable to open output <%s>\n", argv[2]); | fprintf(stderr, "Unable to open output <%s>\n", argv[2]); | ||||
| exit(1); | exit(1); | ||||
| } | } | ||||
| fprintf(fpout, "/* DataToC output of file <%s> */\n\n", argv[1]); | fprintf(fpout, "/* DataToC output of file <%s> */\n\n", argv[1]); | ||||
| /* Quiet 'missing-variable-declarations' warning. */ | /* Quiet 'missing-variable-declarations' warning. */ | ||||
| fprintf(fpout, "extern int datatoc_%s_size;\n", argv[1]); | fprintf(fpout, "extern const int datatoc_%s_size;\n", argv[1]); | ||||
| fprintf(fpout, "extern char datatoc_%s[];\n\n", argv[1]); | fprintf(fpout, "extern const char datatoc_%s[];\n\n", argv[1]); | ||||
| fprintf(fpout, "int datatoc_%s_size = %d;\n", argv[1], (int)size); | fprintf(fpout, "const int datatoc_%s_size = %d;\n", argv[1], (int)size); | ||||
| fprintf(fpout, "char datatoc_%s[] = {\n", argv[1]); | fprintf(fpout, "const char datatoc_%s[] = {\n", argv[1]); | ||||
| while (size--) { | while (size--) { | ||||
sergey: `FOO const` vs `const FOO`.
Is is possible to stick to `const FOO`? | |||||
Done Inline Actionsgood catch. LazyDodo: good catch. | |||||
| /* if we want to open in an editor | /* if we want to open in an editor | ||||
| * this is nicer to avoid very long lines */ | * this is nicer to avoid very long lines */ | ||||
| #ifdef VERBOSE | #ifdef VERBOSE | ||||
| if (size % 32 == 31) { | if (size % 32 == 31) { | ||||
| fprintf(fpout, "\n"); | fprintf(fpout, "\n"); | ||||
| } | } | ||||
| #endif | #endif | ||||
| Show All 13 Lines | |||||
FOO const vs const FOO.
Is is possible to stick to const FOO?