You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-27 15:57:02 +00:00
Fix various Clang -Wunused-but-set-variable warnings
(cherry picked from commit 74d569b99e)
This commit is contained in:
@@ -999,7 +999,9 @@ struct _OSCoreBindImg {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void _OS::print_all_textures_by_size() {
|
void _OS::print_all_textures_by_size() {
|
||||||
|
// HACK: This is broken, was fixed in 3.4+, we don't bother here.
|
||||||
|
// Just comment out to silence warnings.
|
||||||
|
/*
|
||||||
List<_OSCoreBindImg> imgs;
|
List<_OSCoreBindImg> imgs;
|
||||||
int total = 0;
|
int total = 0;
|
||||||
{
|
{
|
||||||
@@ -1031,6 +1033,7 @@ void _OS::print_all_textures_by_size() {
|
|||||||
|
|
||||||
total -= E->get().vram;
|
total -= E->get().vram;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
|
|
||||||
void _OS::print_resources_by_type(const Vector<String> &p_types) {
|
void _OS::print_resources_by_type(const Vector<String> &p_types) {
|
||||||
|
|||||||
@@ -62,7 +62,6 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) {
|
|||||||
|
|
||||||
int idx = 0;
|
int idx = 0;
|
||||||
int total_compression_size = 0;
|
int total_compression_size = 0;
|
||||||
int total_string_size = 0;
|
|
||||||
|
|
||||||
for (List<StringName>::Element *E = keys.front(); E; E = E->next()) {
|
for (List<StringName>::Element *E = keys.front(); E; E = E->next()) {
|
||||||
|
|
||||||
@@ -101,7 +100,6 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) {
|
|||||||
|
|
||||||
compressed.write[idx] = ps;
|
compressed.write[idx] = ps;
|
||||||
total_compression_size += ps.compressed.size();
|
total_compression_size += ps.compressed.size();
|
||||||
total_string_size += src_s.size();
|
|
||||||
idx++;
|
idx++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -148,7 +146,6 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) {
|
|||||||
uint32_t *btw = (uint32_t *)&btwb[0];
|
uint32_t *btw = (uint32_t *)&btwb[0];
|
||||||
|
|
||||||
int btindex = 0;
|
int btindex = 0;
|
||||||
int collisions = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
|
|
||||||
@@ -156,8 +153,6 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) {
|
|||||||
if (t.size() == 0) {
|
if (t.size() == 0) {
|
||||||
htw[i] = 0xFFFFFFFF; //nothing
|
htw[i] = 0xFFFFFFFF; //nothing
|
||||||
continue;
|
continue;
|
||||||
} else if (t.size() > 1) {
|
|
||||||
collisions += t.size() - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
htw[i] = btindex;
|
htw[i] = btindex;
|
||||||
|
|||||||
@@ -50,7 +50,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
|
|||||||
*r_error = ERR_FILE_CORRUPT;
|
*r_error = ERR_FILE_CORRUPT;
|
||||||
|
|
||||||
Ref<Translation> translation = Ref<Translation>(memnew(Translation));
|
Ref<Translation> translation = Ref<Translation>(memnew(Translation));
|
||||||
|
#ifdef DEBUG_ENABLED
|
||||||
int line = 1;
|
int line = 1;
|
||||||
|
#endif
|
||||||
bool skip_this = false;
|
bool skip_this = false;
|
||||||
bool skip_next = false;
|
bool skip_next = false;
|
||||||
bool is_eof = false;
|
bool is_eof = false;
|
||||||
@@ -108,7 +110,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
|
|||||||
if (l.find("fuzzy") != -1) {
|
if (l.find("fuzzy") != -1) {
|
||||||
skip_next = true;
|
skip_next = true;
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG_ENABLED
|
||||||
line++;
|
line++;
|
||||||
|
#endif
|
||||||
continue; //nothing to read or comment
|
continue; //nothing to read or comment
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,7 +145,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
|
|||||||
else
|
else
|
||||||
msg_str += l;
|
msg_str += l;
|
||||||
|
|
||||||
|
#ifdef DEBUG_ENABLED
|
||||||
line++;
|
line++;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
memdelete(f);
|
memdelete(f);
|
||||||
|
|||||||
@@ -2733,21 +2733,19 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
|
|||||||
use_post_process = use_post_process && (env->adjustments_enabled || env->glow_enabled || env->dof_blur_far_enabled || env->dof_blur_near_enabled);
|
use_post_process = use_post_process && (env->adjustments_enabled || env->glow_enabled || env->dof_blur_far_enabled || env->dof_blur_near_enabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
GLuint next_buffer;
|
|
||||||
|
|
||||||
if (use_post_process) {
|
|
||||||
next_buffer = storage->frame.current_rt->mip_maps[0].sizes[0].fbo;
|
|
||||||
} else if (storage->frame.current_rt->external.fbo != 0) {
|
|
||||||
next_buffer = storage->frame.current_rt->external.fbo;
|
|
||||||
} else {
|
|
||||||
// set next_buffer to front buffer so multisample blit can happen if needed
|
|
||||||
next_buffer = storage->frame.current_rt->fbo;
|
|
||||||
}
|
|
||||||
|
|
||||||
// If using multisample buffer, resolve to post_process_effect buffer or to front buffer
|
// If using multisample buffer, resolve to post_process_effect buffer or to front buffer
|
||||||
if (storage->frame.current_rt && storage->frame.current_rt->multisample_active) {
|
if (storage->frame.current_rt && storage->frame.current_rt->multisample_active) {
|
||||||
#ifdef GLES_OVER_GL
|
GLuint next_buffer;
|
||||||
|
if (use_post_process) {
|
||||||
|
next_buffer = storage->frame.current_rt->mip_maps[0].sizes[0].fbo;
|
||||||
|
} else if (storage->frame.current_rt->external.fbo != 0) {
|
||||||
|
next_buffer = storage->frame.current_rt->external.fbo;
|
||||||
|
} else {
|
||||||
|
// set next_buffer to front buffer so multisample blit can happen if needed
|
||||||
|
next_buffer = storage->frame.current_rt->fbo;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef GLES_OVER_GL
|
||||||
glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->multisample_fbo);
|
glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->multisample_fbo);
|
||||||
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
glReadBuffer(GL_COLOR_ATTACHMENT0);
|
||||||
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, next_buffer);
|
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, next_buffer);
|
||||||
@@ -2769,6 +2767,7 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
|
|||||||
_copy_texture_to_buffer(storage->frame.current_rt->multisample_color, next_buffer);
|
_copy_texture_to_buffer(storage->frame.current_rt->multisample_color, next_buffer);
|
||||||
#else
|
#else
|
||||||
// TODO: any other platform not supported? this will fail.. maybe we should just call _copy_texture_to_buffer here as well?
|
// TODO: any other platform not supported? this will fail.. maybe we should just call _copy_texture_to_buffer here as well?
|
||||||
|
(void)next_buffer; // Silence warning as it's unused.
|
||||||
#endif
|
#endif
|
||||||
} else if (use_post_process) {
|
} else if (use_post_process) {
|
||||||
if (storage->frame.current_rt->external.fbo != 0) {
|
if (storage->frame.current_rt->external.fbo != 0) {
|
||||||
|
|||||||
@@ -7109,9 +7109,11 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
|
|||||||
DataType return_type;
|
DataType return_type;
|
||||||
List<DataType> arg_types;
|
List<DataType> arg_types;
|
||||||
int default_args_count = 0;
|
int default_args_count = 0;
|
||||||
int arg_count = p_call->arguments.size();
|
|
||||||
String callee_name;
|
String callee_name;
|
||||||
bool is_vararg = false;
|
bool is_vararg = false;
|
||||||
|
#ifdef DEBUG_ENABLED
|
||||||
|
int arg_count = p_call->arguments.size();
|
||||||
|
#endif
|
||||||
|
|
||||||
switch (p_call->arguments[0]->type) {
|
switch (p_call->arguments[0]->type) {
|
||||||
case GDScriptParser::Node::TYPE_TYPE: {
|
case GDScriptParser::Node::TYPE_TYPE: {
|
||||||
@@ -7218,7 +7220,9 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
|
|||||||
|
|
||||||
default_args_count = mi.default_arguments.size();
|
default_args_count = mi.default_arguments.size();
|
||||||
callee_name = mi.name;
|
callee_name = mi.name;
|
||||||
|
#ifdef DEBUG_ENABLED
|
||||||
arg_count -= 1;
|
arg_count -= 1;
|
||||||
|
#endif
|
||||||
|
|
||||||
// Check each argument type
|
// Check each argument type
|
||||||
for (List<PropertyInfo>::Element *E = mi.arguments.front(); E; E = E->next()) {
|
for (List<PropertyInfo>::Element *E = mi.arguments.front(); E; E = E->next()) {
|
||||||
@@ -7245,7 +7249,9 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
|
|||||||
|
|
||||||
IdentifierNode *func_id = static_cast<IdentifierNode *>(p_call->arguments[arg_id]);
|
IdentifierNode *func_id = static_cast<IdentifierNode *>(p_call->arguments[arg_id]);
|
||||||
callee_name = func_id->name;
|
callee_name = func_id->name;
|
||||||
|
#ifdef DEBUG_ENABLED
|
||||||
arg_count -= 1 + arg_id;
|
arg_count -= 1 + arg_id;
|
||||||
|
#endif
|
||||||
|
|
||||||
DataType base_type;
|
DataType base_type;
|
||||||
if (p_call->op == OperatorNode::OP_PARENT_CALL) {
|
if (p_call->op == OperatorNode::OP_PARENT_CALL) {
|
||||||
@@ -7424,7 +7430,6 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // DEBUG_ENABLED
|
#endif // DEBUG_ENABLED
|
||||||
|
|
||||||
return return_type;
|
return return_type;
|
||||||
|
|||||||
@@ -1169,7 +1169,6 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
|
|||||||
pkg_name = "Unnamed";
|
pkg_name = "Unnamed";
|
||||||
|
|
||||||
bool found_library = false;
|
bool found_library = false;
|
||||||
int total_size = 0;
|
|
||||||
|
|
||||||
const String project_file = "godot_ios.xcodeproj/project.pbxproj";
|
const String project_file = "godot_ios.xcodeproj/project.pbxproj";
|
||||||
Set<String> files_to_parse;
|
Set<String> files_to_parse;
|
||||||
@@ -1275,7 +1274,6 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
|
|||||||
file = file.replace("godot_ios", binary_name);
|
file = file.replace("godot_ios", binary_name);
|
||||||
|
|
||||||
print_line("ADDING: " + file + " size: " + itos(data.size()));
|
print_line("ADDING: " + file + " size: " + itos(data.size()));
|
||||||
total_size += data.size();
|
|
||||||
|
|
||||||
/* write it into our folder structure */
|
/* write it into our folder structure */
|
||||||
file = dest_dir + file;
|
file = dest_dir + file;
|
||||||
|
|||||||
@@ -538,7 +538,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
|||||||
|
|
||||||
// Now process our template.
|
// Now process our template.
|
||||||
bool found_binary = false;
|
bool found_binary = false;
|
||||||
int total_size = 0;
|
|
||||||
|
|
||||||
while (ret == UNZ_OK && err == OK) {
|
while (ret == UNZ_OK && err == OK) {
|
||||||
bool is_execute = false;
|
bool is_execute = false;
|
||||||
@@ -621,7 +620,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
|
|||||||
}
|
}
|
||||||
|
|
||||||
print_line("ADDING: " + file + " size: " + itos(data.size()));
|
print_line("ADDING: " + file + " size: " + itos(data.size()));
|
||||||
total_size += data.size();
|
|
||||||
|
|
||||||
// Write it into our application bundle.
|
// Write it into our application bundle.
|
||||||
file = tmp_app_path_name.plus_file(file);
|
file = tmp_app_path_name.plus_file(file);
|
||||||
|
|||||||
@@ -182,7 +182,6 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
|||||||
}
|
}
|
||||||
|
|
||||||
int wofs = margin;
|
int wofs = margin;
|
||||||
int spaces_size = 0;
|
|
||||||
int align_ofs = 0;
|
int align_ofs = 0;
|
||||||
|
|
||||||
if (p_mode != PROCESS_CACHE && align != ALIGN_FILL)
|
if (p_mode != PROCESS_CACHE && align != ALIGN_FILL)
|
||||||
@@ -240,7 +239,6 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
|||||||
line_ascent = 0; \
|
line_ascent = 0; \
|
||||||
line_descent = 0; \
|
line_descent = 0; \
|
||||||
spaces = 0; \
|
spaces = 0; \
|
||||||
spaces_size = 0; \
|
|
||||||
wofs = begin; \
|
wofs = begin; \
|
||||||
align_ofs = 0; \
|
align_ofs = 0; \
|
||||||
if (p_mode != PROCESS_CACHE) { \
|
if (p_mode != PROCESS_CACHE) { \
|
||||||
@@ -423,9 +421,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
|
|||||||
fh = line_ascent + line_descent;
|
fh = line_ascent + line_descent;
|
||||||
|
|
||||||
if (end && c[end - 1] == ' ') {
|
if (end && c[end - 1] == ' ') {
|
||||||
if (p_mode == PROCESS_CACHE) {
|
if (align == ALIGN_FILL) {
|
||||||
spaces_size += font->get_char_size(' ').width;
|
|
||||||
} else if (align == ALIGN_FILL) {
|
|
||||||
int ln = MIN(l.offset_caches.size() - 1, line);
|
int ln = MIN(l.offset_caches.size() - 1, line);
|
||||||
if (l.space_caches[ln]) {
|
if (l.space_caches[ln]) {
|
||||||
align_ofs = spaces * l.offset_caches[ln] / l.space_caches[ln];
|
align_ofs = spaces * l.offset_caches[ln] / l.space_caches[ln];
|
||||||
|
|||||||
Reference in New Issue
Block a user