Changed some code found by Clang Tidy and Coverity

This commit is contained in:
qarmin 2019-09-22 18:45:08 +02:00
parent 2e065d8ad0
commit 50be65bf43
25 changed files with 142 additions and 155 deletions

View File

@ -103,7 +103,7 @@ void HashingContext::_create_ctx(HashType p_type) {
} }
void HashingContext::_delete_ctx() { void HashingContext::_delete_ctx() {
return;
switch (type) { switch (type) {
case HASH_MD5: case HASH_MD5:
memdelete((CryptoCore::MD5Context *)ctx); memdelete((CryptoCore::MD5Context *)ctx);

View File

@ -194,7 +194,7 @@ bool ZipArchive::try_open_pack(const String &p_path) {
packages.push_back(pkg); packages.push_back(pkg);
int pkg_num = packages.size() - 1; int pkg_num = packages.size() - 1;
for (unsigned int i = 0; i < gi.number_entry; i++) { for (uint64_t i = 0; i < gi.number_entry; i++) {
char filename_inzip[256]; char filename_inzip[256];

View File

@ -715,7 +715,7 @@ Vector<Vector<Vector2> > Geometry::decompose_polygon_in_convex(Vector<Point2> po
decomp.write[idx].resize(tp.GetNumPoints()); decomp.write[idx].resize(tp.GetNumPoints());
for (int i = 0; i < tp.GetNumPoints(); i++) { for (int64_t i = 0; i < tp.GetNumPoints(); i++) {
decomp.write[idx].write[i] = tp.GetPoint(i); decomp.write[idx].write[i] = tp.GetPoint(i);
} }

View File

@ -2147,13 +2147,13 @@ int64_t String::to_int(const CharType *p_str, int p_len) {
if (c >= '0' && c <= '9') { if (c >= '0' && c <= '9') {
if (integer > INT32_MAX / 10) { if (integer > INT64_MAX / 10) {
String number(""); String number("");
str = p_str; str = p_str;
while (*str && str != limit) { while (*str && str != limit) {
number += *(str++); number += *(str++);
} }
ERR_FAIL_V_MSG(sign == 1 ? INT32_MAX : INT32_MIN, "Cannot represent " + number + " as integer, provided value is " + (sign == 1 ? "too big." : "too small.")); ERR_FAIL_V_MSG(sign == 1 ? INT64_MAX : INT64_MIN, "Cannot represent " + number + " as integer, provided value is " + (sign == 1 ? "too big." : "too small."));
} }
integer *= 10; integer *= 10;
integer += c - '0'; integer += c - '0';

View File

@ -1522,7 +1522,7 @@ Error VariantParser::parse_tag_assign_eof(Stream *p_stream, int &line, String &r
return err; return err;
if (tk.type != TK_STRING) { if (tk.type != TK_STRING) {
r_err_str = "Error reading quoted string"; r_err_str = "Error reading quoted string";
return err; return ERR_INVALID_DATA;
} }
what = tk.value; what = tk.value;

View File

@ -171,14 +171,14 @@ void AudioDriverALSA::thread_func(void *p_udata) {
ad->start_counting_ticks(); ad->start_counting_ticks();
if (!ad->active) { if (!ad->active) {
for (unsigned int i = 0; i < ad->period_size * ad->channels; i++) { for (uint64_t i = 0; i < ad->period_size * ad->channels; i++) {
ad->samples_out.write[i] = 0; ad->samples_out.write[i] = 0;
} }
} else { } else {
ad->audio_server_process(ad->period_size, ad->samples_in.ptrw()); ad->audio_server_process(ad->period_size, ad->samples_in.ptrw());
for (unsigned int i = 0; i < ad->period_size * ad->channels; i++) { for (uint64_t i = 0; i < ad->period_size * ad->channels; i++) {
ad->samples_out.write[i] = ad->samples_in[i] >> 16; ad->samples_out.write[i] = ad->samples_in[i] >> 16;
} }
} }

View File

@ -1439,7 +1439,7 @@ Size2 EditorAudioMeterNotches::get_minimum_size() const {
float width = 0; float width = 0;
float height = top_padding + btm_padding; float height = top_padding + btm_padding;
for (uint8_t i = 0; i < notches.size(); i++) { for (int i = 0; i < notches.size(); i++) {
if (notches[i].render_db_value) { if (notches[i].render_db_value) {
width = MAX(width, font->get_string_size(String::num(Math::abs(notches[i].db_value)) + "dB").x); width = MAX(width, font->get_string_size(String::num(Math::abs(notches[i].db_value)) + "dB").x);
height += font_height; height += font_height;
@ -1473,7 +1473,7 @@ void EditorAudioMeterNotches::_draw_audio_notches() {
Ref<Font> font = get_font("font", "Label"); Ref<Font> font = get_font("font", "Label");
float font_height = font->get_height(); float font_height = font->get_height();
for (uint8_t i = 0; i < notches.size(); i++) { for (int i = 0; i < notches.size(); i++) {
AudioNotch n = notches[i]; AudioNotch n = notches[i];
draw_line(Vector2(0, (1.0f - n.relative_position) * (get_size().y - btm_padding - top_padding) + top_padding), draw_line(Vector2(0, (1.0f - n.relative_position) * (get_size().y - btm_padding - top_padding) + top_padding),
Vector2(line_length, (1.0f - n.relative_position) * (get_size().y - btm_padding - top_padding) + top_padding), Vector2(line_length, (1.0f - n.relative_position) * (get_size().y - btm_padding - top_padding) + top_padding),

View File

@ -78,18 +78,12 @@ Dictionary EditorVCSInterface::_get_modified_files_data() {
} }
void EditorVCSInterface::_stage_file(String p_file_path) { void EditorVCSInterface::_stage_file(String p_file_path) {
return;
} }
void EditorVCSInterface::_unstage_file(String p_file_path) { void EditorVCSInterface::_unstage_file(String p_file_path) {
return;
} }
void EditorVCSInterface::_commit(String p_msg) { void EditorVCSInterface::_commit(String p_msg) {
return;
} }
Array EditorVCSInterface::_get_file_diff(String p_file_path) { Array EditorVCSInterface::_get_file_diff(String p_file_path) {
@ -134,7 +128,6 @@ void EditorVCSInterface::stage_file(String p_file_path) {
call("_stage_file", p_file_path); call("_stage_file", p_file_path);
} }
return;
} }
void EditorVCSInterface::unstage_file(String p_file_path) { void EditorVCSInterface::unstage_file(String p_file_path) {
@ -143,7 +136,6 @@ void EditorVCSInterface::unstage_file(String p_file_path) {
call("_unstage_file", p_file_path); call("_unstage_file", p_file_path);
} }
return;
} }
bool EditorVCSInterface::is_addon_ready() { bool EditorVCSInterface::is_addon_ready() {
@ -157,7 +149,6 @@ void EditorVCSInterface::commit(String p_msg) {
call("_commit", p_msg); call("_commit", p_msg);
} }
return;
} }
Array EditorVCSInterface::get_file_diff(String p_file_path) { Array EditorVCSInterface::get_file_diff(String p_file_path) {

View File

@ -1178,7 +1178,7 @@ void ResourceImporterScene::get_import_options(List<ImportOption> *r_options, in
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/import", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/import", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15)); r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/fps", PROPERTY_HINT_RANGE, "1,120,1"), 15));
r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "animation/filter_script", PROPERTY_HINT_MULTILINE_TEXT), "")); r_options->push_back(ImportOption(PropertyInfo(Variant::STRING, "animation/filter_script", PROPERTY_HINT_MULTILINE_TEXT), ""));
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/storage", PROPERTY_HINT_ENUM, "Built-In,Files (.anim),Files (.tres)"), animations_out ? true : false)); r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "animation/storage", PROPERTY_HINT_ENUM, "Built-In,Files (.anim),Files (.tres)"), animations_out));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/keep_custom_tracks"), animations_out)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/keep_custom_tracks"), animations_out));
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/optimizer/enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true)); r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "animation/optimizer/enabled", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_DEFAULT | PROPERTY_USAGE_UPDATE_ALL_IF_MODIFIED), true));
r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_linear_error"), 0.05)); r_options->push_back(ImportOption(PropertyInfo(Variant::REAL, "animation/optimizer/max_linear_error"), 0.05));

View File

@ -102,7 +102,7 @@ Vector<Vector2> expand(const Vector<Vector2> &points, const Rect2i &rect, float
int lasti = p2->Contour.size() - 1; int lasti = p2->Contour.size() - 1;
Vector2 prev = Vector2(p2->Contour[lasti].X / PRECISION, p2->Contour[lasti].Y / PRECISION); Vector2 prev = Vector2(p2->Contour[lasti].X / PRECISION, p2->Contour[lasti].Y / PRECISION);
for (unsigned int i = 0; i < p2->Contour.size(); i++) { for (uint64_t i = 0; i < p2->Contour.size(); i++) {
Vector2 cur = Vector2(p2->Contour[i].X / PRECISION, p2->Contour[i].Y / PRECISION); Vector2 cur = Vector2(p2->Contour[i].X / PRECISION, p2->Contour[i].Y / PRECISION);
if (cur.distance_to(prev) > 0.5) { if (cur.distance_to(prev) > 0.5) {

View File

@ -1280,7 +1280,6 @@ void EditorSceneImporterAssimp::create_bone(ImportState &state, RecursiveState &
// this transform is a bone // this transform is a bone
recursive_state.skeleton->add_bone(recursive_state.node_name); recursive_state.skeleton->add_bone(recursive_state.node_name);
ERR_FAIL_COND(recursive_state.skeleton == NULL); // serious bug we must now exit.
//ERR_FAIL_COND(recursive_state.skeleton->get_name() == ""); //ERR_FAIL_COND(recursive_state.skeleton->get_name() == "");
print_verbose("Bone added to lookup: " + AssimpUtils::get_assimp_string(recursive_state.bone->mName)); print_verbose("Bone added to lookup: " + AssimpUtils::get_assimp_string(recursive_state.bone->mName));
print_verbose("Skeleton attached to: " + recursive_state.skeleton->get_name()); print_verbose("Skeleton attached to: " + recursive_state.skeleton->get_name());

View File

@ -63,7 +63,6 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image,
ERR_FAIL_V(ERR_UNAVAILABLE); ERR_FAIL_V(ERR_UNAVAILABLE);
} }
if (err == OK) {
// Image data (might be indexed) // Image data (might be indexed)
PoolVector<uint8_t> data; PoolVector<uint8_t> data;
@ -88,7 +87,7 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image,
const uint32_t w = bits_per_pixel >= 24 ? width : width_bytes; const uint32_t w = bits_per_pixel >= 24 ? width : width_bytes;
const uint8_t *line = p_buffer + (line_width * (height - 1)); const uint8_t *line = p_buffer + (line_width * (height - 1));
for (unsigned int i = 0; i < height; i++) { for (uint64_t i = 0; i < height; i++) {
const uint8_t *line_ptr = line; const uint8_t *line_ptr = line;
for (unsigned int j = 0; j < w; j++) { for (unsigned int j = 0; j < w; j++) {
@ -197,7 +196,6 @@ Error ImageLoaderBMP::convert_to_image(Ref<Image> p_image,
p_image->create(width, height, 0, Image::FORMAT_RGBA8, extended_data); p_image->create(width, height, 0, Image::FORMAT_RGBA8, extended_data);
} }
} }
}
return err; return err;
} }

View File

@ -1399,9 +1399,6 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
unary = true; unary = true;
break; break;
case OperatorNode::OP_NEG: case OperatorNode::OP_NEG:
priority = 1;
unary = true;
break;
case OperatorNode::OP_POS: case OperatorNode::OP_POS:
priority = 1; priority = 1;
unary = true; unary = true;

View File

@ -189,6 +189,7 @@ void ExtendGDScriptParser::parse_class_symbol(const GDScriptParser::ClassNode *p
lsp::DocumentSymbol symbol; lsp::DocumentSymbol symbol;
const GDScriptParser::ClassNode::Constant &c = E->value(); const GDScriptParser::ClassNode::Constant &c = E->value();
const GDScriptParser::ConstantNode *node = dynamic_cast<const GDScriptParser::ConstantNode *>(c.expression); const GDScriptParser::ConstantNode *node = dynamic_cast<const GDScriptParser::ConstantNode *>(c.expression);
ERR_FAIL_COND(!node);
symbol.name = E->key(); symbol.name = E->key();
symbol.kind = lsp::SymbolKind::Constant; symbol.kind = lsp::SymbolKind::Constant;
symbol.deprecated = false; symbol.deprecated = false;
@ -674,6 +675,7 @@ Dictionary ExtendGDScriptParser::dump_class_api(const GDScriptParser::ClassNode
const GDScriptParser::ClassNode::Constant &c = E->value(); const GDScriptParser::ClassNode::Constant &c = E->value();
const GDScriptParser::ConstantNode *node = dynamic_cast<const GDScriptParser::ConstantNode *>(c.expression); const GDScriptParser::ConstantNode *node = dynamic_cast<const GDScriptParser::ConstantNode *>(c.expression);
ERR_FAIL_COND_V(!node, class_api);
Dictionary api; Dictionary api;
api["name"] = E->key(); api["name"] = E->key();

View File

@ -100,9 +100,10 @@ Dictionary GDScriptLanguageProtocol::initialize(const Dictionary &p_params) {
String root_uri = p_params["rootUri"]; String root_uri = p_params["rootUri"];
String root = p_params["rootPath"]; String root = p_params["rootPath"];
bool is_same_workspace = root == workspace->root; bool is_same_workspace;
#ifndef WINDOWS_ENABLED
is_same_workspace = root.to_lower() == workspace->root.to_lower(); is_same_workspace = root.to_lower() == workspace->root.to_lower();
#ifdef WINDOWS_ENABLED #else
is_same_workspace = root.replace("\\", "/").to_lower() == workspace->root.to_lower(); is_same_workspace = root.replace("\\", "/").to_lower() == workspace->root.to_lower();
#endif #endif
@ -142,6 +143,7 @@ void GDScriptLanguageProtocol::poll() {
Error GDScriptLanguageProtocol::start(int p_port) { Error GDScriptLanguageProtocol::start(int p_port) {
if (server == NULL) { if (server == NULL) {
server = dynamic_cast<WebSocketServer *>(ClassDB::instance("WebSocketServer")); server = dynamic_cast<WebSocketServer *>(ClassDB::instance("WebSocketServer"));
ERR_FAIL_COND_V(!server, FAILED);
server->set_buffers(8192, 1024, 8192, 1024); // 8mb should be way more than enough server->set_buffers(8192, 1024, 8192, 1024); // 8mb should be way more than enough
server->connect("data_received", this, "on_data_received"); server->connect("data_received", this, "on_data_received");
server->connect("client_connected", this, "on_client_connected"); server->connect("client_connected", this, "on_client_connected");

View File

@ -380,8 +380,8 @@ GDScriptTextDocument::~GDScriptTextDocument() {
memdelete(file_checker); memdelete(file_checker);
} }
void GDScriptTextDocument::sync_script_content(const String &p_uri, const String &p_content) { void GDScriptTextDocument::sync_script_content(const String &p_path, const String &p_content) {
String path = GDScriptLanguageProtocol::get_singleton()->get_workspace()->get_file_path(p_uri); String path = GDScriptLanguageProtocol::get_singleton()->get_workspace()->get_file_path(p_path);
GDScriptLanguageProtocol::get_singleton()->get_workspace()->parse_script(path, p_content); GDScriptLanguageProtocol::get_singleton()->get_workspace()->parse_script(path, p_content);
} }

View File

@ -1308,7 +1308,7 @@ public:
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true));
r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/opengl_debug"), false)); r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/opengl_debug"), false));
for (unsigned int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) { for (uint64_t i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_icons[i].option_id, PROPERTY_HINT_FILE, "*.png"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, launcher_icons[i].option_id, PROPERTY_HINT_FILE, "*.png"), ""));
} }
@ -2100,7 +2100,7 @@ public:
if (file == "res/drawable-nodpi-v4/icon.png") { if (file == "res/drawable-nodpi-v4/icon.png") {
bool found = false; bool found = false;
for (unsigned int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) { for (uint64_t i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
String icon_path = String(p_preset->get(launcher_icons[i].option_id)).strip_edges(); String icon_path = String(p_preset->get(launcher_icons[i].option_id)).strip_edges();
if (icon_path != "" && icon_path.ends_with(".png")) { if (icon_path != "" && icon_path.ends_with(".png")) {
FileAccess *f = FileAccess::open(icon_path, FileAccess::READ); FileAccess *f = FileAccess::open(icon_path, FileAccess::READ);
@ -2226,7 +2226,7 @@ public:
APKExportData ed; APKExportData ed;
ed.ep = &ep; ed.ep = &ep;
ed.apk = unaligned_apk; ed.apk = unaligned_apk;
for (unsigned int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) { for (uint64_t i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
String icon_path = String(p_preset->get(launcher_icons[i].option_id)).strip_edges(); String icon_path = String(p_preset->get(launcher_icons[i].option_id)).strip_edges();
if (icon_path != "" && icon_path.ends_with(".png") && FileAccess::exists(icon_path)) { if (icon_path != "" && icon_path.ends_with(".png") && FileAccess::exists(icon_path)) {
Vector<uint8_t> data = FileAccess::get_file_as_array(icon_path); Vector<uint8_t> data = FileAccess::get_file_as_array(icon_path);

View File

@ -287,7 +287,7 @@ void EditorExportPlatformIOS::get_export_options(List<ExportOption> *r_options)
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_40x40", PROPERTY_HINT_FILE, "*.png"), "")); // Spotlight r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_40x40", PROPERTY_HINT_FILE, "*.png"), "")); // Spotlight
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_80x80", PROPERTY_HINT_FILE, "*.png"), "")); // Spotlight on devices with retina display r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, "optional_icons/spotlight_80x80", PROPERTY_HINT_FILE, "*.png"), "")); // Spotlight on devices with retina display
for (unsigned int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) { for (uint64_t i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, loading_screen_infos[i].preset_key, PROPERTY_HINT_FILE, "*.png"), "")); r_options->push_back(ExportOption(PropertyInfo(Variant::STRING, loading_screen_infos[i].preset_key, PROPERTY_HINT_FILE, "*.png"), ""));
} }
@ -489,7 +489,7 @@ Error EditorExportPlatformIOS::_export_icons(const Ref<EditorExportPreset> &p_pr
DirAccess *da = DirAccess::open(p_iconset_dir); DirAccess *da = DirAccess::open(p_iconset_dir);
ERR_FAIL_COND_V(!da, ERR_CANT_OPEN); ERR_FAIL_COND_V(!da, ERR_CANT_OPEN);
for (unsigned int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) { for (uint64_t i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) {
IconInfo info = icon_infos[i]; IconInfo info = icon_infos[i];
String icon_path = p_preset->get(info.preset_key); String icon_path = p_preset->get(info.preset_key);
if (icon_path.length() == 0) { if (icon_path.length() == 0) {
@ -539,7 +539,7 @@ Error EditorExportPlatformIOS::_export_loading_screens(const Ref<EditorExportPre
DirAccess *da = DirAccess::open(p_dest_dir); DirAccess *da = DirAccess::open(p_dest_dir);
ERR_FAIL_COND_V(!da, ERR_CANT_OPEN); ERR_FAIL_COND_V(!da, ERR_CANT_OPEN);
for (unsigned int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) { for (uint64_t i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
LoadingScreenInfo info = loading_screen_infos[i]; LoadingScreenInfo info = loading_screen_infos[i];
String loading_screen_file = p_preset->get(info.preset_key); String loading_screen_file = p_preset->get(info.preset_key);
if (loading_screen_file.size() > 0) { if (loading_screen_file.size() > 0) {
@ -626,7 +626,7 @@ private:
static String _hex_pad(uint32_t num) { static String _hex_pad(uint32_t num) {
Vector<char> ret; Vector<char> ret;
ret.resize(sizeof(num) * 2); ret.resize(sizeof(num) * 2);
for (unsigned int i = 0; i < sizeof(num) * 2; ++i) { for (uint64_t i = 0; i < sizeof(num) * 2; ++i) {
uint8_t four_bits = (num >> (sizeof(num) * 8 - (i + 1) * 4)) & 0xF; uint8_t four_bits = (num >> (sizeof(num) * 8 - (i + 1) * 4)) & 0xF;
ret.write[i] = _hex_char(four_bits); ret.write[i] = _hex_char(four_bits);
} }
@ -1169,7 +1169,7 @@ bool EditorExportPlatformIOS::can_export(const Ref<EditorExportPreset> &p_preset
valid = false; valid = false;
} }
for (unsigned int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) { for (uint64_t i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) {
IconInfo info = icon_infos[i]; IconInfo info = icon_infos[i];
String icon_path = p_preset->get(info.preset_key); String icon_path = p_preset->get(info.preset_key);
if (icon_path.length() == 0) { if (icon_path.length() == 0) {

View File

@ -240,7 +240,7 @@ void EditorExportPlatformOSX::_make_icon(const Ref<Image> &p_icon, Vector<uint8_
{ "is32", "s8mk", false, 16 } //16x16 24-bit RLE + 8-bit uncompressed mask { "is32", "s8mk", false, 16 } //16x16 24-bit RLE + 8-bit uncompressed mask
}; };
for (unsigned int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) { for (uint64_t i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) {
Ref<Image> copy = p_icon; // does this make sense? doesn't this just increase the reference count instead of making a copy? Do we even need a copy? Ref<Image> copy = p_icon; // does this make sense? doesn't this just increase the reference count instead of making a copy? Do we even need a copy?
copy->convert(Image::FORMAT_RGBA8); copy->convert(Image::FORMAT_RGBA8);
copy->resize(icon_infos[i].size, icon_infos[i].size); copy->resize(icon_infos[i].size, icon_infos[i].size);

View File

@ -500,7 +500,7 @@ Error AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t
size_t block_size = (p_len - step) > BLOCK_SIZE ? (size_t)BLOCK_SIZE : (p_len - step); size_t block_size = (p_len - step) > BLOCK_SIZE ? (size_t)BLOCK_SIZE : (p_len - step);
for (uint32_t i = 0; i < block_size; i++) { for (uint64_t i = 0; i < block_size; i++) {
strm_in.write[i] = p_buffer[step + i]; strm_in.write[i] = p_buffer[step + i];
} }
@ -524,14 +524,14 @@ Error AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t
//package->store_buffer(strm_out.ptr(), strm.total_out - total_out_before); //package->store_buffer(strm_out.ptr(), strm.total_out - total_out_before);
int start = file_buffer.size(); int start = file_buffer.size();
file_buffer.resize(file_buffer.size() + bh.compressed_size); file_buffer.resize(file_buffer.size() + bh.compressed_size);
for (uint32_t i = 0; i < bh.compressed_size; i++) for (uint64_t i = 0; i < bh.compressed_size; i++)
file_buffer.write[start + i] = strm_out[i]; file_buffer.write[start + i] = strm_out[i];
} else { } else {
bh.compressed_size = block_size; bh.compressed_size = block_size;
//package->store_buffer(strm_in.ptr(), block_size); //package->store_buffer(strm_in.ptr(), block_size);
int start = file_buffer.size(); int start = file_buffer.size();
file_buffer.resize(file_buffer.size() + block_size); file_buffer.resize(file_buffer.size() + block_size);
for (uint32_t i = 0; i < bh.compressed_size; i++) for (uint64_t i = 0; i < bh.compressed_size; i++)
file_buffer.write[start + i] = strm_in[i]; file_buffer.write[start + i] = strm_in[i];
} }
@ -554,7 +554,7 @@ Error AppxPackager::add_file(String p_file_name, const uint8_t *p_buffer, size_t
//package->store_buffer(strm_out.ptr(), strm.total_out - total_out_before); //package->store_buffer(strm_out.ptr(), strm.total_out - total_out_before);
int start = file_buffer.size(); int start = file_buffer.size();
file_buffer.resize(file_buffer.size() + (strm.total_out - total_out_before)); file_buffer.resize(file_buffer.size() + (strm.total_out - total_out_before));
for (uint32_t i = 0; i < (strm.total_out - total_out_before); i++) for (uint64_t i = 0; i < (strm.total_out - total_out_before); i++)
file_buffer.write[start + i] = strm_out[i]; file_buffer.write[start + i] = strm_out[i];
deflateEnd(&strm); deflateEnd(&strm);

View File

@ -1566,7 +1566,7 @@ bool OS_X11::is_window_maximize_allowed() {
bool found_wm_act_max_horz = false; bool found_wm_act_max_horz = false;
bool found_wm_act_max_vert = false; bool found_wm_act_max_vert = false;
for (unsigned int i = 0; i < len; i++) { for (uint64_t i = 0; i < len; i++) {
if (atoms[i] == wm_act_max_horz) if (atoms[i] == wm_act_max_horz)
found_wm_act_max_horz = true; found_wm_act_max_horz = true;
if (atoms[i] == wm_act_max_vert) if (atoms[i] == wm_act_max_vert)
@ -1612,7 +1612,7 @@ bool OS_X11::is_window_maximized() const {
bool found_wm_max_horz = false; bool found_wm_max_horz = false;
bool found_wm_max_vert = false; bool found_wm_max_vert = false;
for (unsigned int i = 0; i < len; i++) { for (uint64_t i = 0; i < len; i++) {
if (atoms[i] == wm_max_horz) if (atoms[i] == wm_max_horz)
found_wm_max_horz = true; found_wm_max_horz = true;
if (atoms[i] == wm_max_vert) if (atoms[i] == wm_max_vert)
@ -3028,7 +3028,7 @@ void OS_X11::alert(const String &p_alert, const String &p_title) {
String program; String program;
for (int i = 0; i < path_elems.size(); i++) { for (int i = 0; i < path_elems.size(); i++) {
for (unsigned int k = 0; k < sizeof(message_programs) / sizeof(char *); k++) { for (uint64_t k = 0; k < sizeof(message_programs) / sizeof(char *); k++) {
String tested_path = path_elems[i].plus_file(message_programs[k]); String tested_path = path_elems[i].plus_file(message_programs[k]);
if (FileAccess::exists(tested_path)) { if (FileAccess::exists(tested_path)) {

View File

@ -602,9 +602,7 @@ void CanvasItem::_notification(int p_what) {
} }
global_invalid = true; global_invalid = true;
} break; } break;
case NOTIFICATION_DRAW: { case NOTIFICATION_DRAW:
} break;
case NOTIFICATION_TRANSFORM_CHANGED: { case NOTIFICATION_TRANSFORM_CHANGED: {
} break; } break;

View File

@ -271,7 +271,7 @@ void NavigationPolygon::make_polygons_from_outlines() {
struct Polygon p; struct Polygon p;
for (int i = 0; i < tp.GetNumPoints(); i++) { for (int64_t i = 0; i < tp.GetNumPoints(); i++) {
Map<Vector2, int>::Element *E = points.find(tp[i]); Map<Vector2, int>::Element *E = points.find(tp[i]);
if (!E) { if (!E) {

View File

@ -456,7 +456,7 @@ public:
void push_meta(const Variant &p_meta); void push_meta(const Variant &p_meta);
void push_table(int p_columns); void push_table(int p_columns);
void push_fade(int p_start_index, int p_length); void push_fade(int p_start_index, int p_length);
void push_shake(int p_level, float p_rate); void push_shake(int p_strength, float p_rate);
void push_wave(float p_frequency, float p_amplitude); void push_wave(float p_frequency, float p_amplitude);
void push_tornado(float p_frequency, float p_radius); void push_tornado(float p_frequency, float p_radius);
void push_rainbow(float p_saturation, float p_value, float p_frequency); void push_rainbow(float p_saturation, float p_value, float p_frequency);

View File

@ -81,7 +81,7 @@ public:
void remove_feed(const Ref<CameraFeed> &p_feed); void remove_feed(const Ref<CameraFeed> &p_feed);
// get our feeds // get our feeds
Ref<CameraFeed> get_feed(int p_idx); Ref<CameraFeed> get_feed(int p_index);
int get_feed_count(); int get_feed_count();
Array get_feeds(); Array get_feeds();