summaryrefslogtreecommitdiff
path: root/fluid/code.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-01-01 20:05:42 +0100
committerGitHub <noreply@github.com>2023-01-01 20:05:42 +0100
commita63ad76603accc70747a2073c78139299064c43b (patch)
treeb64302ca02847a73d9c8445c11023cfc34314dff /fluid/code.cxx
parent23e8d831a868774c014993d52eead0cbe105f218 (diff)
FLUID refactor and macOS warnings removed (#623)
P renamed to g_project class Project renamed to class Fluid_Project fixes macOS type cast warnings
Diffstat (limited to 'fluid/code.cxx')
-rw-r--r--fluid/code.cxx50
1 files changed, 25 insertions, 25 deletions
diff --git a/fluid/code.cxx b/fluid/code.cxx
index 5cc02a241..6d1ab3f7c 100644
--- a/fluid/code.cxx
+++ b/fluid/code.cxx
@@ -270,7 +270,7 @@ void write_cstring(const char *s, int length) {
break;
}
// if the UTF-8 option is checked, write unicode characters verbatim
- if (P.utf8_in_src && (c&0x80)) {
+ if (g_project.utf8_in_src && (c&0x80)) {
if ((c&0x40)) {
// This is the first character in a utf-8 sequence (0b11......).
// A line break would be ok here. Do not put linebreak in front of
@@ -584,47 +584,47 @@ int write_code(const char *s, const char *t) {
fprintf(header_file, "#define %s\n", define_name);
}
- if (P.avoid_early_includes==0) {
+ if (g_project.avoid_early_includes==0) {
write_declare("#include <FL/Fl.H>");
}
- if (t && P.include_H_from_C) {
- if (P.header_file_name[0] == '.' && strchr(P.header_file_name, '/') == NULL) {
+ if (t && g_project.include_H_from_C) {
+ if (g_project.header_file_name[0] == '.' && strchr(g_project.header_file_name, '/') == NULL) {
write_c("#include \"%s\"\n", fl_filename_name(t));
} else {
write_c("#include \"%s\"\n", t);
}
}
- if (P.i18n_type && P.i18n_include[0]) {
- int conditional = (P.i18n_conditional[0]!=0);
+ if (g_project.i18n_type && g_project.i18n_include[0]) {
+ int conditional = (g_project.i18n_conditional[0]!=0);
if (conditional) {
- write_c("#ifdef %s\n", P.i18n_conditional.value());
+ write_c("#ifdef %s\n", g_project.i18n_conditional.value());
indentation++;
}
- if (P.i18n_include[0] != '<' &&
- P.i18n_include[0] != '\"')
- write_c("#%sinclude \"%s\"\n", indent(), P.i18n_include.value());
+ if (g_project.i18n_include[0] != '<' &&
+ g_project.i18n_include[0] != '\"')
+ write_c("#%sinclude \"%s\"\n", indent(), g_project.i18n_include.value());
else
- write_c("#%sinclude %s\n", indent(), P.i18n_include.value());
- if (P.i18n_type == 2) {
- if (P.i18n_file[0]) {
- write_c("extern nl_catd %s;\n", P.i18n_file.value());
+ write_c("#%sinclude %s\n", indent(), g_project.i18n_include.value());
+ if (g_project.i18n_type == 2) {
+ if (g_project.i18n_file[0]) {
+ write_c("extern nl_catd %s;\n", g_project.i18n_file.value());
} else {
write_c("// Initialize I18N stuff now for menus...\n");
write_c("#%sinclude <locale.h>\n", indent());
write_c("static char *_locale = setlocale(LC_MESSAGES, \"\");\n");
- write_c("static nl_catd _catalog = catopen(\"%s\", 0);\n", P.i18n_program.value());
+ write_c("static nl_catd _catalog = catopen(\"%s\", 0);\n", g_project.i18n_program.value());
}
}
if (conditional) {
write_c("#else\n");
- if (P.i18n_type == 1) {
- if (P.i18n_function[0]) {
- write_c("#%sifndef %s\n", indent(), P.i18n_function.value());
- write_c("#%sdefine %s(text) text\n", indent_plus(1), P.i18n_function.value());
+ if (g_project.i18n_type == 1) {
+ if (g_project.i18n_function[0]) {
+ write_c("#%sifndef %s\n", indent(), g_project.i18n_function.value());
+ write_c("#%sdefine %s(text) text\n", indent_plus(1), g_project.i18n_function.value());
write_c("#%sendif\n", indent());
}
}
- if (P.i18n_type == 2) {
+ if (g_project.i18n_type == 2) {
write_c("#%sifndef catgets\n", indent());
write_c("#%sdefine catgets(catalog, set, msgid, text) text\n", indent_plus(1));
write_c("#%sendif\n", indent());
@@ -632,9 +632,9 @@ int write_code(const char *s, const char *t) {
indentation--;
write_c("#endif\n");
}
- if (P.i18n_type == 1 && P.i18n_static_function[0]) {
- write_c("#ifndef %s\n", P.i18n_static_function.value());
- write_c("#%sdefine %s(text) text\n", indent_plus(1), P.i18n_static_function.value());
+ if (g_project.i18n_type == 1 && g_project.i18n_static_function[0]) {
+ write_c("#ifndef %s\n", g_project.i18n_static_function.value());
+ write_c("#%sdefine %s(text) text\n", indent_plus(1), g_project.i18n_static_function.value());
write_c("#endif\n");
}
}
@@ -692,7 +692,7 @@ int write_strings(const char *sfile) {
if (!fp) return 1;
- switch (P.i18n_type) {
+ switch (g_project.i18n_type) {
case 0 : /* None, just put static text out */
fprintf(fp, "# generated by Fast Light User Interface Designer (fluid) version %.4f\n",
FL_VERSION);
@@ -772,7 +772,7 @@ int write_strings(const char *sfile) {
case 2 : /* POSIX catgets, put a .msg file out */
fprintf(fp, "$ generated by Fast Light User Interface Designer (fluid) version %.4f\n",
FL_VERSION);
- fprintf(fp, "$set %s\n", P.i18n_set.value());
+ fprintf(fp, "$set %s\n", g_project.i18n_set.value());
fputs("$quote \"\n", fp);
for (i = 1, p = Fl_Type::first; p; p = p->next) {