diff --git a/fluid/ExternalCodeEditor_UNIX.cxx b/fluid/ExternalCodeEditor_UNIX.cxx index 10e7f7195..687927f70 100644 --- a/fluid/ExternalCodeEditor_UNIX.cxx +++ b/fluid/ExternalCodeEditor_UNIX.cxx @@ -291,7 +291,7 @@ const char* ExternalCodeEditor::tmp_filename() { static char path[FL_PATH_MAX+1]; const char *tmpdir = create_tmpdir(); if ( !tmpdir ) return 0; - const char *ext = P.code_file_name; // e.g. ".cxx" + const char *ext = g_project.code_file_name; // e.g. ".cxx" snprintf(path, FL_PATH_MAX, "%s/%p%s", tmpdir, (void*)this, ext); path[FL_PATH_MAX] = 0; return path; diff --git a/fluid/ExternalCodeEditor_WIN32.cxx b/fluid/ExternalCodeEditor_WIN32.cxx index 175a6e5b2..55d68ba57 100644 --- a/fluid/ExternalCodeEditor_WIN32.cxx +++ b/fluid/ExternalCodeEditor_WIN32.cxx @@ -359,7 +359,7 @@ const char* ExternalCodeEditor::tmp_filename() { static char path[512]; const char *tmpdir = create_tmpdir(); if ( !tmpdir ) return 0; - const char *ext = P.code_file_name; // e.g. ".cxx" + const char *ext = g_project.code_file_name; // e.g. ".cxx" _snprintf(path, sizeof(path), "%s\\%p%s", tmpdir, (void*)this, ext); path[sizeof(path)-1] = 0; return path; diff --git a/fluid/Fl_Menu_Type.cxx b/fluid/Fl_Menu_Type.cxx index 92445ff17..f0a7b6af1 100644 --- a/fluid/Fl_Menu_Type.cxx +++ b/fluid/Fl_Menu_Type.cxx @@ -378,10 +378,10 @@ void Fl_Menu_Item_Type::write_item() { write_comment_inline_c(" "); write_c(" {"); if (label() && label()[0]) - switch (P.i18n_type) { + switch (g_project.i18n_type) { case 1: // we will call i18n when the menu is instantiated for the first time - write_c("%s(", P.i18n_static_function.value()); + write_c("%s(", g_project.i18n_static_function.value()); write_cstring(label()); write_c(")"); break; @@ -394,7 +394,7 @@ void Fl_Menu_Item_Type::write_item() { write_c("\"\""); if (((Fl_Button*)o)->shortcut()) { int s = ((Fl_Button*)o)->shortcut(); - if (P.use_FL_COMMAND && (s & (FL_CTRL|FL_META))) { + if (g_project.use_FL_COMMAND && (s & (FL_CTRL|FL_META))) { write_c(", FL_COMMAND|0x%x, ", s & ~(FL_CTRL|FL_META)); } else { write_c(", 0x%x, ", s); @@ -474,15 +474,15 @@ void Fl_Menu_Item_Type::write_code1() { write_c("%sml->labela = (char*)", indent()); image->write_inline(); write_c(";\n"); - if (P.i18n_type==0) { + if (g_project.i18n_type==0) { write_c("%sml->labelb = o->label();\n", indent()); - } else if (P.i18n_type==1) { + } else if (g_project.i18n_type==1) { write_c("%sml->labelb = %s(o->label());\n", - indent(), P.i18n_function.value()); - } else if (P.i18n_type==2) { + indent(), g_project.i18n_function.value()); + } else if (g_project.i18n_type==2) { write_c("%sml->labelb = catgets(%s,%s,i+%d,o->label());\n", - indent(), P.i18n_file[0] ? P.i18n_file.value() : "_catalog", - P.i18n_set.value(), msgnum()); + indent(), g_project.i18n_file[0] ? g_project.i18n_file.value() : "_catalog", + g_project.i18n_set.value(), msgnum()); } write_c("%sml->typea = FL_IMAGE_LABEL;\n", indent()); write_c("%sml->typeb = FL_NORMAL_LABEL;\n", indent()); @@ -491,20 +491,20 @@ void Fl_Menu_Item_Type::write_code1() { image->write_code(0, "o"); } } - if (P.i18n_type && label() && label()[0]) { + if (g_project.i18n_type && label() && label()[0]) { Fl_Labeltype t = o->labeltype(); if (image) { // label was already copied a few lines up } else if ( t==FL_NORMAL_LABEL || t==FL_SHADOW_LABEL || t==FL_ENGRAVED_LABEL || t==FL_EMBOSSED_LABEL) { start_menu_initialiser(menuItemInitialized, mname, i); - if (P.i18n_type==1) { + if (g_project.i18n_type==1) { write_c("%so->label(%s(o->label()));\n", - indent(), P.i18n_function.value()); - } else if (P.i18n_type==2) { + indent(), g_project.i18n_function.value()); + } else if (g_project.i18n_type==2) { write_c("%so->label(catgets(%s,%s,i+%d,o->label()));\n", - indent(), P.i18n_file[0] ? P.i18n_file.value() : "_catalog", - P.i18n_set.value(), msgnum()); + indent(), g_project.i18n_file[0] ? g_project.i18n_file.value() : "_catalog", + g_project.i18n_set.value(), msgnum()); } } } diff --git a/fluid/Fl_Widget_Type.cxx b/fluid/Fl_Widget_Type.cxx index 17e522e14..cab346b5d 100644 --- a/fluid/Fl_Widget_Type.cxx +++ b/fluid/Fl_Widget_Type.cxx @@ -2869,18 +2869,18 @@ void Fl_Widget_Type::write_code1() { } if (label() && *label()) { write_c(", "); - switch (P.i18n_type) { + switch (g_project.i18n_type) { case 0 : /* None */ write_cstring(label()); break; case 1 : /* GNU gettext */ - write_c("%s(", P.i18n_function.value()); + write_c("%s(", g_project.i18n_function.value()); write_cstring(label()); write_c(")"); break; case 2 : /* POSIX catgets */ - write_c("catgets(%s,%s,%d,", P.i18n_file[0] ? P.i18n_file.value() : "_catalog", - P.i18n_set.value(), msgnum()); + write_c("catgets(%s,%s,%d,", g_project.i18n_file[0] ? g_project.i18n_file.value() : "_catalog", + g_project.i18n_set.value(), msgnum()); write_cstring(label()); write_c(")"); break; @@ -2942,18 +2942,18 @@ void Fl_Widget_Type::write_widget_code() { if (tooltip() && *tooltip()) { write_c("%s%s->tooltip(",indent(), var); - switch (P.i18n_type) { + switch (g_project.i18n_type) { case 0 : /* None */ write_cstring(tooltip()); break; case 1 : /* GNU gettext */ - write_c("%s(", P.i18n_function.value()); + write_c("%s(", g_project.i18n_function.value()); write_cstring(tooltip()); write_c(")"); break; case 2 : /* POSIX catgets */ - write_c("catgets(%s,%s,%d,", P.i18n_file[0] ? P.i18n_file.value() : "_catalog", - P.i18n_set.value(), msgnum() + 1); + write_c("catgets(%s,%s,%d,", g_project.i18n_file[0] ? g_project.i18n_file.value() : "_catalog", + g_project.i18n_set.value(), msgnum() + 1); write_cstring(tooltip()); write_c(")"); break; @@ -2975,7 +2975,7 @@ void Fl_Widget_Type::write_widget_code() { else if (is_value_input()) shortcut = ((Fl_Value_Input*)o)->shortcut(); else if (is_text_display()) shortcut = ((Fl_Text_Display*)o)->shortcut(); if (shortcut) { - if (P.use_FL_COMMAND && (shortcut & (FL_CTRL|FL_META))) { + if (g_project.use_FL_COMMAND && (shortcut & (FL_CTRL|FL_META))) { write_c("%s%s->shortcut(FL_COMMAND|0x%x);\n", indent(), var, shortcut & ~(FL_CTRL|FL_META)); } else { write_c("%s%s->shortcut(0x%x);\n", indent(), var, shortcut); diff --git a/fluid/Fl_Window_Type.cxx b/fluid/Fl_Window_Type.cxx index 8f9ce2a14..a02f16baf 100644 --- a/fluid/Fl_Window_Type.cxx +++ b/fluid/Fl_Window_Type.cxx @@ -117,7 +117,7 @@ void default_widget_size_cb(Fl_Round_Button *b, long size) { void i18n_type_cb(Fl_Choice *c, void *) { undo_checkpoint(); - switch (P.i18n_type = c->value()) { + switch (g_project.i18n_type = c->value()) { case 0 : /* None */ i18n_include_input->hide(); i18n_conditional_input->hide(); @@ -128,13 +128,13 @@ void i18n_type_cb(Fl_Choice *c, void *) { break; case 1 : /* GNU gettext */ i18n_include_input->value(""); - P.i18n_include = i18n_include_input->value(); + g_project.i18n_include = i18n_include_input->value(); i18n_conditional_input->value(""); - P.i18n_conditional = i18n_conditional_input->value(); + g_project.i18n_conditional = i18n_conditional_input->value(); i18n_function_input->value("gettext"); - P.i18n_function = i18n_function_input->value(); + g_project.i18n_function = i18n_function_input->value(); i18n_static_function_input->value("gettext_noop"); - P.i18n_static_function = i18n_static_function_input->value(); + g_project.i18n_static_function = i18n_static_function_input->value(); i18n_include_input->show(); i18n_conditional_input->show(); i18n_file_input->hide(); @@ -144,13 +144,13 @@ void i18n_type_cb(Fl_Choice *c, void *) { break; case 2 : /* POSIX cat */ i18n_include_input->value(""); - P.i18n_include = i18n_include_input->value(); + g_project.i18n_include = i18n_include_input->value(); i18n_conditional_input->value(""); - P.i18n_conditional = i18n_conditional_input->value(); + g_project.i18n_conditional = i18n_conditional_input->value(); i18n_file_input->value(""); - P.i18n_file = i18n_file_input->value(); + g_project.i18n_file = i18n_file_input->value(); i18n_set_input->value("1"); - P.i18n_set = i18n_set_input->value(); + g_project.i18n_set = i18n_set_input->value(); i18n_include_input->show(); i18n_conditional_input->show(); i18n_file_input->show(); @@ -167,15 +167,15 @@ void i18n_text_cb(Fl_Input *i, void *) { undo_checkpoint(); if (i == i18n_function_input) - P.i18n_function = i->value(); + g_project.i18n_function = i->value(); else if (i == i18n_static_function_input) - P.i18n_static_function = i->value(); + g_project.i18n_static_function = i->value(); else if (i == i18n_file_input) - P.i18n_file = i->value(); + g_project.i18n_file = i->value(); else if (i == i18n_include_input) - P.i18n_include = i->value(); + g_project.i18n_include = i->value(); else if (i == i18n_conditional_input) - P.i18n_conditional = i->value(); + g_project.i18n_conditional = i->value(); set_modflag(1); } @@ -184,27 +184,27 @@ void i18n_int_cb(Fl_Int_Input *i, void *) { undo_checkpoint(); if (i == i18n_set_input) - P.i18n_set = i->value(); + g_project.i18n_set = i->value(); set_modflag(1); } void show_project_cb(Fl_Widget *, void *) { if(project_window==0) make_project_window(); - include_H_from_C_button->value(P.include_H_from_C); - use_FL_COMMAND_button->value(P.use_FL_COMMAND); - utf8_in_src_button->value(P.utf8_in_src); - avoid_early_includes_button->value(P.avoid_early_includes); - header_file_input->value(P.header_file_name); - code_file_input->value(P.code_file_name); - i18n_type_chooser->value(P.i18n_type); - i18n_function_input->value(P.i18n_function); - i18n_static_function_input->value(P.i18n_static_function); - i18n_file_input->value(P.i18n_file); - i18n_set_input->value(P.i18n_set); - i18n_include_input->value(P.i18n_include); - i18n_conditional_input->value(P.i18n_conditional); - switch (P.i18n_type) { + include_H_from_C_button->value(g_project.include_H_from_C); + use_FL_COMMAND_button->value(g_project.use_FL_COMMAND); + utf8_in_src_button->value(g_project.utf8_in_src); + avoid_early_includes_button->value(g_project.avoid_early_includes); + header_file_input->value(g_project.header_file_name); + code_file_input->value(g_project.code_file_name); + i18n_type_chooser->value(g_project.i18n_type); + i18n_function_input->value(g_project.i18n_function); + i18n_static_function_input->value(g_project.i18n_static_function); + i18n_file_input->value(g_project.i18n_file); + i18n_set_input->value(g_project.i18n_set); + i18n_include_input->value(g_project.i18n_include); + i18n_conditional_input->value(g_project.i18n_conditional); + switch (g_project.i18n_type) { case 0 : /* None */ i18n_include_input->hide(); i18n_conditional_input->hide(); @@ -262,41 +262,41 @@ void show_global_settings_cb(Fl_Widget *, void *) { } void header_input_cb(Fl_Input* i, void*) { - if (strcmp(P.header_file_name, i->value())) + if (strcmp(g_project.header_file_name, i->value())) set_modflag(1); - P.header_file_name = i->value(); + g_project.header_file_name = i->value(); } void code_input_cb(Fl_Input* i, void*) { - if (strcmp(P.code_file_name, i->value())) + if (strcmp(g_project.code_file_name, i->value())) set_modflag(1); - P.code_file_name = i->value(); + g_project.code_file_name = i->value(); } void include_H_from_C_button_cb(Fl_Check_Button* b, void*) { - if (P.include_H_from_C != b->value()) { + if (g_project.include_H_from_C != b->value()) { set_modflag(1); - P.include_H_from_C = b->value(); + g_project.include_H_from_C = b->value(); } } void use_FL_COMMAND_button_cb(Fl_Check_Button* b, void*) { - if (P.use_FL_COMMAND != b->value()) { + if (g_project.use_FL_COMMAND != b->value()) { set_modflag(1); - P.use_FL_COMMAND = b->value(); + g_project.use_FL_COMMAND = b->value(); } } void utf8_in_src_cb(Fl_Check_Button *b, void*) { - if (P.utf8_in_src != b->value()) { + if (g_project.utf8_in_src != b->value()) { set_modflag(1); - P.utf8_in_src = b->value(); + g_project.utf8_in_src = b->value(); } } void avoid_early_includes_cb(Fl_Check_Button *b, void*) { - if (P.avoid_early_includes != b->value()) { + if (g_project.avoid_early_includes != b->value()) { set_modflag(1); - P.avoid_early_includes = b->value(); + g_project.avoid_early_includes = b->value(); } } diff --git a/fluid/Shortcut_Button.cxx b/fluid/Shortcut_Button.cxx index c1fa28162..134029082 100644 --- a/fluid/Shortcut_Button.cxx +++ b/fluid/Shortcut_Button.cxx @@ -44,7 +44,7 @@ void Shortcut_Button::draw() { if (value()) draw_box(FL_DOWN_BOX, (Fl_Color)9); else draw_box(FL_UP_BOX, FL_WHITE); fl_font(FL_HELVETICA,14); fl_color(FL_FOREGROUND_COLOR); - if (P.use_FL_COMMAND && (svalue & (FL_CTRL|FL_META))) { + if (g_project.use_FL_COMMAND && (svalue & (FL_CTRL|FL_META))) { char buf[1024]; fl_snprintf(buf, 1023, "Command+%s", fl_shortcut_label(svalue&~(FL_CTRL|FL_META))); fl_draw(buf,x()+6,y(),w(),h(),FL_ALIGN_LEFT); 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 "); } - 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 \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) { diff --git a/fluid/file.cxx b/fluid/file.cxx index 9bbe0ce2a..cf457aa83 100644 --- a/fluid/file.cxx +++ b/fluid/file.cxx @@ -377,36 +377,36 @@ int write_file(const char *filename, int selected_only) { if (!open_write(filename)) return 0; write_string("# data file for the Fltk User Interface Designer (fluid)\n" "version %.4f",FL_VERSION); - if(!P.include_H_from_C) + if(!g_project.include_H_from_C) write_string("\ndo_not_include_H_from_C"); - if(P.use_FL_COMMAND) + if(g_project.use_FL_COMMAND) write_string("\nuse_FL_COMMAND"); - if (P.utf8_in_src) + if (g_project.utf8_in_src) write_string("\nutf8_in_src"); - if (P.avoid_early_includes) + if (g_project.avoid_early_includes) write_string("\navoid_early_includes"); - if (P.i18n_type) { - write_string("\ni18n_type %d", P.i18n_type); - write_string("\ni18n_include"); write_word(P.i18n_include); - write_string("\ni18n_conditional"); write_word(P.i18n_conditional); - switch (P.i18n_type) { + if (g_project.i18n_type) { + write_string("\ni18n_type %d", g_project.i18n_type); + write_string("\ni18n_include"); write_word(g_project.i18n_include); + write_string("\ni18n_conditional"); write_word(g_project.i18n_conditional); + switch (g_project.i18n_type) { case 1 : /* GNU gettext */ - write_string("\ni18n_function"); write_word(P.i18n_function); - write_string("\ni18n_static_function"); write_word(P.i18n_static_function); + write_string("\ni18n_function"); write_word(g_project.i18n_function); + write_string("\ni18n_static_function"); write_word(g_project.i18n_static_function); break; case 2 : /* POSIX catgets */ - if (P.i18n_file[0]) { + if (g_project.i18n_file[0]) { write_string("\ni18n_file"); - write_word(P.i18n_file); + write_word(g_project.i18n_file); } - write_string("\ni18n_set"); write_word(P.i18n_set); + write_string("\ni18n_set"); write_word(g_project.i18n_set); break; } } if (!selected_only) { - write_string("\nheader_name"); write_word(P.header_file_name); - write_string("\ncode_name"); write_word(P.code_file_name); + write_string("\nheader_name"); write_word(g_project.header_file_name); + write_string("\ncode_name"); write_word(g_project.code_file_name); #if 0 // https://github.com/fltk/fltk/issues/328 @@ -495,62 +495,62 @@ static void read_children(Fl_Type *p, int paste, Strategy strategy, char skip_op } if (!strcmp(c,"do_not_include_H_from_C")) { - P.include_H_from_C=0; + g_project.include_H_from_C=0; goto CONTINUE; } if (!strcmp(c,"use_FL_COMMAND")) { - P.use_FL_COMMAND=1; + g_project.use_FL_COMMAND=1; goto CONTINUE; } if (!strcmp(c,"utf8_in_src")) { - P.utf8_in_src=1; + g_project.utf8_in_src=1; goto CONTINUE; } if (!strcmp(c,"avoid_early_includes")) { - P.avoid_early_includes=1; + g_project.avoid_early_includes=1; goto CONTINUE; } if (!strcmp(c,"i18n_type")) { - P.i18n_type = atoi(read_word()); + g_project.i18n_type = atoi(read_word()); goto CONTINUE; } if (!strcmp(c,"i18n_function")) { - P.i18n_function = read_word(); + g_project.i18n_function = read_word(); goto CONTINUE; } if (!strcmp(c,"i18n_static_function")) { - P.i18n_static_function = read_word(); + g_project.i18n_static_function = read_word(); goto CONTINUE; } if (!strcmp(c,"i18n_file")) { - P.i18n_file = read_word(); + g_project.i18n_file = read_word(); goto CONTINUE; } if (!strcmp(c,"i18n_set")) { - P.i18n_set = read_word(); + g_project.i18n_set = read_word(); goto CONTINUE; } if (!strcmp(c,"i18n_include")) { - P.i18n_include = read_word(); + g_project.i18n_include = read_word(); goto CONTINUE; } if (!strcmp(c,"i18n_conditional")) { - P.i18n_conditional = read_word(); + g_project.i18n_conditional = read_word(); goto CONTINUE; } if (!strcmp(c,"i18n_type")) { - P.i18n_type = atoi(read_word()); + g_project.i18n_type = atoi(read_word()); goto CONTINUE; } if (!strcmp(c,"header_name")) { - if (!P.header_file_set) P.header_file_name = read_word(); + if (!g_project.header_file_set) g_project.header_file_name = read_word(); else read_word(); goto CONTINUE; } if (!strcmp(c,"code_name")) { - if (!P.code_file_set) P.code_file_name = read_word(); + if (!g_project.code_file_set) g_project.code_file_name = read_word(); else read_word(); goto CONTINUE; } @@ -649,7 +649,7 @@ int read_file(const char *filename, int merge, Strategy strategy) { if (merge) deselect(); else - P.reset(); + g_project.reset(); read_children(Fl_Type::current, merge, strategy); Fl_Type::current = 0; // Force menu items to be rebuilt... diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index 38a74dec1..62c3e9636 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -167,28 +167,28 @@ int batch_mode = 0; // if set (-c, -u) don't open display Fd_String g_code_filename_arg; Fd_String g_header_filename_arg; -/** \var int Project::header_file_set +/** \var int Fluid_Project::header_file_set If set, commandline overrides header file name in .fl file. */ -/** \var int Project::code_file_set +/** \var int Fluid_Project::code_file_set If set, commandline overrides source code file name in .fl file. */ -/** \var int Project::header_file_name +/** \var int Fluid_Project::header_file_name Hold the default extension for header files, or the entire filename if set via command line. */ -/** \var int Project::code_file_name +/** \var int Fluid_Project::code_file_name Hold the default extension for source code files, or the entire filename if set via command line. */ -/** \var int Project::i18n_type +/** \var int Fluid_Project::i18n_type Saved in the .fl design file. \todo document me */ -/** \var int Project::i18n_include +/** \var int Fluid_Project::i18n_include For either type of translation, write a #include statement into the source file. @@ -202,12 +202,12 @@ Fd_String g_header_filename_arg; Saved in the .fl design file. */ -/** \var int Project::i18n_conditional +/** \var int Fluid_Project::i18n_conditional Saved in the .fl design file. \todo document me */ -/** \var int Project::i18n_function +/** \var int Fluid_Project::i18n_function For the gettext/intl.h options, this is the function that translates text at runtime. @@ -216,7 +216,7 @@ Fd_String g_header_filename_arg; Saved in the .fl design file. */ -/** \var int Project::i18n_static_function +/** \var int Fluid_Project::i18n_static_function For the gettext/intl.h options, this is the function that marks the translation of text at initialisation time. @@ -228,17 +228,17 @@ Fd_String g_header_filename_arg; Saved in the .fl design file. */ -/** \var int Project::i18n_file +/** \var int Fluid_Project::i18n_file Saved in the .fl design file. \todo document me */ -/** \var int Project::i18n_set +/** \var int Fluid_Project::i18n_set Saved in the .fl design file. \todo document me */ -/** \var int Project::i18n_program +/** \var int Fluid_Project::i18n_program \todo document me */ @@ -250,9 +250,9 @@ static int ipasteoffset = 0; // ---- project settings -Project P; +Fluid_Project g_project; -Project::Project() : +Fluid_Project::Fluid_Project() : i18n_type(0), include_H_from_C(1), use_FL_COMMAND(0), @@ -264,10 +264,10 @@ Project::Project() : code_file_name(".cxx") { } -Project::~Project() { +Fluid_Project::~Fluid_Project() { } -void Project::reset() { +void Fluid_Project::reset() { ::delete_all(); i18n_type = 0; i18n_include = ""; @@ -698,7 +698,7 @@ void exit_cb(Fl_Widget *,void *) { // Destroy tree // Doing so causes dtors to automatically close all external editors // and cleans up editor tmp files. Then remove fluid tmpdir /last/. - P.reset(); + g_project.reset(); ExternalCodeEditor::tmpdir_clear(); exit(0); @@ -865,7 +865,7 @@ void new_cb(Fl_Widget *, void *v) { } // Clear the current data... - P.reset(); + g_project.reset(); set_filename(NULL); set_modflag(0, 0); widget_browser->rebuild(); @@ -997,20 +997,20 @@ int write_code_files() { } char cname[FL_PATH_MAX+1]; char hname[FL_PATH_MAX+1]; - P.i18n_program = fl_filename_name(filename); - P.i18n_program.capacity(FL_PATH_MAX); - fl_filename_setext(P.i18n_program.buffer(), FL_PATH_MAX, ""); - if (P.code_file_name[0] == '.' && strchr(P.code_file_name, '/') == NULL) { + g_project.i18n_program = fl_filename_name(filename); + g_project.i18n_program.capacity(FL_PATH_MAX); + fl_filename_setext(g_project.i18n_program.buffer(), FL_PATH_MAX, ""); + if (g_project.code_file_name[0] == '.' && strchr(g_project.code_file_name, '/') == NULL) { strlcpy(cname, fl_filename_name(filename), FL_PATH_MAX); - fl_filename_setext(cname, FL_PATH_MAX, P.code_file_name); + fl_filename_setext(cname, FL_PATH_MAX, g_project.code_file_name); } else { - strlcpy(cname, P.code_file_name, FL_PATH_MAX); + strlcpy(cname, g_project.code_file_name, FL_PATH_MAX); } - if (P.header_file_name[0] == '.' && strchr(P.header_file_name, '/') == NULL) { + if (g_project.header_file_name[0] == '.' && strchr(g_project.header_file_name, '/') == NULL) { strlcpy(hname, fl_filename_name(filename), FL_PATH_MAX); - fl_filename_setext(hname, FL_PATH_MAX, P.header_file_name); + fl_filename_setext(hname, FL_PATH_MAX, g_project.header_file_name); } else { - strlcpy(hname, P.header_file_name, FL_PATH_MAX); + strlcpy(hname, g_project.header_file_name, FL_PATH_MAX); } if (!batch_mode) enter_project_dir(); int x = write_code(cname,hname); @@ -1051,7 +1051,7 @@ void write_strings_cb(Fl_Widget *, void *) { } char sname[FL_PATH_MAX]; strlcpy(sname, fl_filename_name(filename), sizeof(sname)); - fl_filename_setext(sname, sizeof(sname), exts[P.i18n_type]); + fl_filename_setext(sname, sizeof(sname), exts[g_project.i18n_type]); if (!batch_mode) enter_project_dir(); int x = write_strings(sname); if (!batch_mode) leave_project_dir(); @@ -1757,7 +1757,7 @@ void set_modflag(int mf, int mfc) { #endif // _WIN32 else basename = filename; - code_ext = fl_filename_ext(P.code_file_name); + code_ext = fl_filename_ext(g_project.code_file_name); char mod_star = modflag ? '*' : ' '; char mod_c_star = modflag_c ? '*' : ' '; snprintf(title, sizeof(title), "%s%c %s%c", @@ -1872,19 +1872,19 @@ void update_sourceview_cb(Fl_Button*, void*) static const char *exts[] = { ".txt", ".po", ".msg" }; char fn[FL_PATH_MAX]; fluid_prefs.getUserdataPath(fn, FL_PATH_MAX); - fl_filename_setext(fn, FL_PATH_MAX, exts[P.i18n_type]); + fl_filename_setext(fn, FL_PATH_MAX, exts[g_project.i18n_type]); write_strings(fn); int top = sv_strings->top_line(); sv_strings->buffer()->loadfile(fn); sv_strings->scroll(top, 0); } else if (sv_source->visible_r() || sv_header->visible_r()) { - P.i18n_program = fl_filename_name(sv_source_filename); - P.i18n_program.capacity(FL_PATH_MAX); - fl_filename_setext(P.i18n_program.buffer(), FL_PATH_MAX, ""); - Fd_String code_file_name_bak = P.code_file_name; - P.code_file_name = sv_source_filename; - Fd_String header_file_name_bak = P.header_file_name; - P.header_file_name = sv_header_filename; + g_project.i18n_program = fl_filename_name(sv_source_filename); + g_project.i18n_program.capacity(FL_PATH_MAX); + fl_filename_setext(g_project.i18n_program.buffer(), FL_PATH_MAX, ""); + Fd_String code_file_name_bak = g_project.code_file_name; + g_project.code_file_name = sv_source_filename; + Fd_String header_file_name_bak = g_project.header_file_name; + g_project.header_file_name = sv_header_filename; // generate the code and load the files write_sourceview = 1; @@ -1904,8 +1904,8 @@ void update_sourceview_cb(Fl_Button*, void*) } write_sourceview = 0; - P.code_file_name = code_file_name_bak; - P.header_file_name = header_file_name_bak; + g_project.code_file_name = code_file_name_bak; + g_project.header_file_name = header_file_name_bak; } } @@ -2059,12 +2059,12 @@ int main(int argc,char **argv) { // command line args override code and header filenams from the project file if (!g_code_filename_arg.empty()) { - P.code_file_set = 1; - P.code_file_name = g_code_filename_arg; + g_project.code_file_set = 1; + g_project.code_file_name = g_code_filename_arg; } if (!g_header_filename_arg.empty()) { - P.header_file_set = 1; - P.header_file_name = g_header_filename_arg; + g_project.header_file_set = 1; + g_project.header_file_name = g_header_filename_arg; } if (update_file) { // fluid -u diff --git a/fluid/fluid.h b/fluid/fluid.h index 52ba75ba2..c7b800849 100644 --- a/fluid/fluid.h +++ b/fluid/fluid.h @@ -92,10 +92,10 @@ public: // ---- project settings -class Project { +class Fluid_Project { public: - Project(); - ~Project(); + Fluid_Project(); + ~Fluid_Project(); void reset(); int i18n_type; @@ -116,7 +116,7 @@ public: Fd_String code_file_name; }; -extern Project P; +extern Fluid_Project g_project; extern Fd_String g_code_filename_arg; extern Fd_String g_header_filename_arg; diff --git a/fluid/shell_command.h b/fluid/shell_command.h index 8a1f4e2a2..530b34310 100644 --- a/fluid/shell_command.h +++ b/fluid/shell_command.h @@ -70,7 +70,7 @@ public: int get_fileno() const; -#if defined(_WIN32) && !defined(__CYGWIN__) +#if defined(_WIN32) && !defined(__CYGWIN__) protected: HANDLE pin[2], pout[2], perr[2]; char ptmode; diff --git a/fluid/widget_panel.cxx b/fluid/widget_panel.cxx index 4464f417d..1c8c97696 100644 --- a/fluid/widget_panel.cxx +++ b/fluid/widget_panel.cxx @@ -178,12 +178,6 @@ Fl_Double_Window* make_widget_panel() { o->labelsize(11); o->callback((Fl_Callback*)image_browse_cb); } // Fl_Button* o - { Fl_Button* o = new Fl_Button(384, 65, 20, 20); - o->tooltip("bind the image to the widget, so it will be deleted automatically"); - o->type(1); - o->callback((Fl_Callback*)bind_image_cb); - o->image(bind_pixmap); - } // Fl_Button* o { Fl_Button* o = new Fl_Button(364, 65, 20, 20); o->tooltip("store image uncompressed as RGBA data\nor compressed in the original file for\ mat"); @@ -191,6 +185,12 @@ mat"); o->callback((Fl_Callback*)compress_image_cb); o->image(compressed_pixmap); } // Fl_Button* o + { Fl_Button* o = new Fl_Button(384, 65, 20, 20); + o->tooltip("bind the image to the widget, so it will be deleted automatically"); + o->type(1); + o->callback((Fl_Callback*)bind_image_cb); + o->image(bind_pixmap); + } // Fl_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(95, 90, 309, 20, "Inactive:"); @@ -211,12 +211,6 @@ mat"); o->labelsize(11); o->callback((Fl_Callback*)inactive_browse_cb); } // Fl_Button* o - { Fl_Button* o = new Fl_Button(384, 90, 20, 20); - o->tooltip("bind the image to the widget, so it will be deleted automatically"); - o->type(1); - o->callback((Fl_Callback*)bind_deimage_cb); - o->image(bind_pixmap); - } // Fl_Button* o { Fl_Button* o = new Fl_Button(364, 90, 20, 20); o->tooltip("store image uncompressed as RGBA data\nor compressed in the original file for\ mat"); @@ -224,6 +218,12 @@ mat"); o->callback((Fl_Callback*)compress_deimage_cb); o->image(compressed_pixmap); } // Fl_Button* o + { Fl_Button* o = new Fl_Button(384, 90, 20, 20); + o->tooltip("bind the image to the widget, so it will be deleted automatically"); + o->type(1); + o->callback((Fl_Callback*)bind_deimage_cb); + o->image(bind_pixmap); + } // Fl_Button* o o->end(); } // Fl_Group* o { Fl_Group* o = new Fl_Group(95, 115, 310, 20, "Alignment:"); diff --git a/fluid/widget_panel.fl b/fluid/widget_panel.fl index 2673aed86..e36e73afe 100644 --- a/fluid/widget_panel.fl +++ b/fluid/widget_panel.fl @@ -74,12 +74,6 @@ Use Ctrl-J for newlines.} xywh {95 40 190 20} labelfont 1 labelsize 11 when 15 t callback image_browse_cb tooltip {Click to choose the active image.} xywh {294 65 70 20} labelsize 11 } - Fl_Button {} { - callback bind_image_cb - tooltip {bind the image to the widget, so it will be deleted automatically} xywh {384 65 20 20} type Toggle - code0 {o->image(bind_pixmap);} - code3 {\#include "pixmaps.h"} - } Fl_Button {} { callback compress_image_cb tooltip {store image uncompressed as RGBA data @@ -87,6 +81,12 @@ or compressed in the original file format} xywh {364 65 20 20} type Toggle code0 {o->image(compressed_pixmap);} code3 {\#include "pixmaps.h"} } + Fl_Button {} { + callback bind_image_cb + tooltip {bind the image to the widget, so it will be deleted automatically} xywh {384 65 20 20} type Toggle + code0 {o->image(bind_pixmap);} + code3 {\#include "pixmaps.h"} + } } Fl_Group {} { label {Inactive:} @@ -102,12 +102,6 @@ or compressed in the original file format} xywh {364 65 20 20} type Toggle callback inactive_browse_cb tooltip {Click to choose the inactive image.} xywh {294 90 70 20} labelsize 11 } - Fl_Button {} { - callback bind_deimage_cb - tooltip {bind the image to the widget, so it will be deleted automatically} xywh {384 90 20 20} type Toggle - code0 {o->image(bind_pixmap);} - code3 {\#include "pixmaps.h"} - } Fl_Button {} { callback compress_deimage_cb tooltip {store image uncompressed as RGBA data @@ -115,6 +109,12 @@ or compressed in the original file format} xywh {364 90 20 20} type Toggle code0 {o->image(compressed_pixmap);} code3 {\#include "pixmaps.h"} } + Fl_Button {} { + callback bind_deimage_cb selected + tooltip {bind the image to the widget, so it will be deleted automatically} xywh {384 90 20 20} type Toggle + code0 {o->image(bind_pixmap);} + code3 {\#include "pixmaps.h"} + } } Fl_Group {} { label {Alignment:} @@ -812,7 +812,7 @@ wCallback->do_callback(wCallback, v);} open } Fl_Button wLiveMode { label {Live &Resize} - callback live_mode_cb selected + callback live_mode_cb tooltip {Create a live duplicate of the selected widgets to test resizing and menu behavior.} xywh {155 370 80 20} type Toggle labelsize 11 } Fl_Button {} { diff --git a/fluid/widget_panel.h b/fluid/widget_panel.h index 630e5fd60..6d6ddfe95 100644 --- a/fluid/widget_panel.h +++ b/fluid/widget_panel.h @@ -33,12 +33,12 @@ extern void image_cb(Fl_Input*, void*); #include extern void image_browse_cb(Fl_Button*, void*); #include "pixmaps.h" -extern void bind_image_cb(Fl_Button*, void*); extern void compress_image_cb(Fl_Button*, void*); +extern void bind_image_cb(Fl_Button*, void*); extern void inactive_cb(Fl_Input*, void*); extern void inactive_browse_cb(Fl_Button*, void*); -extern void bind_deimage_cb(Fl_Button*, void*); extern void compress_deimage_cb(Fl_Button*, void*); +extern void bind_deimage_cb(Fl_Button*, void*); extern void align_cb(Fl_Button*, void*); extern void align_text_image_cb(Fl_Choice*, void*); extern void align_position_cb(Fl_Choice*, void*); diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx index 95a467a3a..a0d3e00cc 100644 --- a/src/Fl_BMP_Image.cxx +++ b/src/Fl_BMP_Image.cxx @@ -274,7 +274,7 @@ void Fl_BMP_Image::load_bmp_(Fl_Image_Reader &rdr, int ico_height, int ico_width bDepth = 4; // Setup image and buffers... - if (offbits) rdr.seek(offbits); + if (offbits) rdr.seek((unsigned int)offbits); CHECK_ERROR if (((size_t)width) * height * bDepth > max_size() ) { diff --git a/src/Fl_Browser.cxx b/src/Fl_Browser.cxx index 4534729bc..80d6af811 100644 --- a/src/Fl_Browser.cxx +++ b/src/Fl_Browser.cxx @@ -387,7 +387,7 @@ int Fl_Browser::item_height(void *item) const { case 'B': case 'C': while (isdigit(*str & 255)) str++; break; // skip a color number case 'F': font = (Fl_Font)strtol(str,&str,10); break; - case 'S': tsize = strtol(str,&str,10); break; + case 'S': tsize = (int)strtol(str,&str,10); break; case '.': goto END_FORMAT; } } @@ -450,7 +450,7 @@ int Fl_Browser::item_width(void *item) const { case 'B': case 'C': while (isdigit(*str & 255)) str++; break; // skip a color number case 'F': font = (Fl_Font)strtol(str, &str, 10); break; - case 'S': tsize = strtol(str, &str, 10); break; + case 'S': tsize = (int)strtol(str, &str, 10); break; case '.': done = 1; break; @@ -556,7 +556,7 @@ void Fl_Browser::item_draw(void* item, int X, int Y, int W, int H) const { lcol = FL_INACTIVE_COLOR; break; case 'S': - tsize = strtol(str, &str, 10); + tsize = (int)strtol(str, &str, 10); break; case '-': fl_color(FL_DARK3); diff --git a/src/Fl_File_Icon2.cxx b/src/Fl_File_Icon2.cxx index 5b6334771..f81fa8af0 100644 --- a/src/Fl_File_Icon2.cxx +++ b/src/Fl_File_Icon2.cxx @@ -455,15 +455,15 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from case 3 : val[0] = lineptr[0]; val[1] = '\0'; - red = 255 * strtol(val, NULL, 16) / 15; + red = 255 * (int)strtol(val, NULL, 16) / 15; val[0] = lineptr[1]; val[1] = '\0'; - green = 255 * strtol(val, NULL, 16) / 15; + green = 255 * (int)strtol(val, NULL, 16) / 15; val[0] = lineptr[2]; val[1] = '\0'; - blue = 255 * strtol(val, NULL, 16) / 15; + blue = 255 * (int)strtol(val, NULL, 16) / 15; break; case 6 : @@ -474,17 +474,17 @@ int Fl_File_Icon::load_image(const char *ifile) // I - File to read from val[0] = lineptr[0]; val[1] = lineptr[1]; val[2] = '\0'; - red = strtol(val, NULL, 16); + red = (int)strtol(val, NULL, 16); val[0] = lineptr[j + 0]; val[1] = lineptr[j + 1]; val[2] = '\0'; - green = strtol(val, NULL, 16); + green = (int)strtol(val, NULL, 16); val[0] = lineptr[2 * j + 0]; val[1] = lineptr[2 * j + 1]; val[2] = '\0'; - blue = strtol(val, NULL, 16); + blue = (int)strtol(val, NULL, 16); break; } diff --git a/src/Fl_Help_View.cxx b/src/Fl_Help_View.cxx index 68b92690d..67ce82a36 100644 --- a/src/Fl_Help_View.cxx +++ b/src/Fl_Help_View.cxx @@ -1557,7 +1557,7 @@ void Fl_Help_View::format() { if (get_attr(attrs, "START", attr, sizeof(attr)) != NULL) { errno = 0; char *endptr = 0; - ol_num = strtol(attr, &endptr, 10); + ol_num = (int)strtol(attr, &endptr, 10); if (errno || endptr == attr || ol_num < 0) ol_num = 1; } @@ -2765,7 +2765,7 @@ Fl_Help_View::get_color(const char *n, // I - Color name if (n[0] == '#') { // Do hex color lookup - rgb = strtol(n + 1, NULL, 16); + rgb = (int)strtol(n + 1, NULL, 16); if (strlen(n) > 4) { r = rgb >> 16; @@ -3757,7 +3757,7 @@ quote_char(const char *p) { // I - Quoted string if (!strchr(p, ';')) return -1; if (*p == '#') { - if (*(p+1) == 'x' || *(p+1) == 'X') return strtol(p+2, NULL, 16); + if (*(p+1) == 'x' || *(p+1) == 'X') return (int)strtol(p+2, NULL, 16); else return atoi(p+1); } for (i = (int)(sizeof(names) / sizeof(names[0])), nameptr = names; i > 0; i --, nameptr ++) diff --git a/src/Fl_Image_Reader.h b/src/Fl_Image_Reader.h index ef327922a..4a20d6602 100644 --- a/src/Fl_Image_Reader.h +++ b/src/Fl_Image_Reader.h @@ -81,7 +81,7 @@ public: const char *name() const { return name_; } // skip a given number of bytes - void skip(unsigned int n) { seek(tell() + n); } + void skip(unsigned int n) { seek((unsigned int)tell() + n); } private: // open() sets this if we read from a file diff --git a/src/Fl_MacOS_Sys_Menu_Bar.mm b/src/Fl_MacOS_Sys_Menu_Bar.mm index 939a3a3d4..6fdebdaef 100644 --- a/src/Fl_MacOS_Sys_Menu_Bar.mm +++ b/src/Fl_MacOS_Sys_Menu_Bar.mm @@ -120,14 +120,14 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@"; NSMenu* this_menu = [self menu]; NSInteger flRank = [this_menu indexOfItem:self]; NSInteger last = [this_menu numberOfItems] - 1; - int from = flRank; + int from = (int)flRank; while(from > 0) { if ([[this_menu itemAtIndex:from-1] isSeparatorItem]) break; item = [(FLMenuItem*)[this_menu itemAtIndex:from-1] getFlItem]; if ( !(item->flags & FL_MENU_RADIO) ) break; from--; } - int to = flRank; + int to = (int)flRank; while (to < last) { if ([[this_menu itemAtIndex:to+1] isSeparatorItem]) break; item = [(FLMenuItem*)[this_menu itemAtIndex:to+1] getFlItem]; @@ -228,7 +228,7 @@ const char *Fl_Mac_App_Menu::quit = "Quit %@"; } [menu addItem:item]; [item setTarget:item]; - int retval = [menu indexOfItem:item]; + int retval = (int)[menu indexOfItem:item]; [item release]; return retval; } @@ -355,7 +355,7 @@ static void createSubMenu( NSMenu *mh, pFl_Menu_Item &mm, const Fl_Menu_Item *m [submenu setAutoenablesItems:NO]; int cnt; - cnt = [mh numberOfItems]; + cnt = (int)[mh numberOfItems]; cnt--; menuItem = [mh itemAtIndex:cnt]; [menuItem setSubmenu:submenu]; @@ -401,7 +401,7 @@ static void convertToMenuBar(const Fl_Menu_Item *mm) { NSMenu *fl_system_menu = [NSApp mainMenu]; int count;//first, delete all existing system menus - count = [fl_system_menu numberOfItems]; + count = (int)[fl_system_menu numberOfItems]; for(int i = count - 1; i > 0; i--) { [fl_system_menu removeItem:[fl_system_menu itemAtIndex:i]]; } diff --git a/src/Fl_Native_File_Chooser_MAC.mm b/src/Fl_Native_File_Chooser_MAC.mm index df4808cb2..fbf97abed 100644 --- a/src/Fl_Native_File_Chooser_MAC.mm +++ b/src/Fl_Native_File_Chooser_MAC.mm @@ -434,7 +434,7 @@ static char *prepareMacFilter(int count, const char *filter, char **patterns) { l += strlen(patterns[i]) + 3; } const char *p = filter; - const int t_size = strlen(p) + l + 1; + const int t_size = (int)strlen(p) + l + 1; char *q; q = new char[t_size]; const char *r, *s; char *t; diff --git a/src/Fl_PNM_Image.cxx b/src/Fl_PNM_Image.cxx index 9d2945bc7..7b1b3c54a 100644 --- a/src/Fl_PNM_Image.cxx +++ b/src/Fl_PNM_Image.cxx @@ -100,7 +100,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read if (*lineptr == '\0' || *lineptr == '#') { lineptr = fgets(line, sizeof(line), fp); } else if (isdigit(*lineptr)) { - w(strtol(lineptr, &lineptr, 10)); + w((int)strtol(lineptr, &lineptr, 10)); } else lineptr ++; } @@ -108,7 +108,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read if (*lineptr == '\0' || *lineptr == '#') { lineptr = fgets(line, sizeof(line), fp); } else if (isdigit(*lineptr)) { - h(strtol(lineptr, &lineptr, 10)); + h((int)strtol(lineptr, &lineptr, 10)); } else lineptr ++; } @@ -119,7 +119,7 @@ Fl_PNM_Image::Fl_PNM_Image(const char *filename) // I - File to read if (*lineptr == '\0' || *lineptr == '#') { lineptr = fgets(line, sizeof(line), fp); } else if (isdigit(*lineptr)) { - maxval = strtol(lineptr, &lineptr, 10); + maxval = (int)strtol(lineptr, &lineptr, 10); } else lineptr ++; } } else maxval = 1; diff --git a/src/Fl_Table.cxx b/src/Fl_Table.cxx index baf06249e..91ebe262e 100644 --- a/src/Fl_Table.cxx +++ b/src/Fl_Table.cxx @@ -394,8 +394,8 @@ int Fl_Table::find_cell(TableContext context, int R, int C, int &X, int &Y, int X=Y=W=H=0; return(-1); } - X = col_scroll_position(C) - hscrollbar->value() + tix; - Y = row_scroll_position(R) - vscrollbar->value() + tiy; + X = (int)col_scroll_position(C) - hscrollbar->value() + tix; + Y = (int)row_scroll_position(R) - vscrollbar->value() + tiy; W = col_width(C); H = row_height(R); @@ -580,8 +580,8 @@ void Fl_Table::table_scrolled() { Calls recall_dimensions(), and recalculates scrollbar sizes. */ void Fl_Table::table_resized() { - table_h = row_scroll_position(rows()); - table_w = col_scroll_position(cols()); + table_h = (int)row_scroll_position(rows()); + table_w = (int)col_scroll_position(cols()); recalc_dimensions(); // Recalc scrollbar sizes // Clamp scrollbar value() after a resize. diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm index 81178d2f0..f0163b9d4 100644 --- a/src/Fl_cocoa.mm +++ b/src/Fl_cocoa.mm @@ -145,7 +145,7 @@ static unsigned short* macKeyLookUp = NULL; */ static unsigned int mods_to_e_state( NSUInteger mods ) { - long state = 0; + unsigned int state = 0; if ( mods & NSCommandKeyMask ) state |= FL_META; if ( mods & NSAlternateKeyMask ) state |= FL_ALT; if ( mods & NSControlKeyMask ) state |= FL_CTRL; @@ -1179,8 +1179,8 @@ static void CocoatoFLTK(Fl_Window *win, int &x, int &y) { FLWindow *nsw = fl_xid(win); ori = [nsw convertBaseToScreen:NSMakePoint(0, [[nsw contentView] frame].size.height)]; float s = Fl::screen_driver()->scale(0); - x = lround(ori.x / s); - y = lround((main_screen_height - ori.y) / s); + x = (int)lround(ori.x / s); + y = (int)lround((main_screen_height - ori.y) / s); while (win->parent()) {win = win->window(); x -= win->x(); y -= win->y();} } @@ -1262,12 +1262,12 @@ static FLWindowDelegate *flwindowdelegate_instance = nil; plugin = (Fl_Cocoa_Plugin*)pm.plugin("gl.cocoa.fltk.org"); } // calls Fl_Gl_Window::resize() without including Fl_Gl_Window.H - plugin->resize(window->as_gl_window(), X, Y, lround(r.size.width/s), lround(r.size.height/s)); + plugin->resize(window->as_gl_window(), X, Y, (int)lround(r.size.width/s), (int)lround(r.size.height/s)); } else { - Fl_Cocoa_Window_Driver::driver(window)->resize(X, Y, lround(r.size.width/s), lround(r.size.height/s)); + Fl_Cocoa_Window_Driver::driver(window)->resize(X, Y, (int)lround(r.size.width/s), (int)lround(r.size.height/s)); } } else - window->resize(X, Y, lround(r.size.width/s), lround(r.size.height/s)); + window->resize(X, Y, (int)lround(r.size.width/s), (int)lround(r.size.height/s)); Fl_Cocoa_Window_Driver::driver(window)->view_resized(0); update_e_xy_and_e_xy_root(nsw); #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_14 @@ -2031,7 +2031,7 @@ Fl_Window *fl_dnd_target_window = 0; static void q_set_window_title(NSWindow *nsw, const char * name, const char *mininame) { CFStringRef title = CFStringCreateWithCString(NULL, (name ? name : ""), kCFStringEncodingUTF8); if(!title) { // fallback when name contains malformed UTF-8 - int l = strlen(name); + int l = (int)strlen(name); unsigned short* utf16 = new unsigned short[l + 1]; l = fl_utf8toUtf16(name, l, utf16, l + 1); title = CFStringCreateWithCharacters(NULL, utf16, l); @@ -2471,10 +2471,10 @@ static FLTextInputContext* fltextinputcontext_instance = nil; - (void)flagsChanged:(NSEvent *)theEvent { //NSLog(@"flagsChanged: "); fl_lock_function(); - static UInt32 prevMods = 0; - NSUInteger mods = [theEvent modifierFlags]; + static NSEventModifierFlags prevMods = 0; + NSEventModifierFlags mods = [theEvent modifierFlags]; Fl_Window *window = (Fl_Window*)[(FLWindow*)[theEvent window] getFl_Window]; - UInt32 tMods = prevMods ^ mods; + NSEventModifierFlags tMods = prevMods ^ mods; int sendEvent = 0; if ( tMods ) { @@ -2537,7 +2537,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; if ( [[pboard types] containsObject:NSFilenamesPboardType] ) { CFArrayRef files = (CFArrayRef)[pboard propertyListForType:NSFilenamesPboardType]; CFStringRef all = CFStringCreateByCombiningStrings(NULL, files, CFSTR("\n")); - int l = CFStringGetMaximumSizeForEncoding(CFStringGetLength(all), kCFStringEncodingUTF8); + int l = (int)CFStringGetMaximumSizeForEncoding(CFStringGetLength(all), kCFStringEncodingUTF8); DragData = (char *)malloc(l + 1); CFStringGetCString(all, DragData, l + 1, kCFStringEncodingUTF8); CFRelease(all); @@ -2555,7 +2555,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; return NO; } Fl::e_text = DragData; - Fl::e_length = strlen(DragData); + Fl::e_length = (int)strlen(DragData); int old_event = Fl::e_number; Fl::belowmouse()->handle(Fl::e_number = FL_PASTE); Fl::e_number = old_event; @@ -2586,7 +2586,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; static char *received_utf8 = NULL; static int lreceived = 0; char *p = (char*)[aString UTF8String]; - int l = strlen(p); + int l = (int)strlen(p); if (l > 0) { if (lreceived == 0) { received_utf8 = (char*)malloc(l + 1); @@ -2704,7 +2704,7 @@ static FLTextInputContext* fltextinputcontext_instance = nil; } if (in_key_event && Fl::e_length) [FLView concatEtext:received]; else [FLView prepareEtext:received]; - Fl_Cocoa_Screen_Driver::next_marked_length = strlen([received UTF8String]); + Fl_Cocoa_Screen_Driver::next_marked_length = (int)strlen([received UTF8String]); if (!in_key_event) Fl::handle( FL_KEYBOARD, target); else need_handle = YES; selectedRange = NSMakeRange(100, newSelection.length); @@ -3539,7 +3539,7 @@ static int get_plain_text_from_clipboard(int clipboard) len = strlen(aux_c) + 1; } else len = [data length] + 1; - resize_selection_buffer(len, clipboard); + resize_selection_buffer((int)len, clipboard); if (![found isEqualToString:UTF8_pasteboard_type]) { strcpy(fl_selection_buffer[clipboard], aux_c); free(aux_c); @@ -3552,7 +3552,7 @@ static int get_plain_text_from_clipboard(int clipboard) Fl::e_clipboard_type = Fl::clipboard_plain_text; } } - return length; + return (int)length; } static Fl_RGB_Image* get_image_from_clipboard(Fl_Widget *receiver) @@ -3581,10 +3581,10 @@ static Fl_RGB_Image* get_image_from_clipboard(Fl_Widget *receiver) bitmap = pdf_to_nsbitmapimagerep(data); } if (!bitmap) return NULL; - int bytesPerPixel([bitmap bitsPerPixel]/8); - int bpr([bitmap bytesPerRow]); - int hh([bitmap pixelsHigh]); - int ww([bitmap pixelsWide]); + int bytesPerPixel((int)[bitmap bitsPerPixel]/8); + int bpr((int)[bitmap bytesPerRow]); + int hh((int)[bitmap pixelsHigh]); + int ww((int)[bitmap pixelsWide]); uchar *imagedata = new uchar[bpr * hh]; memcpy(imagedata, [bitmap bitmapData], bpr * hh); Fl_RGB_Image *image = new Fl_RGB_Image(imagedata, ww, hh, bytesPerPixel, (bpr == ww * bytesPerPixel ? 0 : bpr) ); @@ -3966,13 +3966,13 @@ void Fl_Cocoa_Window_Driver::set_key_window() static NSImage *imageFromText(const char *text, int *pwidth, int *pheight) { const char *p, *q; - int width = 0, height, w2, ltext = strlen(text); + int width = 0, height, w2, ltext = (int)strlen(text); fl_font(FL_HELVETICA, 10); p = text; int nl = 0; while(nl < 100 && (q=strchr(p, '\n')) != NULL) { nl++; - w2 = int(fl_width(p, q - p)); + w2 = (int)fl_width(p, (int)(q - p)); if (w2 > width) width = w2; p = q + 1; } @@ -3994,7 +3994,7 @@ static NSImage *imageFromText(const char *text, int *pwidth, int *pheight) while(TRUE) { q = strchr(p, '\n'); if (q) { - fl_draw(p, q - p, 3, y); + fl_draw(p, (int)(q - p), 3, y); } else { fl_draw(p, 3, y); break; @@ -4101,8 +4101,8 @@ int Fl_Cocoa_Screen_Driver::dnd(int use_selection) // rescales an NSBitmapImageRep (and also rewrites it with integer pixels) static NSBitmapImageRep *scale_nsbitmapimagerep(NSBitmapImageRep *img, float scale) { - int w = [img pixelsWide]; - int h = [img pixelsHigh]; + int w = (int)[img pixelsWide]; + int h = (int)[img pixelsHigh]; long int scaled_w = lround(scale * w); long int scaled_h = lround(scale * h); NSBitmapImageRep *scaled = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL @@ -4153,8 +4153,9 @@ static void write_bitmap_inside(NSBitmapImageRep *to, int to_width, NSBitmapImag #endif int to_w = (int)[to pixelsWide]; // pixel width of "to" int from_w = (int)[from pixelsWide]; // pixel width of "from" - int from_h = [from pixelsHigh]; // pixel height of "from" - int to_depth = [to samplesPerPixel], from_depth = [from samplesPerPixel]; + int from_h = (int)[from pixelsHigh]; // pixel height of "from" + int to_depth = (int)[to samplesPerPixel]; + int from_depth = (int)[from samplesPerPixel]; int depth = 0; if (to_depth > from_depth) depth = from_depth; else if (from_depth > to_depth) depth = to_depth; @@ -4397,14 +4398,14 @@ void Fl_Cocoa_Window_Driver::draw_titlebar_to_context(CGContextRef gc, int w, in */ int Fl_Darwin_System_Driver::calc_mac_os_version() { if (fl_mac_os_version) return fl_mac_os_version; - int M, m, b = 0; + int M = 0, m = 0, b = 0; NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init]; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10 if ([NSProcessInfo instancesRespondToSelector:@selector(operatingSystemVersion)]) { NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion]; - M = version.majorVersion; - m = version.minorVersion; - b = version.patchVersion; + M = (int)version.majorVersion; + m = (int)version.minorVersion; + b = (int)version.patchVersion; } else #endif diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx index 94e0f0104..e2ccbe969 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx @@ -355,8 +355,8 @@ int Fl_Cocoa_Screen_Driver::input_widget_handle_key(int key, unsigned mods, unsi void Fl_Cocoa_Screen_Driver::offscreen_size(Fl_Offscreen off, int &width, int &height) { - width = CGBitmapContextGetWidth((CGContextRef)off); - height = CGBitmapContextGetHeight((CGContextRef)off); + width = (int)CGBitmapContextGetWidth((CGContextRef)off); + height = (int)CGBitmapContextGetHeight((CGContextRef)off); } Fl_RGB_Image *Fl_Cocoa_Screen_Driver::read_win_rectangle(int X, int Y, int w, int h, Fl_Window *window, @@ -369,11 +369,11 @@ Fl_RGB_Image *Fl_Cocoa_Screen_Driver::read_win_rectangle(int X, int Y, int w, in CGContextRef src = (CGContextRef)Fl_Surface_Device::surface()->driver()->gc(); // get bitmap context base = (uchar *)CGBitmapContextGetData(src); // get data if(!base) return NULL; - int sw = CGBitmapContextGetWidth(src); - int sh = CGBitmapContextGetHeight(src); + int sw = (int)CGBitmapContextGetWidth(src); + int sh = (int)CGBitmapContextGetHeight(src); if( (sw - X < w) || (sh - Y < h) ) return NULL; - bpr = CGBitmapContextGetBytesPerRow(src); - bpp = CGBitmapContextGetBitsPerPixel(src)/8; + bpr = (int)CGBitmapContextGetBytesPerRow(src); + bpp = (int)CGBitmapContextGetBitsPerPixel(src)/8; Fl_Image_Surface *imgs = (Fl_Image_Surface*)Fl_Surface_Device::surface(); int fltk_w, fltk_h; imgs->printable_rect(&fltk_w, &fltk_h); @@ -400,16 +400,16 @@ Fl_RGB_Image *Fl_Cocoa_Screen_Driver::read_win_rectangle(int X, int Y, int w, in if (!cgimg) { return NULL; } - w = CGImageGetWidth(cgimg); - h = CGImageGetHeight(cgimg); + w = (int)CGImageGetWidth(cgimg); + h = (int)CGImageGetHeight(cgimg); Fl_Image_Surface *surf = new Fl_Image_Surface(w, h); Fl_Surface_Device::push_current(surf); ((Fl_Quartz_Graphics_Driver*)fl_graphics_driver)->draw_CGImage(cgimg, 0, 0, w, h, 0, 0, w, h); CGContextRef gc = (CGContextRef)fl_graphics_driver->gc(); - w = CGBitmapContextGetWidth(gc); - h = CGBitmapContextGetHeight(gc); - bpr = CGBitmapContextGetBytesPerRow(gc); - bpp = CGBitmapContextGetBitsPerPixel(gc)/8; + w = (int)CGBitmapContextGetWidth(gc); + h = (int)CGBitmapContextGetHeight(gc); + bpr = (int)CGBitmapContextGetBytesPerRow(gc); + bpp = (int)CGBitmapContextGetBitsPerPixel(gc)/8; base = (uchar*)CGBitmapContextGetData(gc); p = new uchar[bpr * h]; memcpy(p, base, bpr * h); diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx index 825056e44..22b6af0f8 100644 --- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx +++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx @@ -243,7 +243,7 @@ int Fl_Cocoa_Window_Driver::scroll(int src_x, int src_y, int src_w, int src_h, i // the current surface is generally the display, but is an Fl_Image_Surface when scrolling an Fl_Overlay_Window Fl_Quartz_Graphics_Driver *qgd = (Fl_Quartz_Graphics_Driver*)Fl_Surface_Device::surface()->driver(); float s = qgd->scale(); - qgd->draw_CGImage(img, dest_x, dest_y, lround(s*src_w), lround(s*src_h), 0, 0, src_w, src_h); + qgd->draw_CGImage(img, dest_x, dest_y, (int)lround(s*src_w), (int)lround(s*src_h), 0, 0, src_w, src_h); CFRelease(img); return 0; } diff --git a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx index 2d1e4d4e4..aa5ccbe0a 100644 --- a/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx +++ b/src/drivers/Darwin/Fl_Darwin_System_Driver.cxx @@ -131,7 +131,7 @@ int Fl_Darwin_System_Driver::filename_list(const char *d, dirent ***list, int dirlen; char *dirloc; // Assume that locale encoding is no less dense than UTF-8 - dirlen = strlen(d); + dirlen = (int)strlen(d); dirloc = (char *)d; # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8 int n = scandir(dirloc, list, 0, (int(*)(const struct dirent**,const struct dirent**))sort); @@ -153,7 +153,7 @@ int Fl_Darwin_System_Driver::filename_list(const char *d, dirent ***list, for (i=0; id_name); + int len = (int)strlen(de->d_name); newlen = len; dirent *newde = (dirent*)malloc(de->d_name - (char*)de + newlen + 2); // Add space for a / and a nul // Conversion to UTF-8 @@ -298,7 +298,7 @@ static int n_buf = 0; const char *Fl_Darwin_System_Driver::latin1_to_local(const char *t, int n) { - if (n==-1) n = strlen(t); + if (n==-1) n = (int)strlen(t); if (n<=n_buf) { n_buf = (n + 257) & 0x7fffff00; if (buf) free(buf); @@ -319,7 +319,7 @@ const char *Fl_Darwin_System_Driver::latin1_to_local(const char *t, int n) const char *Fl_Darwin_System_Driver::local_to_latin1(const char *t, int n) { - if (n==-1) n = strlen(t); + if (n==-1) n = (int)strlen(t); if (n<=n_buf) { n_buf = (n + 257) & 0x7fffff00; if (buf) free(buf); diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx index 552da03f9..d3f3d343a 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver.cxx @@ -92,8 +92,8 @@ void Fl_Quartz_Graphics_Driver::copy_offscreen(int x, int y, int w, int h, Fl_Of // draw portion srcx,srcy,w,h of osrc to position x,y (top-left) of the graphics driver's surface CGContextRef src = (CGContextRef)osrc; void *data = CGBitmapContextGetData(src); - int sw = CGBitmapContextGetWidth(src); - int sh = CGBitmapContextGetHeight(src); + int sw = (int)CGBitmapContextGetWidth(src); + int sh = (int)CGBitmapContextGetHeight(src); CGImageRef img; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 if (fl_mac_os_version >= 100400) img = CGBitmapContextCreateImage(src); // requires 10.4 diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx index b97cfbba7..87d4d4f32 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_image.cxx @@ -252,8 +252,8 @@ void Fl_Quartz_Graphics_Driver::cache(Fl_Pixmap *img) { Fl_Surface_Device::pop_current(); CGContextRef src = (CGContextRef)Fl_Graphics_Driver::get_offscreen_and_delete_image_surface(surf); void *cgdata = CGBitmapContextGetData(src); - int sw = CGBitmapContextGetWidth(src); - int sh = CGBitmapContextGetHeight(src); + int sw = (int)CGBitmapContextGetWidth(src); + int sh = (int)CGBitmapContextGetHeight(src); CGImageAlphaInfo alpha = CGBitmapContextGetAlphaInfo(src); CGColorSpaceRef lut = CGColorSpaceCreateDeviceRGB(); CGDataProviderRef src_bytes = CGDataProviderCreateWithData(src, cgdata, sw*sh*4, pmProviderRelease); diff --git a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx index 8e17f87c5..6a63ae483 100644 --- a/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Graphics_Driver_line_style.cxx @@ -54,7 +54,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { CGFloat *pDst = pattern; while (*d) { *pDst++ = (float)*d++; } quartz_line_pattern = pattern; - quartz_line_pattern_size = d-dashes; + quartz_line_pattern_size = (int)(d-dashes); } else if (style & 0xff) { char dash, dot, gap; // adjust lengths to account for cap: @@ -73,7 +73,7 @@ void Fl_Quartz_Graphics_Driver::line_style(int style, int width, char* dashes) { case FL_DASHDOT: *pDst++ = dash; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; break; case FL_DASHDOTDOT: *pDst++ = dash; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; *pDst++ = dot; *pDst++ = gap; break; } - quartz_line_pattern_size = pDst-pattern; + quartz_line_pattern_size = (int)(pDst-pattern); quartz_line_pattern = pattern; } else { quartz_line_pattern = 0; diff --git a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx index 2f1acc5d9..451078484 100644 --- a/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx +++ b/src/drivers/Quartz/Fl_Quartz_Image_Surface_Driver.cxx @@ -79,10 +79,10 @@ void Fl_Quartz_Image_Surface_Driver::untranslate() { Fl_RGB_Image* Fl_Quartz_Image_Surface_Driver::image() { CGContextFlush((CGContextRef)offscreen); - int W = CGBitmapContextGetWidth((CGContextRef)offscreen); - int H = CGBitmapContextGetHeight((CGContextRef)offscreen); - int bpr = CGBitmapContextGetBytesPerRow((CGContextRef)offscreen); - int bpp = CGBitmapContextGetBitsPerPixel((CGContextRef)offscreen)/8; + int W = (int)CGBitmapContextGetWidth((CGContextRef)offscreen); + int H = (int)CGBitmapContextGetHeight((CGContextRef)offscreen); + int bpr = (int)CGBitmapContextGetBytesPerRow((CGContextRef)offscreen); + int bpp = (int)CGBitmapContextGetBitsPerPixel((CGContextRef)offscreen)/8; uchar *base = (uchar*)CGBitmapContextGetData((CGContextRef)offscreen); int idx, idy; uchar *pdst, *psrc; diff --git a/src/fl_utf8.cxx b/src/fl_utf8.cxx index 6028f3172..fcbb63ee0 100644 --- a/src/fl_utf8.cxx +++ b/src/fl_utf8.cxx @@ -40,7 +40,7 @@ #define NBC 0xFFFF + 1 static int Toupper(int ucs) { - long i; + int i; static unsigned short *table = NULL; if (!table) {