Browse Source

Merge pull request #22446 from akien-mga/fix-warnings

Fix various warnings raised by GCC 5
Rémi Verschelde 7 years ago
parent
commit
4cf5bb0276
80 changed files with 184 additions and 366 deletions
  1. 3 2
      SConstruct
  2. 1 1
      core/io/resource_format_binary.cpp
  3. 1 1
      core/node_path.cpp
  4. 2 2
      core/oa_hash_map.h
  5. 0 1
      core/os/file_access.cpp
  6. 2 2
      core/typedefs.h
  7. 0 2
      drivers/gles2/rasterizer_canvas_gles2.cpp
  8. 0 13
      drivers/gles2/rasterizer_scene_gles2.cpp
  9. 3 5
      drivers/gles2/rasterizer_storage_gles2.cpp
  10. 1 10
      drivers/gles2/shader_gles2.cpp
  11. 0 2
      drivers/gles3/rasterizer_canvas_gles3.cpp
  12. 4 5
      drivers/gles3/rasterizer_scene_gles3.cpp
  13. 1 1
      drivers/gles3/rasterizer_storage_gles3.cpp
  14. 1 1
      drivers/pulseaudio/audio_driver_pulseaudio.cpp
  15. 1 1
      drivers/unix/net_socket_posix.cpp
  16. 1 3
      editor/animation_track_editor.cpp
  17. 0 5
      editor/editor_inspector.cpp
  18. 2 1
      editor/editor_plugin.cpp
  19. 1 1
      editor/editor_properties_array_dict.cpp
  20. 3 11
      editor/editor_themes.cpp
  21. 6 6
      editor/import/editor_scene_importer_gltf.cpp
  22. 0 13
      editor/plugins/animation_blend_tree_editor_plugin.cpp
  23. 0 2
      editor/plugins/animation_blend_tree_editor_plugin.h
  24. 0 1
      editor/plugins/collision_shape_2d_editor_plugin.cpp
  25. 0 8
      editor/plugins/mesh_editor_plugin.cpp
  26. 0 1
      editor/plugins/script_text_editor.cpp
  27. 0 20
      editor/plugins/shader_editor_plugin.cpp
  28. 2 1
      editor/plugins/skeleton_editor_plugin.cpp
  29. 11 14
      editor/plugins/spatial_editor_plugin.cpp
  30. 1 1
      editor/plugins/spatial_editor_plugin.h
  31. 1 1
      editor/plugins/sprite_editor_plugin.cpp
  32. 1 0
      editor/spatial_editor_gizmos.cpp
  33. 4 3
      main/input_default.cpp
  34. 2 1
      main/input_default.h
  35. 0 1
      main/main.cpp
  36. 0 2
      modules/bullet/bullet_types_converter.cpp
  37. 3 6
      modules/cvtt/image_compress_cvtt.cpp
  38. 1 1
      modules/etc/image_etc.cpp
  39. 6 6
      modules/gdnative/register_types.cpp
  40. 1 1
      modules/gdscript/gdscript.h
  41. 0 3
      modules/gdscript/gdscript_editor.cpp
  42. 1 1
      modules/gdscript/gdscript_function.cpp
  43. 1 1
      modules/gdscript/gdscript_parser.cpp
  44. 8 25
      modules/gridmap/grid_map.cpp
  45. 8 6
      modules/gridmap/grid_map_editor_plugin.cpp
  46. 5 3
      modules/mbedtls/stream_peer_mbed_tls.cpp
  47. 6 6
      modules/mbedtls/stream_peer_mbed_tls.h
  48. 3 3
      modules/opensimplex/simplex_noise.cpp
  49. 3 3
      modules/theora/video_stream_theora.cpp
  50. 1 18
      modules/visual_script/visual_script_editor.cpp
  51. 1 2
      modules/visual_script/visual_script_editor.h
  52. 7 9
      modules/visual_script/visual_script_property_selector.cpp
  53. 1 2
      modules/visual_script/visual_script_property_selector.h
  54. 1 5
      modules/websocket/lws_peer.cpp
  55. 10 11
      platform/android/export/export.cpp
  56. 4 4
      platform/iphone/export/export.cpp
  57. 2 2
      platform/osx/export/export.cpp
  58. 0 1
      scene/2d/tile_map.cpp
  59. 1 1
      scene/3d/audio_stream_player_3d.cpp
  60. 6 0
      scene/3d/light.cpp
  61. 0 4
      scene/3d/navigation.cpp
  62. 2 5
      scene/gui/rich_text_label.cpp
  63. 2 1
      scene/gui/scroll_container.cpp
  64. 1 3
      scene/gui/text_edit.cpp
  65. 6 6
      scene/gui/tree.cpp
  66. 0 18
      scene/main/viewport.cpp
  67. 2 2
      scene/resources/audio_stream_sample.cpp
  68. 0 1
      scene/resources/bit_mask.cpp
  69. 0 2
      scene/resources/material.cpp
  70. 0 13
      scene/resources/mesh.cpp
  71. 4 4
      scene/resources/visual_shader.cpp
  72. 12 1
      servers/audio/audio_rb_resampler.cpp
  73. 1 1
      servers/audio/audio_stream.h
  74. 4 1
      servers/audio/effects/audio_effect_record.h
  75. 1 1
      servers/audio_server.cpp
  76. 8 8
      servers/physics_2d/collision_object_2d_sw.h
  77. 0 23
      servers/visual/default_mouse_cursor.xpm
  78. 0 3
      servers/visual/shader_language.cpp
  79. 0 1
      servers/visual/visual_server_raster.cpp
  80. 6 3
      servers/visual/visual_server_scene.cpp

+ 3 - 2
SConstruct

@@ -333,12 +333,13 @@ if selected_platform in platform_list:
         # Set exception handling model to avoid warnings caused by Windows system headers.
         # Set exception handling model to avoid warnings caused by Windows system headers.
         env.Append(CCFLAGS=['/EHsc'])
         env.Append(CCFLAGS=['/EHsc'])
     else: # Rest of the world
     else: # Rest of the world
+        disable_nonessential_warnings = ['-Wno-sign-compare']
         if (env["warnings"] == 'extra'):
         if (env["warnings"] == 'extra'):
             env.Append(CCFLAGS=['-Wall', '-Wextra'])
             env.Append(CCFLAGS=['-Wall', '-Wextra'])
         elif (env["warnings"] == 'all' or env["warnings"] == 'yes'):
         elif (env["warnings"] == 'all' or env["warnings"] == 'yes'):
-            env.Append(CCFLAGS=['-Wall'])
+            env.Append(CCFLAGS=['-Wall'] + disable_nonessential_warnings)
         elif (env["warnings"] == 'moderate'):
         elif (env["warnings"] == 'moderate'):
-            env.Append(CCFLAGS=['-Wall', '-Wno-unused'])
+            env.Append(CCFLAGS=['-Wall', '-Wno-unused'] + disable_nonessential_warnings)
         else: # 'no'
         else: # 'no'
             env.Append(CCFLAGS=['-w'])
             env.Append(CCFLAGS=['-w'])
         env.Append(CCFLAGS=['-Werror=return-type'])
         env.Append(CCFLAGS=['-Werror=return-type'])

+ 1 - 1
core/io/resource_format_binary.cpp

@@ -1718,7 +1718,7 @@ void ResourceFormatSaverBinaryInstance::save_unicode_string(FileAccess *f, const
 
 
 	CharString utf8 = p_string.utf8();
 	CharString utf8 = p_string.utf8();
 	if (p_bit_on_len) {
 	if (p_bit_on_len) {
-		f->store_32(utf8.length() + 1 | 0x80000000);
+		f->store_32((utf8.length() + 1) | 0x80000000);
 	} else {
 	} else {
 		f->store_32(utf8.length() + 1);
 		f->store_32(utf8.length() + 1);
 	}
 	}

+ 1 - 1
core/node_path.cpp

@@ -276,7 +276,7 @@ NodePath NodePath::get_as_property_path() const {
 
 
 		String initial_subname = data->path[0];
 		String initial_subname = data->path[0];
 
 
-		for (size_t i = 1; i < data->path.size(); i++) {
+		for (int i = 1; i < data->path.size(); i++) {
 			initial_subname += "/" + data->path[i];
 			initial_subname += "/" + data->path[i];
 		}
 		}
 		new_path.insert(0, initial_subname);
 		new_path.insert(0, initial_subname);

+ 2 - 2
core/oa_hash_map.h

@@ -166,7 +166,7 @@ private:
 		values = memnew_arr(TValue, capacity);
 		values = memnew_arr(TValue, capacity);
 		hashes = memnew_arr(uint32_t, capacity);
 		hashes = memnew_arr(uint32_t, capacity);
 
 
-		for (int i = 0; i < capacity; i++) {
+		for (uint32_t i = 0; i < capacity; i++) {
 			hashes[i] = 0;
 			hashes[i] = 0;
 		}
 		}
 
 
@@ -311,7 +311,7 @@ public:
 		values = memnew_arr(TValue, p_initial_capacity);
 		values = memnew_arr(TValue, p_initial_capacity);
 		hashes = memnew_arr(uint32_t, p_initial_capacity);
 		hashes = memnew_arr(uint32_t, p_initial_capacity);
 
 
-		for (int i = 0; i < p_initial_capacity; i++) {
+		for (uint32_t i = 0; i < p_initial_capacity; i++) {
 			hashes[i] = 0;
 			hashes[i] = 0;
 		}
 		}
 	}
 	}

+ 0 - 1
core/os/file_access.cpp

@@ -46,7 +46,6 @@ bool FileAccess::backup_save = false;
 
 
 FileAccess *FileAccess::create(AccessType p_access) {
 FileAccess *FileAccess::create(AccessType p_access) {
 
 
-	ERR_FAIL_COND_V(!create_func, 0);
 	ERR_FAIL_INDEX_V(p_access, ACCESS_MAX, 0);
 	ERR_FAIL_INDEX_V(p_access, ACCESS_MAX, 0);
 
 
 	FileAccess *ret = create_func[p_access]();
 	FileAccess *ret = create_func[p_access]();

+ 2 - 2
core/typedefs.h

@@ -105,11 +105,11 @@ T *_nullptr() {
 /** Generic ABS function, for math uses please use Math::abs */
 /** Generic ABS function, for math uses please use Math::abs */
 
 
 #ifndef ABS
 #ifndef ABS
-#define ABS(m_v) ((m_v < 0) ? (-(m_v)) : (m_v))
+#define ABS(m_v) (((m_v) < 0) ? (-(m_v)) : (m_v))
 #endif
 #endif
 
 
 #ifndef SGN
 #ifndef SGN
-#define SGN(m_v) ((m_v < 0) ? (-1.0) : (+1.0))
+#define SGN(m_v) (((m_v) < 0) ? (-1.0) : (+1.0))
 #endif
 #endif
 
 
 #ifndef MIN
 #ifndef MIN

+ 0 - 2
drivers/gles2/rasterizer_canvas_gles2.cpp

@@ -811,8 +811,6 @@ void RasterizerCanvasGLES2::canvas_render_items(Item *p_item_list, int p_z, cons
 
 
 	bool rebind_shader = true;
 	bool rebind_shader = true;
 
 
-	Size2 rt_size = Size2(storage->frame.current_rt->width, storage->frame.current_rt->height);
-
 	state.current_tex = RID();
 	state.current_tex = RID();
 	state.current_tex_ptr = NULL;
 	state.current_tex_ptr = NULL;
 	state.current_normal = RID();
 	state.current_normal = RID();

+ 0 - 13
drivers/gles2/rasterizer_scene_gles2.cpp

@@ -712,10 +712,8 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G
 	bool has_alpha = has_base_alpha || has_blend_alpha;
 	bool has_alpha = has_base_alpha || has_blend_alpha;
 
 
 	bool mirror = p_instance->mirror;
 	bool mirror = p_instance->mirror;
-	bool no_cull = false;
 
 
 	if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES2::Shader::Spatial::CULL_MODE_DISABLED) {
 	if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES2::Shader::Spatial::CULL_MODE_DISABLED) {
-		no_cull = true;
 		mirror = false;
 		mirror = false;
 	} else if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES2::Shader::Spatial::CULL_MODE_FRONT) {
 	} else if (p_material->shader->spatial.cull_mode == RasterizerStorageGLES2::Shader::Spatial::CULL_MODE_FRONT) {
 		mirror = !mirror;
 		mirror = !mirror;
@@ -738,7 +736,6 @@ void RasterizerSceneGLES2::_add_geometry_with_material(RasterizerStorageGLES2::G
 			//shader does not use discard and does not write a vertex position, use generic material
 			//shader does not use discard and does not write a vertex position, use generic material
 			if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) {
 			if (p_instance->cast_shadows == VS::SHADOW_CASTING_SETTING_DOUBLE_SIDED) {
 				p_material = storage->material_owner.getptr(!p_shadow_pass && p_material->shader->spatial.uses_world_coordinates ? default_worldcoord_material_twosided : default_material_twosided);
 				p_material = storage->material_owner.getptr(!p_shadow_pass && p_material->shader->spatial.uses_world_coordinates ? default_worldcoord_material_twosided : default_material_twosided);
-				no_cull = true;
 				mirror = false;
 				mirror = false;
 			} else {
 			} else {
 				p_material = storage->material_owner.getptr(!p_shadow_pass && p_material->shader->spatial.uses_world_coordinates ? default_worldcoord_material : default_material);
 				p_material = storage->material_owner.getptr(!p_shadow_pass && p_material->shader->spatial.uses_world_coordinates ? default_worldcoord_material : default_material);
@@ -1136,8 +1133,6 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
 								bone_weight[3] = (weight_ptr[3] / (float)0xFFFF);
 								bone_weight[3] = (weight_ptr[3] / (float)0xFFFF);
 							}
 							}
 
 
-							size_t offset = i * 12;
-
 							Transform transform;
 							Transform transform;
 
 
 							Transform bone_transforms[4] = {
 							Transform bone_transforms[4] = {
@@ -1202,7 +1197,6 @@ void RasterizerSceneGLES2::_setup_geometry(RenderList::Element *p_element, Raste
 		} break;
 		} break;
 
 
 		case VS::INSTANCE_MULTIMESH: {
 		case VS::INSTANCE_MULTIMESH: {
-			RasterizerStorageGLES2::MultiMesh *multi_mesh = static_cast<RasterizerStorageGLES2::MultiMesh *>(p_element->owner);
 			RasterizerStorageGLES2::Surface *s = static_cast<RasterizerStorageGLES2::Surface *>(p_element->geometry);
 			RasterizerStorageGLES2::Surface *s = static_cast<RasterizerStorageGLES2::Surface *>(p_element->geometry);
 
 
 			glBindBuffer(GL_ARRAY_BUFFER, s->vertex_id);
 			glBindBuffer(GL_ARRAY_BUFFER, s->vertex_id);
@@ -2267,7 +2261,6 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
 	uint32_t y;
 	uint32_t y;
 	uint32_t width;
 	uint32_t width;
 	uint32_t height;
 	uint32_t height;
-	uint32_t vp_height;
 
 
 	float zfar = 0;
 	float zfar = 0;
 	bool flip_facing = false;
 	bool flip_facing = false;
@@ -2353,14 +2346,12 @@ void RasterizerSceneGLES2::render_shadow(RID p_light, RID p_shadow_atlas, int p_
 		normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
 		normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
 
 
 		fbo = directional_shadow.fbo;
 		fbo = directional_shadow.fbo;
-		vp_height = directional_shadow.size;
 	} else {
 	} else {
 		ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas);
 		ShadowAtlas *shadow_atlas = shadow_atlas_owner.getornull(p_shadow_atlas);
 		ERR_FAIL_COND(!shadow_atlas);
 		ERR_FAIL_COND(!shadow_atlas);
 		ERR_FAIL_COND(!shadow_atlas->shadow_owners.has(p_light));
 		ERR_FAIL_COND(!shadow_atlas->shadow_owners.has(p_light));
 
 
 		fbo = shadow_atlas->fbo;
 		fbo = shadow_atlas->fbo;
-		vp_height = shadow_atlas->size;
 
 
 		uint32_t key = shadow_atlas->shadow_owners[p_light];
 		uint32_t key = shadow_atlas->shadow_owners[p_light];
 
 
@@ -2669,10 +2660,6 @@ void RasterizerSceneGLES2::initialize() {
 	}
 	}
 
 
 	shadow_filter_mode = SHADOW_FILTER_NEAREST;
 	shadow_filter_mode = SHADOW_FILTER_NEAREST;
-
-	RenderList::Element e;
-	e.sort_key = 0;
-	e.light_type1 = 1;
 }
 }
 
 
 void RasterizerSceneGLES2::iteration() {
 void RasterizerSceneGLES2::iteration() {

+ 3 - 5
drivers/gles2/rasterizer_storage_gles2.cpp

@@ -356,7 +356,6 @@ void RasterizerStorageGLES2::texture_allocate(RID p_texture, int p_width, int p_
 	GLenum type;
 	GLenum type;
 
 
 	bool compressed = false;
 	bool compressed = false;
-	bool srgb = false;
 
 
 	if (p_flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING) {
 	if (p_flags & VS::TEXTURE_FLAG_USED_FOR_STREAMING) {
 		p_flags &= ~VS::TEXTURE_FLAG_MIPMAPS; // no mipies for video
 		p_flags &= ~VS::TEXTURE_FLAG_MIPMAPS; // no mipies for video
@@ -4090,15 +4089,14 @@ void RasterizerStorageGLES2::initialize() {
 	}
 	}
 
 
 	config.shrink_textures_x2 = false;
 	config.shrink_textures_x2 = false;
-	config.float_texture_supported = config.extensions.find("GL_ARB_texture_float") != NULL || config.extensions.find("GL_OES_texture_float") != NULL;
-	config.s3tc_supported = config.extensions.find("GL_EXT_texture_compression_s3tc") != NULL;
-	config.etc1_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture") != NULL;
+	config.float_texture_supported = config.extensions.has("GL_ARB_texture_float") || config.extensions.has("GL_OES_texture_float");
+	config.s3tc_supported = config.extensions.has("GL_EXT_texture_compression_s3tc");
+	config.etc1_supported = config.extensions.has("GL_OES_compressed_ETC1_RGB8_texture");
 
 
 	frame.count = 0;
 	frame.count = 0;
 	frame.delta = 0;
 	frame.delta = 0;
 	frame.current_rt = NULL;
 	frame.current_rt = NULL;
 	frame.clear_request = false;
 	frame.clear_request = false;
-	// config.keep_original_textures = false;
 
 
 	glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &config.max_texture_image_units);
 	glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &config.max_texture_image_units);
 	glGetIntegerv(GL_MAX_TEXTURE_SIZE, &config.max_texture_size);
 	glGetIntegerv(GL_MAX_TEXTURE_SIZE, &config.max_texture_size);

+ 1 - 10
drivers/gles2/shader_gles2.cpp

@@ -690,11 +690,6 @@ void ShaderGLES2::use_material(void *p_material) {
 
 
 	Version *v = version_map.getptr(conditional_version);
 	Version *v = version_map.getptr(conditional_version);
 
 
-	CustomCode *cc = NULL;
-	if (v) {
-		cc = custom_code_map.getptr(v->code_version);
-	}
-
 	// bind uniforms
 	// bind uniforms
 	for (Map<StringName, ShaderLanguage::ShaderNode::Uniform>::Element *E = material->shader->uniforms.front(); E; E = E->next()) {
 	for (Map<StringName, ShaderLanguage::ShaderNode::Uniform>::Element *E = material->shader->uniforms.front(); E; E = E->next()) {
 
 
@@ -982,7 +977,7 @@ void ShaderGLES2::use_material(void *p_material) {
 
 
 				value.second.resize(default_arg_size);
 				value.second.resize(default_arg_size);
 
 
-				for (int i = 0; i < default_arg_size; i++) {
+				for (size_t i = 0; i < default_arg_size; i++) {
 					if (is_float) {
 					if (is_float) {
 						value.second.write[i].real = 0.0;
 						value.second.write[i].real = 0.0;
 					} else {
 					} else {
@@ -992,8 +987,6 @@ void ShaderGLES2::use_material(void *p_material) {
 			}
 			}
 		}
 		}
 
 
-		// GLint location = get_uniform_location(E->key());
-
 		GLint location;
 		GLint location;
 		if (v->custom_uniform_locations.has(E->key())) {
 		if (v->custom_uniform_locations.has(E->key())) {
 			location = v->custom_uniform_locations[E->key()];
 			location = v->custom_uniform_locations[E->key()];
@@ -1013,8 +1006,6 @@ void ShaderGLES2::use_material(void *p_material) {
 	int tc = material->textures.size();
 	int tc = material->textures.size();
 	Pair<StringName, RID> *textures = material->textures.ptrw();
 	Pair<StringName, RID> *textures = material->textures.ptrw();
 
 
-	ShaderLanguage::ShaderNode::Uniform::Hint *texture_hints = material->shader->texture_hints.ptrw();
-
 	for (int i = 0; i < tc; i++) {
 	for (int i = 0; i < tc; i++) {
 
 
 		Pair<ShaderLanguage::DataType, Vector<ShaderLanguage::ConstantNode::Value> > value;
 		Pair<ShaderLanguage::DataType, Vector<ShaderLanguage::ConstantNode::Value> > value;

+ 0 - 2
drivers/gles3/rasterizer_canvas_gles3.cpp

@@ -1223,8 +1223,6 @@ void RasterizerCanvasGLES3::canvas_render_items(Item *p_item_list, int p_z, cons
 
 
 	bool rebind_shader = true;
 	bool rebind_shader = true;
 
 
-	Size2 rt_size = Size2(storage->frame.current_rt->width, storage->frame.current_rt->height);
-
 	state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD, false);
 	state.canvas_shader.set_conditional(CanvasShaderGLES3::USE_DISTANCE_FIELD, false);
 
 
 	glBindBuffer(GL_UNIFORM_BUFFER, state.canvas_item_ubo);
 	glBindBuffer(GL_UNIFORM_BUFFER, state.canvas_item_ubo);

+ 4 - 5
drivers/gles3/rasterizer_scene_gles3.cpp

@@ -3036,13 +3036,14 @@ void RasterizerSceneGLES3::_setup_reflections(RID *p_reflection_probe_cull_resul
 			reflection_ubo.ambient[3] = rpi->probe_ptr->interior_ambient_probe_contrib;
 			reflection_ubo.ambient[3] = rpi->probe_ptr->interior_ambient_probe_contrib;
 		} else {
 		} else {
 			Color ambient_linear;
 			Color ambient_linear;
-			float contrib = 0;
+			// FIXME: contrib was retrieved but never used, is it meant to be set as ambient[3]? (GH-20361)
+			//float contrib = 0;
 			if (p_env) {
 			if (p_env) {
 				ambient_linear = p_env->ambient_color.to_linear();
 				ambient_linear = p_env->ambient_color.to_linear();
 				ambient_linear.r *= p_env->ambient_energy;
 				ambient_linear.r *= p_env->ambient_energy;
 				ambient_linear.g *= p_env->ambient_energy;
 				ambient_linear.g *= p_env->ambient_energy;
 				ambient_linear.b *= p_env->ambient_energy;
 				ambient_linear.b *= p_env->ambient_energy;
-				contrib = p_env->ambient_sky_contribution;
+				//contrib = p_env->ambient_sky_contribution;
 			}
 			}
 
 
 			reflection_ubo.ambient[0] = ambient_linear.r;
 			reflection_ubo.ambient[0] = ambient_linear.r;
@@ -4501,7 +4502,7 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
 	RasterizerStorageGLES3::Light *light = storage->light_owner.getornull(light_instance->light);
 	RasterizerStorageGLES3::Light *light = storage->light_owner.getornull(light_instance->light);
 	ERR_FAIL_COND(!light);
 	ERR_FAIL_COND(!light);
 
 
-	uint32_t x, y, width, height, vp_height;
+	uint32_t x, y, width, height;
 
 
 	float dp_direction = 0.0;
 	float dp_direction = 0.0;
 	float zfar = 0;
 	float zfar = 0;
@@ -4583,7 +4584,6 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
 		bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS] * bias_mult;
 		bias = light->param[VS::LIGHT_PARAM_SHADOW_BIAS] * bias_mult;
 		normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
 		normal_bias = light->param[VS::LIGHT_PARAM_SHADOW_NORMAL_BIAS] * bias_mult;
 		fbo = directional_shadow.fbo;
 		fbo = directional_shadow.fbo;
-		vp_height = directional_shadow.size;
 
 
 	} else {
 	} else {
 		//set from shadow atlas
 		//set from shadow atlas
@@ -4593,7 +4593,6 @@ void RasterizerSceneGLES3::render_shadow(RID p_light, RID p_shadow_atlas, int p_
 		ERR_FAIL_COND(!shadow_atlas->shadow_owners.has(p_light));
 		ERR_FAIL_COND(!shadow_atlas->shadow_owners.has(p_light));
 
 
 		fbo = shadow_atlas->fbo;
 		fbo = shadow_atlas->fbo;
-		vp_height = shadow_atlas->size;
 
 
 		uint32_t key = shadow_atlas->shadow_owners[p_light];
 		uint32_t key = shadow_atlas->shadow_owners[p_light];
 
 

+ 1 - 1
drivers/gles3/rasterizer_storage_gles3.cpp

@@ -1072,7 +1072,7 @@ Ref<Image> RasterizerStorageGLES3::texture_get_data(RID p_texture, int p_layer)
 		uint32_t *ptr = (uint32_t *)wb.ptr();
 		uint32_t *ptr = (uint32_t *)wb.ptr();
 		uint32_t num_pixels = data_size / 4;
 		uint32_t num_pixels = data_size / 4;
 
 
-		for (int ofs = 0; ofs < num_pixels; ofs++) {
+		for (uint32_t ofs = 0; ofs < num_pixels; ofs++) {
 			uint32_t px = ptr[ofs];
 			uint32_t px = ptr[ofs];
 			uint32_t a = px >> 30 & 0xFF;
 			uint32_t a = px >> 30 & 0xFF;
 
 

+ 1 - 1
drivers/pulseaudio/audio_driver_pulseaudio.cpp

@@ -340,7 +340,7 @@ void AudioDriverPulseAudio::thread_func(void *p_udata) {
 					unsigned int out_idx = 0;
 					unsigned int out_idx = 0;
 
 
 					for (unsigned int i = 0; i < ad->buffer_frames; i++) {
 					for (unsigned int i = 0; i < ad->buffer_frames; i++) {
-						for (unsigned int j = 0; j < ad->pa_map.channels - 1; j++) {
+						for (int j = 0; j < ad->pa_map.channels - 1; j++) {
 							ad->samples_out.write[out_idx++] = ad->samples_in[in_idx++] >> 16;
 							ad->samples_out.write[out_idx++] = ad->samples_in[in_idx++] >> 16;
 						}
 						}
 						uint32_t l = ad->samples_in[in_idx++];
 						uint32_t l = ad->samples_in[in_idx++];

+ 1 - 1
drivers/unix/net_socket_posix.cpp

@@ -559,7 +559,7 @@ void NetSocketPosix::set_ipv6_only_enabled(bool p_enabled) {
 
 
 void NetSocketPosix::set_tcp_no_delay_enabled(bool p_enabled) {
 void NetSocketPosix::set_tcp_no_delay_enabled(bool p_enabled) {
 	ERR_FAIL_COND(!is_open());
 	ERR_FAIL_COND(!is_open());
-	ERR_FAIL_COND(_ip_type != TYPE_TCP);
+	ERR_FAIL_COND(!_is_stream); // Not TCP
 
 
 	int par = p_enabled ? 1 : 0;
 	int par = p_enabled ? 1 : 0;
 	if (setsockopt(_sock, IPPROTO_TCP, TCP_NODELAY, SOCK_CBUF(&par), sizeof(int)) < 0) {
 	if (setsockopt(_sock, IPPROTO_TCP, TCP_NODELAY, SOCK_CBUF(&par), sizeof(int)) < 0) {

+ 1 - 3
editor/animation_track_editor.cpp

@@ -29,6 +29,7 @@
 /*************************************************************************/
 /*************************************************************************/
 
 
 #include "animation_track_editor.h"
 #include "animation_track_editor.h"
+
 #include "animation_track_editor_plugins.h"
 #include "animation_track_editor_plugins.h"
 #include "core/os/keyboard.h"
 #include "core/os/keyboard.h"
 #include "editor/animation_bezier_editor.h"
 #include "editor/animation_bezier_editor.h"
@@ -772,9 +773,6 @@ void AnimationTimelineEdit::_notification(int p_what) {
 		hsize_rect = Rect2(get_name_limit() - hsize_icon->get_width() - 2 * EDSCALE, (get_size().height - hsize_icon->get_height()) / 2, hsize_icon->get_width(), hsize_icon->get_height());
 		hsize_rect = Rect2(get_name_limit() - hsize_icon->get_width() - 2 * EDSCALE, (get_size().height - hsize_icon->get_height()) / 2, hsize_icon->get_width(), hsize_icon->get_height());
 		draw_texture(hsize_icon, hsize_rect.position);
 		draw_texture(hsize_icon, hsize_rect.position);
 
 
-		float keys_from = get_value();
-		float keys_to = keys_from + zoomw / scale;
-
 		{
 		{
 			float time_min = 0;
 			float time_min = 0;
 			float time_max = animation->get_length();
 			float time_max = animation->get_length();

+ 0 - 5
editor/editor_inspector.cpp

@@ -267,11 +267,6 @@ void EditorProperty::_notification(int p_what) {
 		} else {
 		} else {
 			keying_rect = Rect2();
 			keying_rect = Rect2();
 		}
 		}
-
-		//int vs = get_constant("vseparation", "Tree");
-		Color guide_color = get_color("guide_color", "Tree");
-		int vs_height = get_size().height; // vs / 2;
-		//	draw_line(Point2(0, vs_height), Point2(get_size().width, vs_height), guide_color);
 	}
 	}
 }
 }
 
 

+ 2 - 1
editor/editor_plugin.cpp

@@ -39,6 +39,7 @@
 #include "scene/3d/camera.h"
 #include "scene/3d/camera.h"
 #include "scene/gui/popup_menu.h"
 #include "scene/gui/popup_menu.h"
 #include "servers/visual_server.h"
 #include "servers/visual_server.h"
+
 Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_size) {
 Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_size) {
 
 
 	Vector<Ref<Mesh> > meshes;
 	Vector<Ref<Mesh> > meshes;
@@ -522,7 +523,7 @@ int EditorPlugin::update_overlays() const {
 
 
 	if (SpatialEditor::get_singleton()->is_visible()) {
 	if (SpatialEditor::get_singleton()->is_visible()) {
 		int count = 0;
 		int count = 0;
-		for (int i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) {
+		for (uint32_t i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) {
 			SpatialEditorViewport *vp = SpatialEditor::get_singleton()->get_editor_viewport(i);
 			SpatialEditorViewport *vp = SpatialEditor::get_singleton()->get_editor_viewport(i);
 			if (vp->is_visible()) {
 			if (vp->is_visible()) {
 				vp->update_surface();
 				vp->update_surface();

+ 1 - 1
editor/editor_properties_array_dict.cpp

@@ -744,7 +744,7 @@ void EditorPropertyDictionary::update_property() {
 			page->connect("value_changed", this, "_page_changed");
 			page->connect("value_changed", this, "_page_changed");
 		} else {
 		} else {
 			// Queue childs for deletion, delete immediately might cause errors.
 			// Queue childs for deletion, delete immediately might cause errors.
-			for (size_t i = 1; i < vbox->get_child_count(); i++) {
+			for (int i = 1; i < vbox->get_child_count(); i++) {
 				vbox->get_child(i)->queue_delete();
 				vbox->get_child(i)->queue_delete();
 			}
 			}
 		}
 		}

+ 3 - 11
editor/editor_themes.cpp

@@ -36,7 +36,6 @@
 #include "editor_scale.h"
 #include "editor_scale.h"
 #include "editor_settings.h"
 #include "editor_settings.h"
 #include "modules/svg/image_loader_svg.h"
 #include "modules/svg/image_loader_svg.h"
-#include "time.h"
 
 
 static Ref<StyleBoxTexture> make_stylebox(Ref<Texture> p_texture, float p_left, float p_top, float p_right, float p_botton, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_botton = -1, bool p_draw_center = true) {
 static Ref<StyleBoxTexture> make_stylebox(Ref<Texture> p_texture, float p_left, float p_top, float p_right, float p_botton, float p_margin_left = -1, float p_margin_top = -1, float p_margin_right = -1, float p_margin_botton = -1, bool p_draw_center = true) {
 	Ref<StyleBoxTexture> style(memnew(StyleBoxTexture));
 	Ref<StyleBoxTexture> style(memnew(StyleBoxTexture));
@@ -199,8 +198,6 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme =
 	exceptions.push_back("StatusWarning");
 	exceptions.push_back("StatusWarning");
 	exceptions.push_back("NodeWarning");
 	exceptions.push_back("NodeWarning");
 
 
-	clock_t begin_time = clock();
-
 	ImageLoaderSVG::set_convert_colors(&dark_icon_color_dictionary);
 	ImageLoaderSVG::set_convert_colors(&dark_icon_color_dictionary);
 
 
 	// generate icons
 	// generate icons
@@ -235,8 +232,6 @@ void editor_register_and_generate_icons(Ref<Theme> p_theme, bool p_dark_theme =
 	}
 	}
 
 
 	ImageLoaderSVG::set_convert_colors(NULL);
 	ImageLoaderSVG::set_convert_colors(NULL);
-
-	clock_t end_time = clock();
 #else
 #else
 	print_line("SVG support disabled, editor icons won't be rendered.");
 	print_line("SVG support disabled, editor icons won't be rendered.");
 #endif
 #endif
@@ -260,8 +255,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
 
 
 	bool use_gn_headers = EDITOR_DEF("interface/theme/use_graph_node_headers", false);
 	bool use_gn_headers = EDITOR_DEF("interface/theme/use_graph_node_headers", false);
 
 
-	Color script_bg_color = EDITOR_DEF("text_editor/highlighting/background_color", Color(0, 0, 0, 0));
-
 	Color preset_accent_color;
 	Color preset_accent_color;
 	Color preset_base_color;
 	Color preset_base_color;
 	float preset_contrast;
 	float preset_contrast;
@@ -1069,8 +1062,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
 	const float mono_value = mono_color.r;
 	const float mono_value = mono_color.r;
 	const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.07);
 	const Color alpha1 = Color(mono_value, mono_value, mono_value, 0.07);
 	const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.14);
 	const Color alpha2 = Color(mono_value, mono_value, mono_value, 0.14);
-	const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.5);
-	const Color alpha4 = Color(mono_value, mono_value, mono_value, 0.7);
+	const Color alpha3 = Color(mono_value, mono_value, mono_value, 0.7);
 
 
 	// editor main color
 	// editor main color
 	const Color main_color = Color::html(dark_theme ? "#57b3ff" : "#0480ff");
 	const Color main_color = Color::html(dark_theme ? "#57b3ff" : "#0480ff");
@@ -1104,9 +1096,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
 	const Color member_variable_color = main_color.linear_interpolate(mono_color, 0.6);
 	const Color member_variable_color = main_color.linear_interpolate(mono_color, 0.6);
 	const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3);
 	const Color mark_color = Color(error_color.r, error_color.g, error_color.b, 0.3);
 	const Color breakpoint_color = error_color;
 	const Color breakpoint_color = error_color;
-	const Color code_folding_color = alpha4;
+	const Color code_folding_color = alpha3;
 	const Color search_result_color = alpha1;
 	const Color search_result_color = alpha1;
-	const Color search_result_border_color = alpha4;
+	const Color search_result_border_color = alpha3;
 
 
 	EditorSettings *setting = EditorSettings::get_singleton();
 	EditorSettings *setting = EditorSettings::get_singleton();
 	String text_editor_color_theme = setting->get("text_editor/theme/color_theme");
 	String text_editor_color_theme = setting->get("text_editor/theme/color_theme");

+ 6 - 6
editor/import/editor_scene_importer_gltf.cpp

@@ -1910,15 +1910,15 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
 		NodePath node_path;
 		NodePath node_path;
 
 
 		GLTFNode *node = state.nodes[E->key()];
 		GLTFNode *node = state.nodes[E->key()];
-		for (int i = 0; i < node->godot_nodes.size(); i++) {
+		for (int n = 0; n < node->godot_nodes.size(); n++) {
 
 
 			if (node->joints.size()) {
 			if (node->joints.size()) {
-				Skeleton *sk = (Skeleton *)node->godot_nodes[i];
+				Skeleton *sk = (Skeleton *)node->godot_nodes[n];
 				String path = ap->get_parent()->get_path_to(sk);
 				String path = ap->get_parent()->get_path_to(sk);
-				String bone = sk->get_bone_name(node->joints[i].godot_bone_index);
+				String bone = sk->get_bone_name(node->joints[n].godot_bone_index);
 				node_path = path + ":" + bone;
 				node_path = path + ":" + bone;
 			} else {
 			} else {
-				node_path = ap->get_parent()->get_path_to(node->godot_nodes[i]);
+				node_path = ap->get_parent()->get_path_to(node->godot_nodes[n]);
 			}
 			}
 
 
 			for (int i = 0; i < track.rotation_track.times.size(); i++) {
 			for (int i = 0; i < track.rotation_track.times.size(); i++) {
@@ -1993,8 +1993,8 @@ void EditorSceneImporterGLTF::_import_animation(GLTFState &state, AnimationPlaye
 						xform.basis.set_quat_scale(rot, scale);
 						xform.basis.set_quat_scale(rot, scale);
 						xform.origin = pos;
 						xform.origin = pos;
 
 
-						Skeleton *skeleton = skeletons[node->joints[i].skin];
-						int bone = node->joints[i].godot_bone_index;
+						Skeleton *skeleton = skeletons[node->joints[n].skin];
+						int bone = node->joints[n].godot_bone_index;
 						xform = skeleton->get_bone_rest(bone).affine_inverse() * xform;
 						xform = skeleton->get_bone_rest(bone).affine_inverse() * xform;
 
 
 						rot = xform.basis.get_rotation_quat();
 						rot = xform.basis.get_rotation_quat();

+ 0 - 13
editor/plugins/animation_blend_tree_editor_plugin.cpp

@@ -131,10 +131,6 @@ void AnimationNodeBlendTreeEditor::_update_graph() {
 
 
 		Ref<AnimationNode> agnode = blend_tree->get_node(E->get());
 		Ref<AnimationNode> agnode = blend_tree->get_node(E->get());
 
 
-		if (!agnode->is_connected("changed", this, "_node_changed")) {
-			agnode->connect("changed", this, "_node_changed", varray(agnode->get_instance_id()), CONNECT_DEFERRED);
-		}
-
 		node->set_offset(blend_tree->get_node_position(E->get()) * EDSCALE);
 		node->set_offset(blend_tree->get_node_position(E->get()) * EDSCALE);
 
 
 		node->set_title(agnode->get_caption());
 		node->set_title(agnode->get_caption());
@@ -721,14 +717,6 @@ void AnimationNodeBlendTreeEditor::_scroll_changed(const Vector2 &p_scroll) {
 	updating = false;
 	updating = false;
 }
 }
 
 
-void AnimationNodeBlendTreeEditor::_node_changed(ObjectID p_node) {
-
-	AnimationNode *an = Object::cast_to<AnimationNode>(ObjectDB::get_instance(p_node));
-	//if (an && an->get_parent() == blend_tree) {
-	_update_graph();
-	//}
-}
-
 void AnimationNodeBlendTreeEditor::_bind_methods() {
 void AnimationNodeBlendTreeEditor::_bind_methods() {
 
 
 	ClassDB::bind_method("_update_graph", &AnimationNodeBlendTreeEditor::_update_graph);
 	ClassDB::bind_method("_update_graph", &AnimationNodeBlendTreeEditor::_update_graph);
@@ -746,7 +734,6 @@ void AnimationNodeBlendTreeEditor::_bind_methods() {
 	ClassDB::bind_method("_update_filters", &AnimationNodeBlendTreeEditor::_update_filters);
 	ClassDB::bind_method("_update_filters", &AnimationNodeBlendTreeEditor::_update_filters);
 	ClassDB::bind_method("_filter_edited", &AnimationNodeBlendTreeEditor::_filter_edited);
 	ClassDB::bind_method("_filter_edited", &AnimationNodeBlendTreeEditor::_filter_edited);
 	ClassDB::bind_method("_filter_toggled", &AnimationNodeBlendTreeEditor::_filter_toggled);
 	ClassDB::bind_method("_filter_toggled", &AnimationNodeBlendTreeEditor::_filter_toggled);
-	ClassDB::bind_method("_node_changed", &AnimationNodeBlendTreeEditor::_node_changed);
 	ClassDB::bind_method("_removed_from_graph", &AnimationNodeBlendTreeEditor::_removed_from_graph);
 	ClassDB::bind_method("_removed_from_graph", &AnimationNodeBlendTreeEditor::_removed_from_graph);
 	ClassDB::bind_method("_property_changed", &AnimationNodeBlendTreeEditor::_property_changed);
 	ClassDB::bind_method("_property_changed", &AnimationNodeBlendTreeEditor::_property_changed);
 	ClassDB::bind_method("_file_opened", &AnimationNodeBlendTreeEditor::_file_opened);
 	ClassDB::bind_method("_file_opened", &AnimationNodeBlendTreeEditor::_file_opened);

+ 0 - 2
editor/plugins/animation_blend_tree_editor_plugin.h

@@ -104,8 +104,6 @@ class AnimationNodeBlendTreeEditor : public AnimationTreeNodeEditorPlugin {
 	void _filter_toggled();
 	void _filter_toggled();
 	Ref<AnimationNode> _filter_edit;
 	Ref<AnimationNode> _filter_edit;
 
 
-	void _node_changed(ObjectID p_node);
-
 	void _property_changed(const StringName &p_property, const Variant &p_value);
 	void _property_changed(const StringName &p_property, const Variant &p_value);
 	void _removed_from_graph();
 	void _removed_from_graph();
 
 

+ 0 - 1
editor/plugins/collision_shape_2d_editor_plugin.cpp

@@ -323,7 +323,6 @@ bool CollisionShape2DEditor::forward_canvas_gui_input(const Ref<InputEvent> &p_e
 	if (mb.is_valid()) {
 	if (mb.is_valid()) {
 
 
 		Vector2 gpoint = mb->get_position();
 		Vector2 gpoint = mb->get_position();
-		Vector2 cpoint = node->get_global_transform().affine_inverse().xform(canvas_item_editor->snap_point(canvas_item_editor->get_canvas_transform().affine_inverse().xform(mb->get_position())));
 
 
 		if (mb->get_button_index() == BUTTON_LEFT) {
 		if (mb->get_button_index() == BUTTON_LEFT) {
 			if (mb->is_pressed()) {
 			if (mb->is_pressed()) {

+ 0 - 8
editor/plugins/mesh_editor_plugin.cpp

@@ -65,14 +65,6 @@ void MeshEditor::_notification(int p_what) {
 			first_enter = false;
 			first_enter = false;
 		}
 		}
 	}
 	}
-
-	if (p_what == NOTIFICATION_DRAW) {
-
-		Ref<Texture> checkerboard = get_icon("Checkerboard", "EditorIcons");
-		Size2 size = get_size();
-
-		//draw_texture_rect(checkerboard, Rect2(Point2(), size), true);
-	}
 }
 }
 
 
 void MeshEditor::_update_rotation() {
 void MeshEditor::_update_rotation() {

+ 0 - 1
editor/plugins/script_text_editor.cpp

@@ -1276,7 +1276,6 @@ void ScriptTextEditor::_text_edit_gui_input(const Ref<InputEvent> &ev) {
 				word_at_mouse = tx->get_selection_text();
 				word_at_mouse = tx->get_selection_text();
 
 
 			bool has_color = (word_at_mouse == "Color");
 			bool has_color = (word_at_mouse == "Color");
-			int fold_state = 0;
 			bool foldable = tx->can_fold(row) || tx->is_folded(row);
 			bool foldable = tx->can_fold(row) || tx->is_folded(row);
 			bool open_docs = false;
 			bool open_docs = false;
 			bool goto_definition = false;
 			bool goto_definition = false;

+ 0 - 20
editor/plugins/shader_editor_plugin.cpp

@@ -86,10 +86,7 @@ void ShaderTextEditor::_load_theme_settings() {
 	Color search_result_border_color = EDITOR_GET("text_editor/highlighting/search_result_border_color");
 	Color search_result_border_color = EDITOR_GET("text_editor/highlighting/search_result_border_color");
 	Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color");
 	Color symbol_color = EDITOR_GET("text_editor/highlighting/symbol_color");
 	Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color");
 	Color keyword_color = EDITOR_GET("text_editor/highlighting/keyword_color");
-	Color basetype_color = EDITOR_GET("text_editor/highlighting/base_type_color");
-	Color type_color = EDITOR_GET("text_editor/highlighting/engine_type_color");
 	Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color");
 	Color comment_color = EDITOR_GET("text_editor/highlighting/comment_color");
-	Color string_color = EDITOR_GET("text_editor/highlighting/string_color");
 
 
 	get_text_edit()->add_color_override("background_color", background_color);
 	get_text_edit()->add_color_override("background_color", background_color);
 	get_text_edit()->add_color_override("completion_background_color", completion_background_color);
 	get_text_edit()->add_color_override("completion_background_color", completion_background_color);
@@ -140,26 +137,9 @@ void ShaderTextEditor::_load_theme_settings() {
 		get_text_edit()->add_keyword_color(E->get(), keyword_color);
 		get_text_edit()->add_keyword_color(E->get(), keyword_color);
 	}
 	}
 
 
-	//colorize core types
-	//Color basetype_color= EDITOR_DEF("text_editor/base_type_color",Color(0.3,0.3,0.0));
-
 	//colorize comments
 	//colorize comments
 	get_text_edit()->add_color_region("/*", "*/", comment_color, false);
 	get_text_edit()->add_color_region("/*", "*/", comment_color, false);
 	get_text_edit()->add_color_region("//", "", comment_color, false);
 	get_text_edit()->add_color_region("//", "", comment_color, false);
-
-	/*//colorize strings
-	Color string_color = EDITOR_DEF("text_editor/string_color",Color::hex(0x6b6f00ff));
-
-	List<String> strings;
-	shader->get_shader_mode()->get_string_delimiters(&strings);
-
-	for (List<String>::Element *E=strings.front();E;E=E->next()) {
-
-		String string = E->get();
-		String beg = string.get_slice(" ",0);
-		String end = string.get_slice_count(" ")>1?string.get_slice(" ",1):String();
-		get_text_edit()->add_color_region(beg,end,string_color,end=="");
-	}*/
 }
 }
 
 
 void ShaderTextEditor::_check_shader_mode() {
 void ShaderTextEditor::_check_shader_mode() {

+ 2 - 1
editor/plugins/skeleton_editor_plugin.cpp

@@ -29,9 +29,10 @@
 /*************************************************************************/
 /*************************************************************************/
 
 
 #include "skeleton_editor_plugin.h"
 #include "skeleton_editor_plugin.h"
+
 #include "scene/3d/collision_shape.h"
 #include "scene/3d/collision_shape.h"
 #include "scene/3d/physics_body.h"
 #include "scene/3d/physics_body.h"
-#include "scene/3d/physics_joint.h";
+#include "scene/3d/physics_joint.h"
 #include "scene/resources/capsule_shape.h"
 #include "scene/resources/capsule_shape.h"
 #include "scene/resources/sphere_shape.h"
 #include "scene/resources/sphere_shape.h"
 #include "spatial_editor_plugin.h"
 #include "spatial_editor_plugin.h"

+ 11 - 14
editor/plugins/spatial_editor_plugin.cpp

@@ -2075,7 +2075,7 @@ void SpatialEditorViewport::set_message(String p_message, float p_time) {
 }
 }
 
 
 void SpatialEditorPlugin::edited_scene_changed() {
 void SpatialEditorPlugin::edited_scene_changed() {
-	for (int i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) {
+	for (uint32_t i = 0; i < SpatialEditor::VIEWPORTS_COUNT; i++) {
 		SpatialEditorViewport *viewport = SpatialEditor::get_singleton()->get_editor_viewport(i);
 		SpatialEditorViewport *viewport = SpatialEditor::get_singleton()->get_editor_viewport(i);
 		if (viewport->is_visible()) {
 		if (viewport->is_visible()) {
 			viewport->notification(Control::NOTIFICATION_VISIBILITY_CHANGED);
 			viewport->notification(Control::NOTIFICATION_VISIBILITY_CHANGED);
@@ -2199,7 +2199,7 @@ void SpatialEditorViewport::_notification(int p_what) {
 
 
 		bool shrink = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_HALF_RESOLUTION));
 		bool shrink = view_menu->get_popup()->is_item_checked(view_menu->get_popup()->get_item_index(VIEW_HALF_RESOLUTION));
 
 
-		if (shrink != viewport_container->get_stretch_shrink() > 1) {
+		if (shrink != (viewport_container->get_stretch_shrink() > 1)) {
 			viewport_container->set_stretch_shrink(shrink ? 2 : 1);
 			viewport_container->set_stretch_shrink(shrink ? 2 : 1);
 		}
 		}
 
 
@@ -4093,7 +4093,7 @@ void SpatialEditor::set_state(const Dictionary &p_state) {
 		for (int j = 0; j < gizmo_plugins.size(); ++j) {
 		for (int j = 0; j < gizmo_plugins.size(); ++j) {
 			if (!gizmo_plugins[j]->can_be_hidden()) continue;
 			if (!gizmo_plugins[j]->can_be_hidden()) continue;
 			int state = EditorSpatialGizmoPlugin::ON_TOP;
 			int state = EditorSpatialGizmoPlugin::ON_TOP;
-			for (uint32_t i = 0; i < keys.size(); i++) {
+			for (int i = 0; i < keys.size(); i++) {
 				if (gizmo_plugins.write[j]->get_name() == keys[i]) {
 				if (gizmo_plugins.write[j]->get_name() == keys[i]) {
 					state = gizmos_status[keys[i]];
 					state = gizmos_status[keys[i]];
 				}
 				}
@@ -4979,32 +4979,29 @@ void SpatialEditor::_unhandled_key_input(Ref<InputEvent> p_event) {
 			if (!k->is_pressed())
 			if (!k->is_pressed())
 				return;
 				return;
 
 
-			if (ED_IS_SHORTCUT("spatial_editor/tool_select", p_event))
+			if (ED_IS_SHORTCUT("spatial_editor/tool_select", p_event)) {
 				_menu_item_pressed(MENU_TOOL_SELECT);
 				_menu_item_pressed(MENU_TOOL_SELECT);
-
-			else if (ED_IS_SHORTCUT("spatial_editor/tool_move", p_event))
+			} else if (ED_IS_SHORTCUT("spatial_editor/tool_move", p_event)) {
 				_menu_item_pressed(MENU_TOOL_MOVE);
 				_menu_item_pressed(MENU_TOOL_MOVE);
-
-			else if (ED_IS_SHORTCUT("spatial_editor/tool_rotate", p_event))
+			} else if (ED_IS_SHORTCUT("spatial_editor/tool_rotate", p_event)) {
 				_menu_item_pressed(MENU_TOOL_ROTATE);
 				_menu_item_pressed(MENU_TOOL_ROTATE);
-
-			else if (ED_IS_SHORTCUT("spatial_editor/tool_scale", p_event))
+			} else if (ED_IS_SHORTCUT("spatial_editor/tool_scale", p_event)) {
 				_menu_item_pressed(MENU_TOOL_SCALE);
 				_menu_item_pressed(MENU_TOOL_SCALE);
-			else if (ED_IS_SHORTCUT("spatial_editor/snap_to_floor", p_event))
+			} else if (ED_IS_SHORTCUT("spatial_editor/snap_to_floor", p_event)) {
 				snap_selected_nodes_to_floor();
 				snap_selected_nodes_to_floor();
-
-			else if (ED_IS_SHORTCUT("spatial_editor/local_coords", p_event))
+			} else if (ED_IS_SHORTCUT("spatial_editor/local_coords", p_event)) {
 				if (are_local_coords_enabled()) {
 				if (are_local_coords_enabled()) {
 					_menu_item_toggled(false, MENU_TOOL_LOCAL_COORDS);
 					_menu_item_toggled(false, MENU_TOOL_LOCAL_COORDS);
 				} else {
 				} else {
 					_menu_item_toggled(true, MENU_TOOL_LOCAL_COORDS);
 					_menu_item_toggled(true, MENU_TOOL_LOCAL_COORDS);
 				}
 				}
-			else if (ED_IS_SHORTCUT("spatial_editor/snap", p_event))
+			} else if (ED_IS_SHORTCUT("spatial_editor/snap", p_event)) {
 				if (is_snap_enabled()) {
 				if (is_snap_enabled()) {
 					_menu_item_toggled(false, MENU_TOOL_USE_SNAP);
 					_menu_item_toggled(false, MENU_TOOL_USE_SNAP);
 				} else {
 				} else {
 					_menu_item_toggled(true, MENU_TOOL_USE_SNAP);
 					_menu_item_toggled(true, MENU_TOOL_USE_SNAP);
 				}
 				}
+			}
 		}
 		}
 	}
 	}
 }
 }

+ 1 - 1
editor/plugins/spatial_editor_plugin.h

@@ -86,7 +86,7 @@ public:
 
 
 	Vector<Vector3> handles;
 	Vector<Vector3> handles;
 	Vector<Vector3> secondary_handles;
 	Vector<Vector3> secondary_handles;
-	float selectable_icon_size = -1.0f;
+	float selectable_icon_size;
 	bool billboard_handle;
 	bool billboard_handle;
 
 
 	bool valid;
 	bool valid;

+ 1 - 1
editor/plugins/sprite_editor_plugin.cpp

@@ -97,7 +97,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 (int i = 0; i < p2->Contour.size(); i++) {
+	for (unsigned int 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) {

+ 1 - 0
editor/spatial_editor_gizmos.cpp

@@ -715,6 +715,7 @@ EditorSpatialGizmo::EditorSpatialGizmo() {
 	instanced = false;
 	instanced = false;
 	spatial_node = NULL;
 	spatial_node = NULL;
 	gizmo_plugin = NULL;
 	gizmo_plugin = NULL;
+	selectable_icon_size = -1.0f;
 }
 }
 
 
 EditorSpatialGizmo::~EditorSpatialGizmo() {
 EditorSpatialGizmo::~EditorSpatialGizmo() {

+ 4 - 3
main/input_default.cpp

@@ -343,9 +343,9 @@ void InputDefault::_parse_input_event_impl(const Ref<InputEvent> &p_event, bool
 				button_event->set_pressed(st->is_pressed());
 				button_event->set_pressed(st->is_pressed());
 				button_event->set_button_index(BUTTON_LEFT);
 				button_event->set_button_index(BUTTON_LEFT);
 				if (st->is_pressed()) {
 				if (st->is_pressed()) {
-					button_event->set_button_mask(mouse_button_mask | (1 << BUTTON_LEFT - 1));
+					button_event->set_button_mask(mouse_button_mask | (1 << (BUTTON_LEFT - 1)));
 				} else {
 				} else {
-					button_event->set_button_mask(mouse_button_mask & ~(1 << BUTTON_LEFT - 1));
+					button_event->set_button_mask(mouse_button_mask & ~(1 << (BUTTON_LEFT - 1)));
 				}
 				}
 
 
 				_parse_input_event_impl(button_event, true);
 				_parse_input_event_impl(button_event, true);
@@ -576,7 +576,7 @@ void InputDefault::ensure_touch_mouse_raised() {
 		button_event->set_global_position(mouse_pos);
 		button_event->set_global_position(mouse_pos);
 		button_event->set_pressed(false);
 		button_event->set_pressed(false);
 		button_event->set_button_index(BUTTON_LEFT);
 		button_event->set_button_index(BUTTON_LEFT);
-		button_event->set_button_mask(mouse_button_mask & ~(1 << BUTTON_LEFT - 1));
+		button_event->set_button_mask(mouse_button_mask & ~(1 << (BUTTON_LEFT - 1)));
 
 
 		_parse_input_event_impl(button_event, true);
 		_parse_input_event_impl(button_event, true);
 	}
 	}
@@ -636,6 +636,7 @@ InputDefault::InputDefault() {
 	emulate_mouse_from_touch = false;
 	emulate_mouse_from_touch = false;
 	mouse_from_touch_index = -1;
 	mouse_from_touch_index = -1;
 	main_loop = NULL;
 	main_loop = NULL;
+	default_shape = CURSOR_ARROW;
 
 
 	hat_map_default[HAT_UP].type = TYPE_BUTTON;
 	hat_map_default[HAT_UP].type = TYPE_BUTTON;
 	hat_map_default[HAT_UP].index = JOY_DPAD_UP;
 	hat_map_default[HAT_UP].index = JOY_DPAD_UP;

+ 2 - 1
main/input_default.h

@@ -119,7 +119,8 @@ class InputDefault : public Input {
 	SpeedTrack mouse_speed_track;
 	SpeedTrack mouse_speed_track;
 	Map<int, Joypad> joy_names;
 	Map<int, Joypad> joy_names;
 	int fallback_mapping;
 	int fallback_mapping;
-	CursorShape default_shape = CURSOR_ARROW;
+
+	CursorShape default_shape;
 
 
 public:
 public:
 	enum HatMask {
 	enum HatMask {

+ 0 - 1
main/main.cpp

@@ -129,7 +129,6 @@ static bool init_always_on_top = false;
 static bool init_use_custom_pos = false;
 static bool init_use_custom_pos = false;
 static Vector2 init_custom_pos;
 static Vector2 init_custom_pos;
 static bool force_lowdpi = false;
 static bool force_lowdpi = false;
-static bool use_vsync = true;
 
 
 // Debug
 // Debug
 
 

+ 0 - 2
modules/bullet/bullet_types_converter.cpp

@@ -28,8 +28,6 @@
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
 /*************************************************************************/
 /*************************************************************************/
 
 
-#pragma once
-
 #include "bullet_types_converter.h"
 #include "bullet_types_converter.h"
 
 
 /**
 /**

+ 3 - 6
modules/cvtt/image_compress_cvtt.cpp

@@ -118,7 +118,7 @@ static void _digest_row_task(const CVTTCompressionJobParams &p_job_params, const
 			cvtt::Kernels::EncodeBC7(output_blocks, input_blocks_ldr, p_job_params.options);
 			cvtt::Kernels::EncodeBC7(output_blocks, input_blocks_ldr, p_job_params.options);
 		}
 		}
 
 
-		int num_real_blocks = ((w - x_start) + 3) / 4;
+		unsigned int num_real_blocks = ((w - x_start) + 3) / 4;
 		if (num_real_blocks > cvtt::NumParallelBlocks) {
 		if (num_real_blocks > cvtt::NumParallelBlocks) {
 			num_real_blocks = cvtt::NumParallelBlocks;
 			num_real_blocks = cvtt::NumParallelBlocks;
 		}
 		}
@@ -131,7 +131,7 @@ static void _digest_row_task(const CVTTCompressionJobParams &p_job_params, const
 static void _digest_job_queue(void *p_job_queue) {
 static void _digest_job_queue(void *p_job_queue) {
 	CVTTCompressionJobQueue *job_queue = static_cast<CVTTCompressionJobQueue *>(p_job_queue);
 	CVTTCompressionJobQueue *job_queue = static_cast<CVTTCompressionJobQueue *>(p_job_queue);
 
 
-	for (int next_task = atomic_increment(&job_queue->current_task); next_task <= job_queue->num_tasks; next_task = atomic_increment(&job_queue->current_task)) {
+	for (uint32_t next_task = atomic_increment(&job_queue->current_task); next_task <= job_queue->num_tasks; next_task = atomic_increment(&job_queue->current_task)) {
 		_digest_row_task(job_queue->job_params, job_queue->job_tasks[next_task - 1]);
 		_digest_row_task(job_queue->job_params, job_queue->job_tasks[next_task - 1]);
 	}
 	}
 }
 }
@@ -228,8 +228,6 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::CompressS
 		uint8_t *out_bytes = &wb[dst_ofs];
 		uint8_t *out_bytes = &wb[dst_ofs];
 
 
 		for (int y_start = 0; y_start < h; y_start += 4) {
 		for (int y_start = 0; y_start < h; y_start += 4) {
-			int y_end = y_start + 4;
-
 			CVTTCompressionRowTask row_task;
 			CVTTCompressionRowTask row_task;
 			row_task.width = w;
 			row_task.width = w;
 			row_task.height = h;
 			row_task.height = h;
@@ -308,7 +306,6 @@ void image_decompress_cvtt(Image *p_image) {
 	int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps());
 	int target_size = Image::get_image_data_size(w, h, target_format, p_image->has_mipmaps());
 	int mm_count = p_image->get_mipmap_count();
 	int mm_count = p_image->get_mipmap_count();
 	data.resize(target_size);
 	data.resize(target_size);
-	int shift = Image::get_format_pixel_rshift(target_format);
 
 
 	PoolVector<uint8_t>::Write wb = data.write();
 	PoolVector<uint8_t>::Write wb = data.write();
 
 
@@ -335,7 +332,7 @@ void image_decompress_cvtt(Image *p_image) {
 				uint8_t input_blocks[16 * cvtt::NumParallelBlocks];
 				uint8_t input_blocks[16 * cvtt::NumParallelBlocks];
 				memset(input_blocks, 0, sizeof(input_blocks));
 				memset(input_blocks, 0, sizeof(input_blocks));
 
 
-				int num_real_blocks = ((w - x_start) + 3) / 4;
+				unsigned int num_real_blocks = ((w - x_start) + 3) / 4;
 				if (num_real_blocks > cvtt::NumParallelBlocks) {
 				if (num_real_blocks > cvtt::NumParallelBlocks) {
 					num_real_blocks = cvtt::NumParallelBlocks;
 					num_real_blocks = cvtt::NumParallelBlocks;
 				}
 				}

+ 1 - 1
modules/etc/image_etc.cpp

@@ -174,7 +174,7 @@ static void _compress_etc(Image *p_img, float p_lossy_quality, bool force_etc1_f
 
 
 	PoolVector<uint8_t>::Read r = img->get_data().read();
 	PoolVector<uint8_t>::Read r = img->get_data().read();
 
 
-	int target_size = Image::get_image_data_size(imgw, imgh, etc_format, p_img->has_mipmaps());
+	unsigned int target_size = Image::get_image_data_size(imgw, imgh, etc_format, p_img->has_mipmaps());
 	int mmc = 1 + (p_img->has_mipmaps() ? Image::get_image_required_mipmaps(imgw, imgh, etc_format) : 0);
 	int mmc = 1 + (p_img->has_mipmaps() ? Image::get_image_required_mipmaps(imgw, imgh, etc_format) : 0);
 
 
 	PoolVector<uint8_t> dst_data;
 	PoolVector<uint8_t> dst_data;

+ 6 - 6
modules/gdnative/register_types.cpp

@@ -29,19 +29,19 @@
 /*************************************************************************/
 /*************************************************************************/
 
 
 #include "register_types.h"
 #include "register_types.h"
+
 #include "gdnative/gdnative.h"
 #include "gdnative/gdnative.h"
 
 
 #include "gdnative.h"
 #include "gdnative.h"
 
 
-#include "core/io/resource_loader.h"
-#include "core/io/resource_saver.h"
-
 #include "arvr/register_types.h"
 #include "arvr/register_types.h"
 #include "nativescript/register_types.h"
 #include "nativescript/register_types.h"
 #include "net/register_types.h"
 #include "net/register_types.h"
 #include "pluginscript/register_types.h"
 #include "pluginscript/register_types.h"
 
 
 #include "core/engine.h"
 #include "core/engine.h"
+#include "core/io/resource_loader.h"
+#include "core/io/resource_saver.h"
 #include "core/os/os.h"
 #include "core/os/os.h"
 #include "core/project_settings.h"
 #include "core/project_settings.h"
 
 
@@ -148,7 +148,7 @@ protected:
 };
 };
 
 
 struct LibrarySymbol {
 struct LibrarySymbol {
-	char *name;
+	const char *name;
 	bool is_required;
 	bool is_required;
 };
 };
 
 
@@ -239,7 +239,7 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty
 		String additional_code = "extern void register_dynamic_symbol(char *name, void *address);\n"
 		String additional_code = "extern void register_dynamic_symbol(char *name, void *address);\n"
 								 "extern void add_ios_init_callback(void (*cb)());\n";
 								 "extern void add_ios_init_callback(void (*cb)());\n";
 		String linker_flags = "";
 		String linker_flags = "";
-		for (int i = 0; i < sizeof(expected_symbols) / sizeof(expected_symbols[0]); ++i) {
+		for (unsigned int i = 0; i < sizeof(expected_symbols) / sizeof(expected_symbols[0]); ++i) {
 			String full_name = lib->get_symbol_prefix() + expected_symbols[i].name;
 			String full_name = lib->get_symbol_prefix() + expected_symbols[i].name;
 			String code = declare_pattern.replace("$name", full_name);
 			String code = declare_pattern.replace("$name", full_name);
 			code = code.replace("$weak", expected_symbols[i].is_required ? "" : " __attribute__((weak))");
 			code = code.replace("$weak", expected_symbols[i].is_required ? "" : " __attribute__((weak))");
@@ -255,7 +255,7 @@ void GDNativeExportPlugin::_export_file(const String &p_path, const String &p_ty
 
 
 		additional_code += String("void $prefixinit() {\n").replace("$prefix", lib->get_symbol_prefix());
 		additional_code += String("void $prefixinit() {\n").replace("$prefix", lib->get_symbol_prefix());
 		String register_pattern = "  if (&$name) register_dynamic_symbol((char *)\"$name\", (void *)$name);\n";
 		String register_pattern = "  if (&$name) register_dynamic_symbol((char *)\"$name\", (void *)$name);\n";
-		for (int i = 0; i < sizeof(expected_symbols) / sizeof(expected_symbols[0]); ++i) {
+		for (unsigned int i = 0; i < sizeof(expected_symbols) / sizeof(expected_symbols[0]); ++i) {
 			String full_name = lib->get_symbol_prefix() + expected_symbols[i].name;
 			String full_name = lib->get_symbol_prefix() + expected_symbols[i].name;
 			additional_code += register_pattern.replace("$name", full_name);
 			additional_code += register_pattern.replace("$name", full_name);
 		}
 		}

+ 1 - 1
modules/gdscript/gdscript.h

@@ -147,7 +147,7 @@ public:
 	const Map<StringName, Variant> &get_constants() const { return constants; }
 	const Map<StringName, Variant> &get_constants() const { return constants; }
 	const Set<StringName> &get_members() const { return members; }
 	const Set<StringName> &get_members() const { return members; }
 	const GDScriptDataType &get_member_type(const StringName &p_member) const {
 	const GDScriptDataType &get_member_type(const StringName &p_member) const {
-		ERR_FAIL_COND_V(!member_indices.has(p_member), GDScriptDataType());
+		CRASH_COND(!member_indices.has(p_member));
 		return member_indices[p_member].data_type;
 		return member_indices[p_member].data_type;
 	}
 	}
 	const Map<StringName, GDScriptFunction *> &get_member_functions() const { return member_functions; }
 	const Map<StringName, GDScriptFunction *> &get_member_functions() const { return member_functions; }

+ 0 - 3
modules/gdscript/gdscript_editor.cpp

@@ -33,12 +33,9 @@
 #include "core/engine.h"
 #include "core/engine.h"
 #include "core/global_constants.h"
 #include "core/global_constants.h"
 #include "core/os/file_access.h"
 #include "core/os/file_access.h"
-#include "editor/editor_settings.h"
 #include "gdscript_compiler.h"
 #include "gdscript_compiler.h"
 
 
 #ifdef TOOLS_ENABLED
 #ifdef TOOLS_ENABLED
-#include "core/engine.h"
-#include "core/reference.h"
 #include "editor/editor_file_system.h"
 #include "editor/editor_file_system.h"
 #include "editor/editor_settings.h"
 #include "editor/editor_settings.h"
 #endif
 #endif

+ 1 - 1
modules/gdscript/gdscript_function.cpp

@@ -789,7 +789,7 @@ Variant GDScriptFunction::call(GDScriptInstance *p_instance, const Variant **p_a
 #ifdef DEBUG_ENABLED
 #ifdef DEBUG_ENABLED
 				GDScriptNativeClass *nc = Object::cast_to<GDScriptNativeClass>(type->operator Object *());
 				GDScriptNativeClass *nc = Object::cast_to<GDScriptNativeClass>(type->operator Object *());
 				GD_ERR_BREAK(!nc);
 				GD_ERR_BREAK(!nc);
-				if (!src->get_type() != Variant::OBJECT && !src->get_type() != Variant::NIL) {
+				if (src->get_type() != Variant::OBJECT && src->get_type() != Variant::NIL) {
 					err_text = "Trying to assign value of type '" + Variant::get_type_name(src->get_type()) +
 					err_text = "Trying to assign value of type '" + Variant::get_type_name(src->get_type()) +
 							   "' to a variable of type '" + nc->get_name() + "'.";
 							   "' to a variable of type '" + nc->get_name() + "'.";
 					OPCODE_BREAK;
 					OPCODE_BREAK;

+ 1 - 1
modules/gdscript/gdscript_parser.cpp

@@ -5079,7 +5079,7 @@ void GDScriptParser::_determine_inheritance(ClassNode *p_class) {
 				if (found) continue;
 				if (found) continue;
 
 
 				if (p->constant_expressions.has(base)) {
 				if (p->constant_expressions.has(base)) {
-					if (!p->constant_expressions[base].expression->type == Node::TYPE_CONSTANT) {
+					if (p->constant_expressions[base].expression->type != Node::TYPE_CONSTANT) {
 						_set_error("Could not resolve constant '" + base + "'.", p_class->line);
 						_set_error("Could not resolve constant '" + base + "'.", p_class->line);
 						return;
 						return;
 					}
 					}

+ 8 - 25
modules/gridmap/grid_map.cpp

@@ -29,37 +29,19 @@
 /*************************************************************************/
 /*************************************************************************/
 
 
 #include "grid_map.h"
 #include "grid_map.h"
-#include "core/message_queue.h"
-#include "scene/3d/light.h"
-#include "scene/resources/surface_tool.h"
-#include "servers/visual_server.h"
 
 
 #include "core/io/marshalls.h"
 #include "core/io/marshalls.h"
-#include "core/os/os.h"
+#include "core/message_queue.h"
+#include "scene/3d/light.h"
 #include "scene/resources/mesh_library.h"
 #include "scene/resources/mesh_library.h"
+#include "scene/resources/surface_tool.h"
 #include "scene/scene_string_names.h"
 #include "scene/scene_string_names.h"
+#include "servers/visual_server.h"
 
 
 bool GridMap::_set(const StringName &p_name, const Variant &p_value) {
 bool GridMap::_set(const StringName &p_name, const Variant &p_value) {
 
 
 	String name = p_name;
 	String name = p_name;
 
 
-	/*	} else if (name=="cells") {
-		PoolVector<int> cells = p_value;
-		int amount=cells.size();
-		PoolVector<int>::Read r = cells.read();
-		ERR_FAIL_COND_V(amount&1,false); // not even
-		cell_map.clear();
-		for(int i=0;i<amount/3;i++) {
-
-
-			IndexKey ik;
-			ik.key=decode_uint64(&r[i*3]);
-			Cell cell;
-			cell.cell=uint32_t(r[i*+1]);
-			cell_map[ik]=cell;
-
-		}
-		_recreate_octant_data();*/
 	if (name == "data") {
 	if (name == "data") {
 
 
 		Dictionary d = p_value;
 		Dictionary d = p_value;
@@ -80,7 +62,9 @@ bool GridMap::_set(const StringName &p_name, const Variant &p_value) {
 				cell_map[ik] = cell;
 				cell_map[ik] = cell;
 			}
 			}
 		}
 		}
+
 		_recreate_octant_data();
 		_recreate_octant_data();
+
 	} else if (name == "baked_meshes") {
 	} else if (name == "baked_meshes") {
 
 
 		clear_baked_meshes();
 		clear_baked_meshes();
@@ -103,8 +87,9 @@ bool GridMap::_set(const StringName &p_name, const Variant &p_value) {
 
 
 		_recreate_octant_data();
 		_recreate_octant_data();
 
 
-	} else
+	} else {
 		return false;
 		return false;
+	}
 
 
 	return true;
 	return true;
 }
 }
@@ -1081,8 +1066,6 @@ void GridMap::make_baked_meshes(bool p_gen_lightmap_uv, float p_lightmap_uv_texe
 		}
 		}
 	}
 	}
 
 
-	int ofs = 0;
-
 	for (Map<OctantKey, Map<Ref<Material>, Ref<SurfaceTool> > >::Element *E = surface_map.front(); E; E = E->next()) {
 	for (Map<OctantKey, Map<Ref<Material>, Ref<SurfaceTool> > >::Element *E = surface_map.front(); E; E = E->next()) {
 
 
 		Ref<ArrayMesh> mesh;
 		Ref<ArrayMesh> mesh;

+ 8 - 6
modules/gridmap/grid_map_editor_plugin.cpp

@@ -597,29 +597,31 @@ bool GridMapEditor::forward_spatial_input_event(Camera *p_camera, const Ref<Inpu
 			if (mb->get_button_index() == BUTTON_LEFT) {
 			if (mb->get_button_index() == BUTTON_LEFT) {
 
 
 				if (input_action == INPUT_DUPLICATE) {
 				if (input_action == INPUT_DUPLICATE) {
-
 					//paste
 					//paste
 					_duplicate_paste();
 					_duplicate_paste();
 					input_action = INPUT_NONE;
 					input_action = INPUT_NONE;
 					_update_duplicate_indicator();
 					_update_duplicate_indicator();
 				} else if (mb->get_shift()) {
 				} else if (mb->get_shift()) {
 					input_action = INPUT_SELECT;
 					input_action = INPUT_SELECT;
-				} else if (mb->get_command())
+				} else if (mb->get_command()) {
 					input_action = INPUT_COPY;
 					input_action = INPUT_COPY;
-				else {
+				} else {
 					input_action = INPUT_PAINT;
 					input_action = INPUT_PAINT;
 					set_items.clear();
 					set_items.clear();
 				}
 				}
-			} else if (mb->get_button_index() == BUTTON_RIGHT)
+			} else if (mb->get_button_index() == BUTTON_RIGHT) {
 				if (input_action == INPUT_DUPLICATE) {
 				if (input_action == INPUT_DUPLICATE) {
-
 					input_action = INPUT_NONE;
 					input_action = INPUT_NONE;
 					_update_duplicate_indicator();
 					_update_duplicate_indicator();
 				} else if (mb->get_shift()) {
 				} else if (mb->get_shift()) {
 					input_action = INPUT_ERASE;
 					input_action = INPUT_ERASE;
 					set_items.clear();
 					set_items.clear();
-				} else
+				} else {
 					return false;
 					return false;
+				}
+			} else {
+				return false;
+			}
 
 
 			return do_input_action(p_camera, Point2(mb->get_position().x, mb->get_position().y), true);
 			return do_input_action(p_camera, Point2(mb->get_position().x, mb->get_position().y), true);
 		} else {
 		} else {

+ 5 - 3
modules/mbedtls/stream_peer_mbed_tls.cpp

@@ -29,9 +29,11 @@
 /*************************************************************************/
 /*************************************************************************/
 
 
 #include "stream_peer_mbed_tls.h"
 #include "stream_peer_mbed_tls.h"
+
 #include "core/io/stream_peer_tcp.h"
 #include "core/io/stream_peer_tcp.h"
 #include "core/os/file_access.h"
 #include "core/os/file_access.h"
-#include "mbedtls/platform_util.h"
+
+#include <mbedtls/platform_util.h>
 
 
 static void my_debug(void *ctx, int level,
 static void my_debug(void *ctx, int level,
 		const char *file, int line,
 		const char *file, int line,
@@ -283,7 +285,7 @@ void StreamPeerMbedTLS::poll() {
 	}
 	}
 
 
 	Ref<StreamPeerTCP> tcp = base;
 	Ref<StreamPeerTCP> tcp = base;
-	if (tcp.is_valid() && tcp->get_status() != STATUS_CONNECTED) {
+	if (tcp.is_valid() && tcp->get_status() != StreamPeerTCP::STATUS_CONNECTED) {
 		disconnect_from_stream();
 		disconnect_from_stream();
 		return;
 		return;
 	}
 	}
@@ -310,7 +312,7 @@ void StreamPeerMbedTLS::disconnect_from_stream() {
 		return;
 		return;
 
 
 	Ref<StreamPeerTCP> tcp = base;
 	Ref<StreamPeerTCP> tcp = base;
-	if (tcp.is_valid() && tcp->get_status() == STATUS_CONNECTED) {
+	if (tcp.is_valid() && tcp->get_status() == StreamPeerTCP::STATUS_CONNECTED) {
 		// We are still connected on the socket, try to send close notity.
 		// We are still connected on the socket, try to send close notity.
 		mbedtls_ssl_close_notify(&ssl);
 		mbedtls_ssl_close_notify(&ssl);
 	}
 	}

+ 6 - 6
modules/mbedtls/stream_peer_mbed_tls.h

@@ -33,12 +33,12 @@
 
 
 #include "core/io/stream_peer_ssl.h"
 #include "core/io/stream_peer_ssl.h"
 
 
-#include "mbedtls/config.h"
-#include "mbedtls/ctr_drbg.h"
-#include "mbedtls/debug.h"
-#include "mbedtls/entropy.h"
-#include "mbedtls/net.h"
-#include "mbedtls/ssl.h"
+#include <mbedtls/config.h>
+#include <mbedtls/ctr_drbg.h>
+#include <mbedtls/debug.h>
+#include <mbedtls/entropy.h>
+#include <mbedtls/net.h>
+#include <mbedtls/ssl.h>
 
 
 #include <stdio.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdlib.h>

+ 3 - 3
modules/opensimplex/simplex_noise.cpp

@@ -196,7 +196,7 @@ float SimplexNoise::get_noise_2d(float x, float y) {
 	float max = 1.0;
 	float max = 1.0;
 	float sum = _get_octave_noise_2d(0, x, y);
 	float sum = _get_octave_noise_2d(0, x, y);
 
 
-	unsigned int i = 0;
+	int i = 0;
 	while (++i < octaves) {
 	while (++i < octaves) {
 		x *= lacunarity;
 		x *= lacunarity;
 		y *= lacunarity;
 		y *= lacunarity;
@@ -218,7 +218,7 @@ float SimplexNoise::get_noise_3d(float x, float y, float z) {
 	float max = 1.0;
 	float max = 1.0;
 	float sum = _get_octave_noise_3d(0, x, y, z);
 	float sum = _get_octave_noise_3d(0, x, y, z);
 
 
-	unsigned int i = 0;
+	int i = 0;
 	while (++i < octaves) {
 	while (++i < octaves) {
 		x *= lacunarity;
 		x *= lacunarity;
 		y *= lacunarity;
 		y *= lacunarity;
@@ -242,7 +242,7 @@ float SimplexNoise::get_noise_4d(float x, float y, float z, float w) {
 	float max = 1.0;
 	float max = 1.0;
 	float sum = _get_octave_noise_4d(0, x, y, z, w);
 	float sum = _get_octave_noise_4d(0, x, y, z, w);
 
 
-	unsigned int i = 0;
+	int i = 0;
 	while (++i < octaves) {
 	while (++i < octaves) {
 		x *= lacunarity;
 		x *= lacunarity;
 		y *= lacunarity;
 		y *= lacunarity;

+ 3 - 3
modules/theora/video_stream_theora.cpp

@@ -332,8 +332,8 @@ void VideoStreamPlaybackTheora::set_file(const String &p_file) {
 
 
 		int w;
 		int w;
 		int h;
 		int h;
-		w = (ti.pic_x + ti.frame_width + 1 & ~1) - (ti.pic_x & ~1);
-		h = (ti.pic_y + ti.frame_height + 1 & ~1) - (ti.pic_y & ~1);
+		w = ((ti.pic_x + ti.frame_width + 1) & ~1) - (ti.pic_x & ~1);
+		h = ((ti.pic_y + ti.frame_height + 1) & ~1) - (ti.pic_y & ~1);
 		size.x = w;
 		size.x = w;
 		size.y = h;
 		size.y = h;
 
 
@@ -439,7 +439,7 @@ void VideoStreamPlaybackTheora::update(float p_delta) {
 					}
 					}
 				}
 				}
 
 
-				int tr = vorbis_synthesis_read(&vd, ret - to_read);
+				vorbis_synthesis_read(&vd, ret - to_read);
 
 
 				audio_frames_wrote += ret - to_read;
 				audio_frames_wrote += ret - to_read;
 
 

+ 1 - 18
modules/visual_script/visual_script_editor.cpp

@@ -2518,8 +2518,6 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
 	}
 	}
 	ofs /= EDSCALE;
 	ofs /= EDSCALE;
 
 
-	bool seq_connect = false;
-
 	Set<int> vn;
 	Set<int> vn;
 
 
 	switch (p_option) {
 	switch (p_option) {
@@ -2552,7 +2550,6 @@ void VisualScriptEditor::_port_action_menu(int p_option) {
 			}
 			}
 		} break;
 		} break;
 		case CREATE_ACTION: {
 		case CREATE_ACTION: {
-			seq_connect = true;
 			VisualScriptNode::TypeGuess tg = _guess_output_type(port_action_node, port_action_output, vn);
 			VisualScriptNode::TypeGuess tg = _guess_output_type(port_action_node, port_action_output, vn);
 			PropertyInfo property_info = script->get_node(edited_func, port_action_node)->get_output_value_port_info(port_action_output);
 			PropertyInfo property_info = script->get_node(edited_func, port_action_node)->get_output_value_port_info(port_action_output);
 			if (tg.type == Variant::OBJECT) {
 			if (tg.type == Variant::OBJECT) {
@@ -2603,7 +2600,6 @@ void VisualScriptEditor::connect_data(Ref<VisualScriptNode> vnode_old, Ref<Visua
 	if (port >= value_count) {
 	if (port >= value_count) {
 		port = 0;
 		port = 0;
 	}
 	}
-	int count = vnode_old->get_output_value_port_count() + vnode_old->get_output_sequence_port_count();
 	undo_redo->add_do_method(script.ptr(), "data_connect", edited_func, port_action_node, port, new_id, 0);
 	undo_redo->add_do_method(script.ptr(), "data_connect", edited_func, port_action_node, port, new_id, 0);
 	undo_redo->add_undo_method(script.ptr(), "data_disconnect", edited_func, port_action_node, port, new_id, 0);
 	undo_redo->add_undo_method(script.ptr(), "data_disconnect", edited_func, port_action_node, port, new_id, 0);
 	undo_redo->commit_action();
 	undo_redo->commit_action();
@@ -2657,7 +2653,6 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri
 
 
 	Ref<VisualScriptNode> vnode;
 	Ref<VisualScriptNode> vnode;
 
 
-	seq_connect = false;
 	if (p_category == String("method")) {
 	if (p_category == String("method")) {
 
 
 		Ref<VisualScriptFunctionCall> n;
 		Ref<VisualScriptFunctionCall> n;
@@ -2683,38 +2678,32 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri
 			Ref<VisualScriptCondition> n;
 			Ref<VisualScriptCondition> n;
 			n.instance();
 			n.instance();
 			vnode = n;
 			vnode = n;
-			seq_connect = true;
 		}
 		}
 		if (p_text == "VisualScriptSwitch") {
 		if (p_text == "VisualScriptSwitch") {
 
 
 			Ref<VisualScriptSwitch> n;
 			Ref<VisualScriptSwitch> n;
 			n.instance();
 			n.instance();
 			vnode = n;
 			vnode = n;
-			seq_connect = true;
 		} else if (p_text == "VisualScriptSequence") {
 		} else if (p_text == "VisualScriptSequence") {
 
 
 			Ref<VisualScriptSequence> n;
 			Ref<VisualScriptSequence> n;
 			n.instance();
 			n.instance();
 			vnode = n;
 			vnode = n;
-			seq_connect = true;
 		} else if (p_text == "VisualScriptIterator") {
 		} else if (p_text == "VisualScriptIterator") {
 
 
 			Ref<VisualScriptIterator> n;
 			Ref<VisualScriptIterator> n;
 			n.instance();
 			n.instance();
 			vnode = n;
 			vnode = n;
-			seq_connect = true;
 		} else if (p_text == "VisualScriptWhile") {
 		} else if (p_text == "VisualScriptWhile") {
 
 
 			Ref<VisualScriptWhile> n;
 			Ref<VisualScriptWhile> n;
 			n.instance();
 			n.instance();
 			vnode = n;
 			vnode = n;
-			seq_connect = true;
 		} else if (p_text == "VisualScriptReturn") {
 		} else if (p_text == "VisualScriptReturn") {
 
 
 			Ref<VisualScriptReturn> n;
 			Ref<VisualScriptReturn> n;
 			n.instance();
 			n.instance();
 			vnode = n;
 			vnode = n;
-			seq_connect = true;
 		}
 		}
 	}
 	}
 
 
@@ -2826,7 +2815,6 @@ void VisualScriptEditor::_selected_connect_node(const String &p_text, const Stri
 }
 }
 
 
 void VisualScriptEditor::connect_seq(Ref<VisualScriptNode> vnode_old, Ref<VisualScriptNode> vnode_new, int new_id) {
 void VisualScriptEditor::connect_seq(Ref<VisualScriptNode> vnode_old, Ref<VisualScriptNode> vnode_new, int new_id) {
-	int seq_count = vnode_old->get_output_sequence_port_count();
 	VisualScriptOperator *vnode_operator = Object::cast_to<VisualScriptOperator>(vnode_new.ptr());
 	VisualScriptOperator *vnode_operator = Object::cast_to<VisualScriptOperator>(vnode_new.ptr());
 	if (vnode_operator != NULL && vnode_operator->has_input_sequence_port() == false) {
 	if (vnode_operator != NULL && vnode_operator->has_input_sequence_port() == false) {
 		return;
 		return;
@@ -2841,7 +2829,7 @@ void VisualScriptEditor::connect_seq(Ref<VisualScriptNode> vnode_old, Ref<Visual
 	if (vnode_new->has_input_sequence_port() == false) {
 	if (vnode_new->has_input_sequence_port() == false) {
 		return;
 		return;
 	}
 	}
-	VisualScriptFunction *vnode_function = Object::cast_to<VisualScriptFunction>(vnode_old.ptr());
+
 	undo_redo->create_action(TTR("Connect Node Sequence"));
 	undo_redo->create_action(TTR("Connect Node Sequence"));
 	int pass_port = -vnode_old->get_output_sequence_port_count() + 1;
 	int pass_port = -vnode_old->get_output_sequence_port_count() + 1;
 	int return_port = port_action_output - 1;
 	int return_port = port_action_output - 1;
@@ -3367,11 +3355,6 @@ void VisualScriptEditor::_member_option(int p_option) {
 					undo_redo->add_undo_method(script.ptr(), "data_connect", name, E->get().from_node, E->get().from_port, E->get().to_node, E->get().to_port);
 					undo_redo->add_undo_method(script.ptr(), "data_connect", name, E->get().from_node, E->get().from_port, E->get().to_node, E->get().to_port);
 				}
 				}
 
 
-				/*
-				for(int i=0;i<script->function_get_argument_count(name);i++) {
-					undo_redo->add_undo_method(script.ptr(),"function_add_argument",name,script->function_get_argument_name(name,i),script->function_get_argument_type(name,i));
-				}
-				*/
 				undo_redo->add_do_method(this, "_update_members");
 				undo_redo->add_do_method(this, "_update_members");
 				undo_redo->add_undo_method(this, "_update_members");
 				undo_redo->add_undo_method(this, "_update_members");
 				undo_redo->add_do_method(this, "_update_graph");
 				undo_redo->add_do_method(this, "_update_graph");

+ 1 - 2
modules/visual_script/visual_script_editor.h

@@ -37,6 +37,7 @@
 #include "scene/gui/graph_edit.h"
 #include "scene/gui/graph_edit.h"
 #include "visual_script.h"
 #include "visual_script.h"
 #include "visual_script_property_selector.h"
 #include "visual_script_property_selector.h"
+
 class VisualScriptEditorSignalEdit;
 class VisualScriptEditorSignalEdit;
 class VisualScriptEditorVariableEdit;
 class VisualScriptEditorVariableEdit;
 
 
@@ -159,8 +160,6 @@ class VisualScriptEditor : public ScriptEditorBase {
 	MemberType member_type;
 	MemberType member_type;
 	String member_name;
 	String member_name;
 
 
-	bool seq_connect = false;
-
 	PortAction port_action;
 	PortAction port_action;
 	int port_action_node;
 	int port_action_node;
 	int port_action_output;
 	int port_action_output;

+ 7 - 9
modules/visual_script/visual_script_property_selector.cpp

@@ -190,15 +190,14 @@ void VisualScriptPropertySelector::_update_search() {
 			if (type_filter.size() && type_filter.find(E->get().type) == -1)
 			if (type_filter.size() && type_filter.find(E->get().type) == -1)
 				continue;
 				continue;
 
 
+			// capitalize() also converts underscore to space, we'll match again both possible styles
 			String get_text_raw = String(vformat(TTR("Get %s"), E->get().name));
 			String get_text_raw = String(vformat(TTR("Get %s"), E->get().name));
 			String get_text = get_text_raw.capitalize();
 			String get_text = get_text_raw.capitalize();
-
 			String set_text_raw = String(vformat(TTR("Set %s"), E->get().name));
 			String set_text_raw = String(vformat(TTR("Set %s"), E->get().name));
 			String set_text = set_text_raw.capitalize();
 			String set_text = set_text_raw.capitalize();
 			String input = search_box->get_text().capitalize();
 			String input = search_box->get_text().capitalize();
-			if (input == String() ||
-					get_text_raw.findn(input) != -1 ||
-					get_text.findn(input) != -1) {
+
+			if (input == String() || get_text_raw.findn(input) != -1 || get_text.findn(input) != -1) {
 				TreeItem *item = search_options->create_item(category ? category : root);
 				TreeItem *item = search_options->create_item(category ? category : root);
 				item->set_text(0, get_text);
 				item->set_text(0, get_text);
 				item->set_metadata(0, E->get().name);
 				item->set_metadata(0, E->get().name);
@@ -211,9 +210,7 @@ void VisualScriptPropertySelector::_update_search() {
 				item->set_metadata(2, connecting);
 				item->set_metadata(2, connecting);
 			}
 			}
 
 
-			if (input == String() ||
-					set_text_raw.findn(input) != -1 &&
-							set_text.findn(input) != -1) {
+			if (input == String() || set_text_raw.findn(input) != -1 || set_text.findn(input) != -1) {
 				TreeItem *item = search_options->create_item(category ? category : root);
 				TreeItem *item = search_options->create_item(category ? category : root);
 				item->set_text(0, set_text);
 				item->set_text(0, set_text);
 				item->set_metadata(0, E->get().name);
 				item->set_metadata(0, E->get().name);
@@ -389,8 +386,8 @@ void VisualScriptPropertySelector::get_visual_node_names(const String &root_filt
 		}
 		}
 		Vector<String> path = E->get().split("/");
 		Vector<String> path = E->get().split("/");
 		bool is_filter = false;
 		bool is_filter = false;
-		for (Set<String>::Element *E = filter.front(); E; E = E->next()) {
-			if (path.size() >= 2 && path[1].findn(E->get()) != -1) {
+		for (Set<String>::Element *F = filter.front(); F; F = F->next()) {
+			if (path.size() >= 2 && path[1].findn(F->get()) != -1) {
 				is_filter = true;
 				is_filter = true;
 				break;
 				break;
 			}
 			}
@@ -721,6 +718,7 @@ VisualScriptPropertySelector::VisualScriptPropertySelector() {
 	search_options->set_hide_root(true);
 	search_options->set_hide_root(true);
 	search_options->set_hide_folding(true);
 	search_options->set_hide_folding(true);
 	virtuals_only = false;
 	virtuals_only = false;
+	seq_connect = false;
 	help_bit = memnew(EditorHelpBit);
 	help_bit = memnew(EditorHelpBit);
 	vbc->add_margin_child(TTR("Description:"), help_bit);
 	vbc->add_margin_child(TTR("Description:"), help_bit);
 	help_bit->connect("request_hide", this, "_closed");
 	help_bit->connect("request_hide", this, "_closed");

+ 1 - 2
modules/visual_script/visual_script_property_selector.h

@@ -63,8 +63,7 @@ class VisualScriptPropertySelector : public ConfirmationDialog {
 	ObjectID script;
 	ObjectID script;
 	Object *instance;
 	Object *instance;
 	bool virtuals_only;
 	bool virtuals_only;
-
-	bool seq_connect = false;
+	bool seq_connect;
 
 
 	void _item_selected();
 	void _item_selected();
 
 

+ 1 - 5
modules/websocket/lws_peer.cpp

@@ -30,6 +30,7 @@
 #ifndef JAVASCRIPT_ENABLED
 #ifndef JAVASCRIPT_ENABLED
 
 
 #include "lws_peer.h"
 #include "lws_peer.h"
+
 #include "core/io/ip.h"
 #include "core/io/ip.h"
 
 
 // Needed for socket_helpers on Android at least. UNIXes has it, just include if not windows
 // Needed for socket_helpers on Android at least. UNIXes has it, just include if not windows
@@ -60,7 +61,6 @@ Error LWSPeer::read_wsi(void *in, size_t len) {
 
 
 	ERR_FAIL_COND_V(!is_connected_to_host(), FAILED);
 	ERR_FAIL_COND_V(!is_connected_to_host(), FAILED);
 
 
-	PeerData *peer_data = (PeerData *)(lws_wsi_user(wsi));
 	uint32_t size = in_size;
 	uint32_t size = in_size;
 	uint8_t is_string = lws_frame_is_binary(wsi) ? 0 : 1;
 	uint8_t is_string = lws_frame_is_binary(wsi) ? 0 : 1;
 
 
@@ -88,7 +88,6 @@ Error LWSPeer::write_wsi() {
 
 
 	ERR_FAIL_COND_V(!is_connected_to_host(), FAILED);
 	ERR_FAIL_COND_V(!is_connected_to_host(), FAILED);
 
 
-	PeerData *peer_data = (PeerData *)(lws_wsi_user(wsi));
 	PoolVector<uint8_t> tmp;
 	PoolVector<uint8_t> tmp;
 	int left = rbw.data_left();
 	int left = rbw.data_left();
 	uint32_t to_write = 0;
 	uint32_t to_write = 0;
@@ -119,7 +118,6 @@ Error LWSPeer::put_packet(const uint8_t *p_buffer, int p_buffer_size) {
 
 
 	ERR_FAIL_COND_V(!is_connected_to_host(), FAILED);
 	ERR_FAIL_COND_V(!is_connected_to_host(), FAILED);
 
 
-	PeerData *peer_data = (PeerData *)lws_wsi_user(wsi);
 	rbw.write((uint8_t *)&p_buffer_size, 4);
 	rbw.write((uint8_t *)&p_buffer_size, 4);
 	rbw.write(p_buffer, MIN(p_buffer_size, rbw.space_left()));
 	rbw.write(p_buffer, MIN(p_buffer_size, rbw.space_left()));
 	out_count++;
 	out_count++;
@@ -132,8 +130,6 @@ Error LWSPeer::get_packet(const uint8_t **r_buffer, int &r_buffer_size) {
 
 
 	ERR_FAIL_COND_V(!is_connected_to_host(), FAILED);
 	ERR_FAIL_COND_V(!is_connected_to_host(), FAILED);
 
 
-	PeerData *peer_data = (PeerData *)lws_wsi_user(wsi);
-
 	if (in_count == 0)
 	if (in_count == 0)
 		return ERR_UNAVAILABLE;
 		return ERR_UNAVAILABLE;
 
 

+ 10 - 11
platform/android/export/export.cpp

@@ -194,8 +194,8 @@ static const char *android_perms[] = {
 };
 };
 
 
 struct LauncherIcon {
 struct LauncherIcon {
-	char *option_id;
-	char *export_path;
+	const char *option_id;
+	const char *export_path;
 };
 };
 
 
 static const LauncherIcon launcher_icons[] = {
 static const LauncherIcon launcher_icons[] = {
@@ -577,11 +577,11 @@ class EditorExportAndroid : public EditorExportPlatform {
 		uint32_t ofs = 8;
 		uint32_t ofs = 8;
 
 
 		uint32_t string_count = 0;
 		uint32_t string_count = 0;
-		uint32_t styles_count = 0;
+		//uint32_t styles_count = 0;
 		uint32_t string_flags = 0;
 		uint32_t string_flags = 0;
 		uint32_t string_data_offset = 0;
 		uint32_t string_data_offset = 0;
 
 
-		uint32_t styles_offset = 0;
+		//uint32_t styles_offset = 0;
 		uint32_t string_table_begins = 0;
 		uint32_t string_table_begins = 0;
 		uint32_t string_table_ends = 0;
 		uint32_t string_table_ends = 0;
 		Vector<uint8_t> stable_extra;
 		Vector<uint8_t> stable_extra;
@@ -631,16 +631,16 @@ class EditorExportAndroid : public EditorExportPlatform {
 					int iofs = ofs + 8;
 					int iofs = ofs + 8;
 
 
 					string_count = decode_uint32(&p_manifest[iofs]);
 					string_count = decode_uint32(&p_manifest[iofs]);
-					styles_count = decode_uint32(&p_manifest[iofs + 4]);
+					//styles_count = decode_uint32(&p_manifest[iofs + 4]);
 					string_flags = decode_uint32(&p_manifest[iofs + 8]);
 					string_flags = decode_uint32(&p_manifest[iofs + 8]);
 					string_data_offset = decode_uint32(&p_manifest[iofs + 12]);
 					string_data_offset = decode_uint32(&p_manifest[iofs + 12]);
-					styles_offset = decode_uint32(&p_manifest[iofs + 16]);
+					//styles_offset = decode_uint32(&p_manifest[iofs + 16]);
 					/*
 					/*
 					printf("string count: %i\n",string_count);
 					printf("string count: %i\n",string_count);
 					printf("flags: %i\n",string_flags);
 					printf("flags: %i\n",string_flags);
 					printf("sdata ofs: %i\n",string_data_offset);
 					printf("sdata ofs: %i\n",string_data_offset);
 					printf("styles ofs: %i\n",styles_offset);
 					printf("styles ofs: %i\n",styles_offset);
-	*/
+					*/
 					uint32_t st_offset = iofs + 20;
 					uint32_t st_offset = iofs + 20;
 					string_table.resize(string_count);
 					string_table.resize(string_count);
 					uint32_t string_end = 0;
 					uint32_t string_end = 0;
@@ -760,7 +760,6 @@ class EditorExportAndroid : public EditorExportPlatform {
 						// save manifest ending so we can restore it
 						// save manifest ending so we can restore it
 						Vector<uint8_t> manifest_end;
 						Vector<uint8_t> manifest_end;
 						uint32_t manifest_cur_size = p_manifest.size();
 						uint32_t manifest_cur_size = p_manifest.size();
-						uint32_t node_size = size;
 
 
 						manifest_end.resize(p_manifest.size() - ofs);
 						manifest_end.resize(p_manifest.size() - ofs);
 						memcpy(manifest_end.ptrw(), &p_manifest[ofs], manifest_end.size());
 						memcpy(manifest_end.ptrw(), &p_manifest[ofs], manifest_end.size());
@@ -1082,7 +1081,7 @@ public:
 		r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_large"), true));
 		r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_large"), true));
 		r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true));
 		r_options->push_back(ExportOption(PropertyInfo(Variant::BOOL, "screen/support_xlarge"), true));
 
 
-		for (int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
+		for (unsigned int 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"), ""));
 		}
 		}
 
 
@@ -1486,7 +1485,7 @@ public:
 
 
 			if (file == "res/drawable/icon.png") {
 			if (file == "res/drawable/icon.png") {
 				bool found = false;
 				bool found = false;
-				for (int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
+				for (unsigned int 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);
@@ -1620,7 +1619,7 @@ public:
 			APKExportData ed;
 			APKExportData ed;
 			ed.ep = &ep;
 			ed.ep = &ep;
 			ed.apk = unaligned_apk;
 			ed.apk = unaligned_apk;
-			for (int i = 0; i < sizeof(launcher_icons) / sizeof(launcher_icons[0]); ++i) {
+			for (unsigned int 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);

+ 4 - 4
platform/iphone/export/export.cpp

@@ -203,7 +203,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 (int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
+	for (unsigned int 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"), ""));
 	}
 	}
 
 
@@ -353,7 +353,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 (int i = 0; i < (sizeof(icon_infos) / sizeof(icon_infos[0])); ++i) {
+	for (unsigned int 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) {
@@ -403,7 +403,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 (int i = 0; i < sizeof(loading_screen_infos) / sizeof(loading_screen_infos[0]); ++i) {
+	for (unsigned int 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) {
@@ -490,7 +490,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 (int i = 0; i < sizeof(num) * 2; ++i) {
+		for (unsigned int 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);
 		}
 		}

+ 2 - 2
platform/osx/export/export.cpp

@@ -461,7 +461,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
 				fi.internal_fa = info.internal_fa;
 				fi.internal_fa = info.internal_fa;
 				fi.external_fa = info.external_fa;
 				fi.external_fa = info.external_fa;
 
 
-				int zerr = zipOpenNewFileInZip(dst_pkg_zip,
+				zipOpenNewFileInZip(dst_pkg_zip,
 						file.utf8().get_data(),
 						file.utf8().get_data(),
 						&fi,
 						&fi,
 						NULL,
 						NULL,
@@ -472,7 +472,7 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
 						Z_DEFLATED,
 						Z_DEFLATED,
 						Z_DEFAULT_COMPRESSION);
 						Z_DEFAULT_COMPRESSION);
 
 
-				zerr = zipWriteInFileInZip(dst_pkg_zip, data.ptr(), data.size());
+				zipWriteInFileInZip(dst_pkg_zip, data.ptr(), data.size());
 				zipCloseFileInZip(dst_pkg_zip);
 				zipCloseFileInZip(dst_pkg_zip);
 			}
 			}
 		}
 		}

+ 0 - 1
scene/2d/tile_map.cpp

@@ -257,7 +257,6 @@ void TileMap::update_dirty_quadrants() {
 	VisualServer *vs = VisualServer::get_singleton();
 	VisualServer *vs = VisualServer::get_singleton();
 	Physics2DServer *ps = Physics2DServer::get_singleton();
 	Physics2DServer *ps = Physics2DServer::get_singleton();
 	Vector2 tofs = get_cell_draw_offset();
 	Vector2 tofs = get_cell_draw_offset();
-	Vector2 tcenter = cell_size / 2;
 	Transform2D nav_rel;
 	Transform2D nav_rel;
 	if (navigation)
 	if (navigation)
 		nav_rel = get_relative_transform_to_parent(navigation);
 		nav_rel = get_relative_transform_to_parent(navigation);

+ 1 - 1
scene/3d/audio_stream_player_3d.cpp

@@ -417,7 +417,7 @@ void AudioStreamPlayer3D::_notification(int p_what) {
 					}
 					}
 				}
 				}
 
 
-				for (int k = 0; k < cc; k++) {
+				for (unsigned int k = 0; k < cc; k++) {
 					output.vol[k] *= multiplier;
 					output.vol[k] *= multiplier;
 				}
 				}
 
 

+ 6 - 0
scene/3d/light.cpp

@@ -163,6 +163,11 @@ void Light::_update_visibility() {
 	if (!is_inside_tree())
 	if (!is_inside_tree())
 		return;
 		return;
 
 
+	// FIXME: Since the call to VS::instance_light_set_enabled was disabled below,
+	// the whole logic became pointless so editor_ok triggers unused variable warnings.
+	// Commenting out for now but this should be fixed/reimplemented so that editor_only
+	// works as expected (GH-17989).
+	/*
 	bool editor_ok = true;
 	bool editor_ok = true;
 
 
 #ifdef TOOLS_ENABLED
 #ifdef TOOLS_ENABLED
@@ -180,6 +185,7 @@ void Light::_update_visibility() {
 #endif
 #endif
 
 
 	//VS::get_singleton()->instance_light_set_enabled(get_instance(),is_visible_in_tree() && editor_ok);
 	//VS::get_singleton()->instance_light_set_enabled(get_instance(),is_visible_in_tree() && editor_ok);
+	*/
 	_change_notify("geometry/visible");
 	_change_notify("geometry/visible");
 }
 }
 
 

+ 0 - 4
scene/3d/navigation.cpp

@@ -563,7 +563,6 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
 	bool use_collision = p_use_collision;
 	bool use_collision = p_use_collision;
 	Vector3 closest_point;
 	Vector3 closest_point;
 	float closest_point_d = 1e20;
 	float closest_point_d = 1e20;
-	NavMesh *closest_navmesh = NULL;
 
 
 	for (Map<int, NavMesh>::Element *E = navmesh_map.front(); E; E = E->next()) {
 	for (Map<int, NavMesh>::Element *E = navmesh_map.front(); E; E = E->next()) {
 
 
@@ -582,12 +581,10 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
 						closest_point = inters;
 						closest_point = inters;
 						use_collision = true;
 						use_collision = true;
 						closest_point_d = p_from.distance_to(inters);
 						closest_point_d = p_from.distance_to(inters);
-						closest_navmesh = p.owner;
 					} else if (closest_point_d > inters.distance_to(p_from)) {
 					} else if (closest_point_d > inters.distance_to(p_from)) {
 
 
 						closest_point = inters;
 						closest_point = inters;
 						closest_point_d = p_from.distance_to(inters);
 						closest_point_d = p_from.distance_to(inters);
-						closest_navmesh = p.owner;
 					}
 					}
 				}
 				}
 			}
 			}
@@ -605,7 +602,6 @@ Vector3 Navigation::get_closest_point_to_segment(const Vector3 &p_from, const Ve
 
 
 						closest_point_d = d;
 						closest_point_d = d;
 						closest_point = b;
 						closest_point = b;
-						closest_navmesh = p.owner;
 					}
 					}
 				}
 				}
 			}
 			}

+ 2 - 5
scene/gui/rich_text_label.cpp

@@ -421,7 +421,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
 
 
 								int cw = 0;
 								int cw = 0;
 
 
-								bool visible = visible_characters < 0 || p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - line_descent - line_ascent, line_ascent + line_descent);
+								bool visible = visible_characters < 0 || (p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - line_descent - line_ascent, line_ascent + line_descent));
 								if (visible)
 								if (visible)
 									line_is_blank = false;
 									line_is_blank = false;
 
 
@@ -509,7 +509,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
 
 
 				ENSURE_WIDTH(img->image->get_width());
 				ENSURE_WIDTH(img->image->get_width());
 
 
-				bool visible = visible_characters < 0 || p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - font->get_descent() - img->image->get_height(), img->image->get_height());
+				bool visible = visible_characters < 0 || (p_char_count < visible_characters && YRANGE_VISIBLE(y + lh - font->get_descent() - img->image->get_height(), img->image->get_height()));
 				if (visible)
 				if (visible)
 					line_is_blank = false;
 					line_is_blank = false;
 
 
@@ -847,8 +847,6 @@ void RichTextLabel::_notification(int p_what) {
 			bool use_outline = get_constant("shadow_as_outline");
 			bool use_outline = get_constant("shadow_as_outline");
 			Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
 			Point2 shadow_ofs(get_constant("shadow_offset_x"), get_constant("shadow_offset_y"));
 
 
-			float x_ofs = 0;
-
 			visible_line_count = 0;
 			visible_line_count = 0;
 			while (y < size.height && from_line < main->lines.size()) {
 			while (y < size.height && from_line < main->lines.size()) {
 
 
@@ -866,7 +864,6 @@ void RichTextLabel::_find_click(ItemFrame *p_frame, const Point2i &p_click, Item
 	if (r_click_item)
 	if (r_click_item)
 		*r_click_item = NULL;
 		*r_click_item = NULL;
 
 
-	Size2 size = get_size();
 	Rect2 text_rect = _get_text_rect();
 	Rect2 text_rect = _get_text_rect();
 	int ofs = vscroll->get_value();
 	int ofs = vscroll->get_value();
 	Color font_color_shadow = get_color("font_color_shadow");
 	Color font_color_shadow = get_color("font_color_shadow");

+ 2 - 1
scene/gui/scroll_container.cpp

@@ -30,6 +30,7 @@
 
 
 #include "scroll_container.h"
 #include "scroll_container.h"
 #include "core/os/os.h"
 #include "core/os/os.h"
+
 bool ScrollContainer::clips_input() const {
 bool ScrollContainer::clips_input() const {
 
 
 	return true;
 	return true;
@@ -170,7 +171,7 @@ void ScrollContainer::_gui_input(const Ref<InputEvent> &p_gui_input) {
 			Vector2 motion = Vector2(mm->get_relative().x, mm->get_relative().y);
 			Vector2 motion = Vector2(mm->get_relative().x, mm->get_relative().y);
 			drag_accum -= motion;
 			drag_accum -= motion;
 
 
-			if (beyond_deadzone || scroll_h && Math::abs(drag_accum.x) > deadzone || scroll_v && Math::abs(drag_accum.y) > deadzone) {
+			if (beyond_deadzone || (scroll_h && Math::abs(drag_accum.x) > deadzone) || (scroll_v && Math::abs(drag_accum.y) > deadzone)) {
 				if (!beyond_deadzone) {
 				if (!beyond_deadzone) {
 					propagate_notification(NOTIFICATION_SCROLL_BEGIN);
 					propagate_notification(NOTIFICATION_SCROLL_BEGIN);
 					emit_signal("scroll_started");
 					emit_signal("scroll_started");

+ 1 - 3
scene/gui/text_edit.cpp

@@ -650,8 +650,6 @@ void TextEdit::_notification(int p_what) {
 
 
 			int visible_rows = get_visible_rows() + 1;
 			int visible_rows = get_visible_rows() + 1;
 
 
-			int tab_w = cache.font->get_char_size(' ').width * indent_size;
-
 			Color color = cache.font_color;
 			Color color = cache.font_color;
 			color.a *= readonly_alpha;
 			color.a *= readonly_alpha;
 
 
@@ -4402,7 +4400,7 @@ int TextEdit::_is_line_in_region(int p_line) {
 
 
 	// if not find the closest line we have
 	// if not find the closest line we have
 	int previous_line = p_line - 1;
 	int previous_line = p_line - 1;
-	for (previous_line; previous_line > -1; previous_line--) {
+	for (; previous_line > -1; previous_line--) {
 		if (color_region_cache.has(p_line)) {
 		if (color_region_cache.has(p_line)) {
 			break;
 			break;
 		}
 		}

+ 6 - 6
scene/gui/tree.cpp

@@ -1254,13 +1254,13 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
 
 
 						String s = RTR("(Other)");
 						String s = RTR("(Other)");
 						Vector<String> strings = p_item->cells[i].text.split(",");
 						Vector<String> strings = p_item->cells[i].text.split(",");
-						for (int i = 0; i < strings.size(); i++) {
-							int value = i;
-							if (!strings[i].get_slicec(':', 1).empty()) {
-								value = strings[i].get_slicec(':', 1).to_int();
+						for (int j = 0; j < strings.size(); j++) {
+							int value = j;
+							if (!strings[j].get_slicec(':', 1).empty()) {
+								value = strings[j].get_slicec(':', 1).to_int();
 							}
 							}
 							if (option == value) {
 							if (option == value) {
-								s = strings[i].get_slicec(':', 0);
+								s = strings[j].get_slicec(':', 0);
 								break;
 								break;
 							}
 							}
 						}
 						}
@@ -1416,7 +1416,7 @@ int Tree::draw_item(const Point2i &p_pos, const Point2 &p_draw_ofs, const Size2
 
 
 		while (c) {
 		while (c) {
 
 
-			if (cache.draw_relationship_lines == 1 && (c->get_parent() != root || c->get_parent() == root && !hide_root)) {
+			if (cache.draw_relationship_lines == 1 && (c->get_parent() != root || !hide_root)) {
 				int root_ofs = children_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin);
 				int root_ofs = children_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin);
 				int parent_ofs = p_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin);
 				int parent_ofs = p_pos.x + ((p_item->disable_folding || hide_folding) ? cache.hseparation : cache.item_margin);
 				Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h / 2) - cache.offset + p_draw_ofs;
 				Point2i root_pos = Point2i(root_ofs, children_pos.y + label_h / 2) - cache.offset + p_draw_ofs;

+ 0 - 18
scene/main/viewport.cpp

@@ -701,15 +701,6 @@ void Viewport::set_canvas_transform(const Transform2D &p_transform) {
 
 
 	canvas_transform = p_transform;
 	canvas_transform = p_transform;
 	VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform);
 	VisualServer::get_singleton()->viewport_set_canvas_transform(viewport, find_world_2d()->get_canvas(), canvas_transform);
-
-	Transform2D xform = (global_canvas_transform * canvas_transform).affine_inverse();
-	Size2 ss = get_visible_rect().size;
-	/*SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Transform2D(0, xform.xform(ss*0.5)));
-	Vector2 ss2 = ss*xform.get_scale();
-	float panrange = MAX(ss2.x,ss2.y);
-
-	SpatialSound2DServer::get_singleton()->listener_set_param(internal_listener_2d, SpatialSound2DServer::LISTENER_PARAM_PAN_RANGE, panrange);
-*/
 }
 }
 
 
 Transform2D Viewport::get_canvas_transform() const {
 Transform2D Viewport::get_canvas_transform() const {
@@ -722,15 +713,6 @@ void Viewport::_update_global_transform() {
 	Transform2D sxform = stretch_transform * global_canvas_transform;
 	Transform2D sxform = stretch_transform * global_canvas_transform;
 
 
 	VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport, sxform);
 	VisualServer::get_singleton()->viewport_set_global_canvas_transform(viewport, sxform);
-
-	Transform2D xform = (sxform * canvas_transform).affine_inverse();
-	Size2 ss = get_visible_rect().size;
-	/*SpatialSound2DServer::get_singleton()->listener_set_transform(internal_listener_2d, Transform2D(0, xform.xform(ss*0.5)));
-	Vector2 ss2 = ss*xform.get_scale();
-	float panrange = MAX(ss2.x,ss2.y);
-
-	SpatialSound2DServer::get_singleton()->listener_set_param(internal_listener_2d, SpatialSound2DServer::LISTENER_PARAM_PAN_RANGE, panrange);
-*/
 }
 }
 
 
 void Viewport::set_global_canvas_transform(const Transform2D &p_transform) {
 void Viewport::set_global_canvas_transform(const Transform2D &p_transform) {

+ 2 - 2
scene/resources/audio_stream_sample.cpp

@@ -562,13 +562,13 @@ void AudioStreamSample::save_to_wav(String p_path) {
 	PoolVector<uint8_t>::Read read_data = get_data().read();
 	PoolVector<uint8_t>::Read read_data = get_data().read();
 	switch (format) {
 	switch (format) {
 		case AudioStreamSample::FORMAT_8_BITS:
 		case AudioStreamSample::FORMAT_8_BITS:
-			for (int i = 0; i < data_bytes; i++) {
+			for (unsigned int i = 0; i < data_bytes; i++) {
 				uint8_t data_point = (read_data[i] + 128);
 				uint8_t data_point = (read_data[i] + 128);
 				file->store_8(data_point);
 				file->store_8(data_point);
 			}
 			}
 			break;
 			break;
 		case AudioStreamSample::FORMAT_16_BITS:
 		case AudioStreamSample::FORMAT_16_BITS:
-			for (int i = 0; i < data_bytes / 2; i++) {
+			for (unsigned int i = 0; i < data_bytes / 2; i++) {
 				uint16_t data_point = decode_uint16(&read_data[i * 2]);
 				uint16_t data_point = decode_uint16(&read_data[i * 2]);
 				file->store_16(data_point);
 				file->store_16(data_point);
 			}
 			}

+ 0 - 1
scene/resources/bit_mask.cpp

@@ -183,7 +183,6 @@ Vector<Vector2> BitMap::_march_square(const Rect2i &rect, const Point2i &start)
 	unsigned int count = 0;
 	unsigned int count = 0;
 	Set<Point2i> case9s;
 	Set<Point2i> case9s;
 	Set<Point2i> case6s;
 	Set<Point2i> case6s;
-	int i;
 	Vector<Vector2> _points;
 	Vector<Vector2> _points;
 	do {
 	do {
 		int sv = 0;
 		int sv = 0;

+ 0 - 2
scene/resources/material.cpp

@@ -427,10 +427,8 @@ void SpatialMaterial::_update_shader() {
 	if (flags[FLAG_USE_VERTEX_LIGHTING]) {
 	if (flags[FLAG_USE_VERTEX_LIGHTING]) {
 		code += ",vertex_lighting";
 		code += ",vertex_lighting";
 	}
 	}
-	bool using_world = false;
 	if (flags[FLAG_TRIPLANAR_USE_WORLD] && (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR])) {
 	if (flags[FLAG_TRIPLANAR_USE_WORLD] && (flags[FLAG_UV1_USE_TRIPLANAR] || flags[FLAG_UV2_USE_TRIPLANAR])) {
 		code += ",world_vertex_coords";
 		code += ",world_vertex_coords";
-		using_world = true;
 	}
 	}
 	if (flags[FLAG_DONT_RECEIVE_SHADOWS]) {
 	if (flags[FLAG_DONT_RECEIVE_SHADOWS]) {
 		code += ",shadows_disabled";
 		code += ",shadows_disabled";

+ 0 - 13
scene/resources/mesh.cpp

@@ -546,19 +546,6 @@ void Mesh::clear_cache() const {
 Mesh::Mesh() {
 Mesh::Mesh() {
 }
 }
 
 
-static const char *_array_name[] = {
-	"vertex_array",
-	"normal_array",
-	"tangent_array",
-	"color_array",
-	"tex_uv_array",
-	"tex_uv2_array",
-	"bone_array",
-	"weights_array",
-	"index_array",
-	NULL
-};
-
 static const ArrayMesh::ArrayType _array_types[] = {
 static const ArrayMesh::ArrayType _array_types[] = {
 
 
 	ArrayMesh::ARRAY_VERTEX,
 	ArrayMesh::ARRAY_VERTEX,

+ 4 - 4
scene/resources/visual_shader.cpp

@@ -796,10 +796,10 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui
 				val.basis.transpose();
 				val.basis.transpose();
 				inputs[i] = "n_in" + itos(node) + "p" + itos(i);
 				inputs[i] = "n_in" + itos(node) + "p" + itos(i);
 				Array values;
 				Array values;
-				for (int i = 0; i < 3; i++) {
-					values.push_back(val.basis[i].x);
-					values.push_back(val.basis[i].y);
-					values.push_back(val.basis[i].z);
+				for (int j = 0; j < 3; j++) {
+					values.push_back(val.basis[j].x);
+					values.push_back(val.basis[j].y);
+					values.push_back(val.basis[j].z);
 				}
 				}
 				values.push_back(val.origin.x);
 				values.push_back(val.origin.x);
 				values.push_back(val.origin.y);
 				values.push_back(val.origin.y);

+ 12 - 1
servers/audio/audio_rb_resampler.cpp

@@ -82,19 +82,28 @@ uint32_t AudioRBResampler::_resample(AudioFrame *p_dest, int p_todo, int32_t p_i
 		// For now, channels higher than stereo are almost ignored
 		// For now, channels higher than stereo are almost ignored
 		if (C == 4) {
 		if (C == 4) {
 
 
+			// FIXME: v2 and v3 are not being used (thus were commented out to prevent
+			// compilation warnings, but they should likely be uncommented *and* used).
+			// See also C == 6 with similar issues.
 			float v0 = rb[(pos << 2) + 0];
 			float v0 = rb[(pos << 2) + 0];
 			float v1 = rb[(pos << 2) + 1];
 			float v1 = rb[(pos << 2) + 1];
+			/*
 			float v2 = rb[(pos << 2) + 2];
 			float v2 = rb[(pos << 2) + 2];
 			float v3 = rb[(pos << 2) + 3];
 			float v3 = rb[(pos << 2) + 3];
+			*/
 			float v0n = rb[(pos_next << 2) + 0];
 			float v0n = rb[(pos_next << 2) + 0];
 			float v1n = rb[(pos_next << 2) + 1];
 			float v1n = rb[(pos_next << 2) + 1];
+			/*
 			float v2n = rb[(pos_next << 2) + 2];
 			float v2n = rb[(pos_next << 2) + 2];
 			float v3n = rb[(pos_next << 2) + 3];
 			float v3n = rb[(pos_next << 2) + 3];
+			*/
 
 
 			v0 += (v0n - v0) * frac;
 			v0 += (v0n - v0) * frac;
 			v1 += (v1n - v1) * frac;
 			v1 += (v1n - v1) * frac;
+			/*
 			v2 += (v2n - v2) * frac;
 			v2 += (v2n - v2) * frac;
 			v3 += (v3n - v3) * frac;
 			v3 += (v3n - v3) * frac;
+			*/
 			p_dest[i] = AudioFrame(v0, v1);
 			p_dest[i] = AudioFrame(v0, v1);
 		}
 		}
 
 
@@ -104,6 +113,7 @@ uint32_t AudioRBResampler::_resample(AudioFrame *p_dest, int p_todo, int32_t p_i
 			// should be done as for C == 2 (C == 4 also has some unused assignments).
 			// should be done as for C == 2 (C == 4 also has some unused assignments).
 			float v0 = rb[(pos * 6) + 0];
 			float v0 = rb[(pos * 6) + 0];
 			float v1 = rb[(pos * 6) + 1];
 			float v1 = rb[(pos * 6) + 1];
+			/*
 			float v2 = rb[(pos * 6) + 2];
 			float v2 = rb[(pos * 6) + 2];
 			float v3 = rb[(pos * 6) + 3];
 			float v3 = rb[(pos * 6) + 3];
 			float v4 = rb[(pos * 6) + 4];
 			float v4 = rb[(pos * 6) + 4];
@@ -114,6 +124,7 @@ uint32_t AudioRBResampler::_resample(AudioFrame *p_dest, int p_todo, int32_t p_i
 			float v3n = rb[(pos_next * 6) + 3];
 			float v3n = rb[(pos_next * 6) + 3];
 			float v4n = rb[(pos_next * 6) + 4];
 			float v4n = rb[(pos_next * 6) + 4];
 			float v5n = rb[(pos_next * 6) + 5];
 			float v5n = rb[(pos_next * 6) + 5];
+			*/
 
 
 			p_dest[i] = AudioFrame(v0, v1);
 			p_dest[i] = AudioFrame(v0, v1);
 		}
 		}
@@ -153,7 +164,7 @@ bool AudioRBResampler::mix(AudioFrame *p_dest, int p_frames) {
 		}
 		}
 
 
 		// Fill zeros (silence) for the rest of frames
 		// Fill zeros (silence) for the rest of frames
-		for (uint32_t i = target_todo; i < p_frames; i++) {
+		for (int i = target_todo; i < p_frames; i++) {
 			p_dest[i] = AudioFrame(0, 0);
 			p_dest[i] = AudioFrame(0, 0);
 		}
 		}
 	}
 	}

+ 1 - 1
servers/audio/audio_stream.h

@@ -122,7 +122,7 @@ class AudioStreamPlaybackMicrophone : public AudioStreamPlaybackResampled {
 	GDCLASS(AudioStreamPlaybackMicrophone, AudioStreamPlayback)
 	GDCLASS(AudioStreamPlaybackMicrophone, AudioStreamPlayback)
 	friend class AudioStreamMicrophone;
 	friend class AudioStreamMicrophone;
 
 
-	const int MICROPHONE_PLAYBACK_DELAY = 256;
+	static const int MICROPHONE_PLAYBACK_DELAY = 256;
 
 
 	bool active;
 	bool active;
 	unsigned int input_ofs;
 	unsigned int input_ofs;

+ 4 - 1
servers/audio/effects/audio_effect_record.h

@@ -49,7 +49,7 @@ class AudioEffectRecordInstance : public AudioEffectInstance {
 
 
 	bool is_recording;
 	bool is_recording;
 	Thread *io_thread;
 	Thread *io_thread;
-	bool thread_active = false;
+	bool thread_active;
 
 
 	Vector<AudioFrame> ring_buffer;
 	Vector<AudioFrame> ring_buffer;
 	Vector<float> recording_data;
 	Vector<float> recording_data;
@@ -67,6 +67,9 @@ public:
 	void init();
 	void init();
 	virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count);
 	virtual void process(const AudioFrame *p_src_frames, AudioFrame *p_dst_frames, int p_frame_count);
 	virtual bool process_silence();
 	virtual bool process_silence();
+
+	AudioEffectRecordInstance() :
+			thread_active(false) {}
 };
 };
 
 
 class AudioEffectRecord : public AudioEffect {
 class AudioEffectRecord : public AudioEffect {

+ 1 - 1
servers/audio_server.cpp

@@ -189,7 +189,7 @@ void AudioDriverManager::initialize(int p_driver) {
 		}
 		}
 	}
 	}
 
 
-	if (driver_count > 1 && AudioDriver::get_singleton()->get_name() == "Dummy") {
+	if (driver_count > 1 && String(AudioDriver::get_singleton()->get_name()) == "Dummy") {
 		WARN_PRINT("All audio drivers failed, falling back to the dummy driver.");
 		WARN_PRINT("All audio drivers failed, falling back to the dummy driver.");
 	}
 	}
 }
 }

+ 8 - 8
servers/physics_2d/collision_object_2d_sw.h

@@ -112,23 +112,23 @@ public:
 
 
 	_FORCE_INLINE_ int get_shape_count() const { return shapes.size(); }
 	_FORCE_INLINE_ int get_shape_count() const { return shapes.size(); }
 	_FORCE_INLINE_ Shape2DSW *get_shape(int p_index) const {
 	_FORCE_INLINE_ Shape2DSW *get_shape(int p_index) const {
-		ERR_FAIL_INDEX_V(p_index, shapes.size(), NULL);
+		CRASH_BAD_INDEX(p_index, shapes.size());
 		return shapes[p_index].shape;
 		return shapes[p_index].shape;
 	}
 	}
 	_FORCE_INLINE_ const Transform2D &get_shape_transform(int p_index) const {
 	_FORCE_INLINE_ const Transform2D &get_shape_transform(int p_index) const {
-		ERR_FAIL_INDEX_V(p_index, shapes.size(), Transform2D());
+		CRASH_BAD_INDEX(p_index, shapes.size());
 		return shapes[p_index].xform;
 		return shapes[p_index].xform;
 	}
 	}
 	_FORCE_INLINE_ const Transform2D &get_shape_inv_transform(int p_index) const {
 	_FORCE_INLINE_ const Transform2D &get_shape_inv_transform(int p_index) const {
-		ERR_FAIL_INDEX_V(p_index, shapes.size(), Transform2D());
+		CRASH_BAD_INDEX(p_index, shapes.size());
 		return shapes[p_index].xform_inv;
 		return shapes[p_index].xform_inv;
 	}
 	}
 	_FORCE_INLINE_ const Rect2 &get_shape_aabb(int p_index) const {
 	_FORCE_INLINE_ const Rect2 &get_shape_aabb(int p_index) const {
-		ERR_FAIL_INDEX_V(p_index, shapes.size(), Rect2());
+		CRASH_BAD_INDEX(p_index, shapes.size());
 		return shapes[p_index].aabb_cache;
 		return shapes[p_index].aabb_cache;
 	}
 	}
 	_FORCE_INLINE_ const Variant &get_shape_metadata(int p_index) const {
 	_FORCE_INLINE_ const Variant &get_shape_metadata(int p_index) const {
-		ERR_FAIL_INDEX_V(p_index, shapes.size(), Variant());
+		CRASH_BAD_INDEX(p_index, shapes.size());
 		return shapes[p_index].metadata;
 		return shapes[p_index].metadata;
 	}
 	}
 
 
@@ -138,16 +138,16 @@ public:
 
 
 	void set_shape_as_disabled(int p_idx, bool p_disabled);
 	void set_shape_as_disabled(int p_idx, bool p_disabled);
 	_FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const {
 	_FORCE_INLINE_ bool is_shape_set_as_disabled(int p_idx) const {
-		ERR_FAIL_INDEX_V(p_idx, shapes.size(), false);
+		CRASH_BAD_INDEX(p_idx, shapes.size());
 		return shapes[p_idx].disabled;
 		return shapes[p_idx].disabled;
 	}
 	}
 
 
 	_FORCE_INLINE_ void set_shape_as_one_way_collision(int p_idx, bool p_one_way_collision) {
 	_FORCE_INLINE_ void set_shape_as_one_way_collision(int p_idx, bool p_one_way_collision) {
-		ERR_FAIL_INDEX(p_idx, shapes.size());
+		CRASH_BAD_INDEX(p_idx, shapes.size());
 		shapes.write[p_idx].one_way_collision = p_one_way_collision;
 		shapes.write[p_idx].one_way_collision = p_one_way_collision;
 	}
 	}
 	_FORCE_INLINE_ bool is_shape_set_as_one_way_collision(int p_idx) const {
 	_FORCE_INLINE_ bool is_shape_set_as_one_way_collision(int p_idx) const {
-		ERR_FAIL_INDEX_V(p_idx, shapes.size(), false);
+		CRASH_BAD_INDEX(p_idx, shapes.size());
 		return shapes[p_idx].one_way_collision;
 		return shapes[p_idx].one_way_collision;
 	}
 	}
 
 

+ 0 - 23
servers/visual/default_mouse_cursor.xpm

@@ -1,23 +0,0 @@
-/* XPM */
-static const char * default_mouse_cursor_xpm[] = {
-"16 16 4 1",
-" 	c None",
-".	c #000000",
-"+	c #FF00FF",
-"@	c #FFFFFF",
-"...+++++++++++++",
-".@...+++++++++++",
-".@@@...+++++++++",
-".@@@@@....++++++",
-".@@@@@@@@...++++",
-".@@@@@@@@@@...++",
-".@@@@@@@@@@@@..+",
-".@@@@@@@@@@@@@..",
-".@@@@@@@@@@@@..+",
-".@@@@@@@@@@@..++",
-".@@@@@@@@@...+++",
-".@@@.....@@..+++",
-".....+++.@@@..++",
-"++++++++..@@@..+",
-"+++++++++..@@@.+",
-"++++++++++.....+"};

+ 0 - 3
servers/visual/shader_language.cpp

@@ -2023,10 +2023,7 @@ bool ShaderLanguage::_validate_function_call(BlockNode *p_block, OperatorNode *p
 
 
 	StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
 	StringName name = static_cast<VariableNode *>(p_func->arguments[0])->name.operator String();
 
 
-	bool all_const = true;
 	for (int i = 1; i < p_func->arguments.size(); i++) {
 	for (int i = 1; i < p_func->arguments.size(); i++) {
-		if (p_func->arguments[i]->type != Node::TYPE_CONSTANT)
-			all_const = false;
 		args.push_back(p_func->arguments[i]->get_datatype());
 		args.push_back(p_func->arguments[i]->get_datatype());
 	}
 	}
 
 

+ 0 - 1
servers/visual/visual_server_raster.cpp

@@ -34,7 +34,6 @@
 #include "core/os/os.h"
 #include "core/os/os.h"
 #include "core/project_settings.h"
 #include "core/project_settings.h"
 #include "core/sort.h"
 #include "core/sort.h"
-#include "default_mouse_cursor.xpm"
 #include "visual_server_canvas.h"
 #include "visual_server_canvas.h"
 #include "visual_server_global.h"
 #include "visual_server_global.h"
 #include "visual_server_scene.h"
 #include "visual_server_scene.h"

+ 6 - 3
servers/visual/visual_server_scene.cpp

@@ -902,7 +902,7 @@ void VisualServerScene::_update_instance(Instance *p_instance) {
 			_update_instance_lightmap_captures(p_instance);
 			_update_instance_lightmap_captures(p_instance);
 		} else {
 		} else {
 			if (!p_instance->lightmap_capture_data.empty()) {
 			if (!p_instance->lightmap_capture_data.empty()) {
-				!p_instance->lightmap_capture_data.resize(0); //not in use, clear capture data
+				p_instance->lightmap_capture_data.resize(0); //not in use, clear capture data
 			}
 			}
 		}
 		}
 	}
 	}
@@ -1378,9 +1378,12 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
 				float y_min = 0.f, y_max = 0.f;
 				float y_min = 0.f, y_max = 0.f;
 				float z_min = 0.f, z_max = 0.f;
 				float z_min = 0.f, z_max = 0.f;
 
 
+				// FIXME: z_max_cam is defined, computed, but not used below when setting up
+				// ortho_camera. Commented out for now to fix warnings but should be investigated.
 				float x_min_cam = 0.f, x_max_cam = 0.f;
 				float x_min_cam = 0.f, x_max_cam = 0.f;
 				float y_min_cam = 0.f, y_max_cam = 0.f;
 				float y_min_cam = 0.f, y_max_cam = 0.f;
-				float z_min_cam = 0.f, z_max_cam = 0.f;
+				float z_min_cam = 0.f;
+				//float z_max_cam = 0.f;
 
 
 				float bias_scale = 1.0;
 				float bias_scale = 1.0;
 
 
@@ -1442,7 +1445,7 @@ void VisualServerScene::_light_instance_update_shadow(Instance *p_instance, cons
 					x_min_cam = x_vec.dot(center) - radius;
 					x_min_cam = x_vec.dot(center) - radius;
 					y_max_cam = y_vec.dot(center) + radius;
 					y_max_cam = y_vec.dot(center) + radius;
 					y_min_cam = y_vec.dot(center) - radius;
 					y_min_cam = y_vec.dot(center) - radius;
-					z_max_cam = z_vec.dot(center) + radius;
+					//z_max_cam = z_vec.dot(center) + radius;
 					z_min_cam = z_vec.dot(center) - radius;
 					z_min_cam = z_vec.dot(center) - radius;
 
 
 					if (depth_range_mode == VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE) {
 					if (depth_range_mode == VS::LIGHT_DIRECTIONAL_SHADOW_DEPTH_RANGE_STABLE) {