summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/physics_2d/body_2d_sw.cpp2
-rw-r--r--servers/rendering/renderer_rd/renderer_storage_rd.cpp6
-rw-r--r--servers/rendering/renderer_rd/shader_compiler_rd.cpp4
-rw-r--r--servers/rendering/renderer_scene_cull.cpp6
-rw-r--r--servers/rendering/rendering_device_binds.h2
-rw-r--r--servers/rendering/shader_language.cpp2
-rw-r--r--servers/rendering_server.cpp2
7 files changed, 12 insertions, 12 deletions
diff --git a/servers/physics_2d/body_2d_sw.cpp b/servers/physics_2d/body_2d_sw.cpp
index 0a01d0c0b0..7aa2f9b7de 100644
--- a/servers/physics_2d/body_2d_sw.cpp
+++ b/servers/physics_2d/body_2d_sw.cpp
@@ -532,7 +532,7 @@ void Body2DSW::integrate_velocities(real_t p_step) {
}
void Body2DSW::wakeup_neighbours() {
- for (Pair<Constraint2DSW *, int> &E : constraint_list) {
+ for (const Pair<Constraint2DSW *, int> &E : constraint_list) {
const Constraint2DSW *c = E.first;
Body2DSW **n = c->get_body_ptr();
int bc = c->get_body_count();
diff --git a/servers/rendering/renderer_rd/renderer_storage_rd.cpp b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
index 178fb60885..d5c7db6fd2 100644
--- a/servers/rendering/renderer_rd/renderer_storage_rd.cpp
+++ b/servers/rendering/renderer_rd/renderer_storage_rd.cpp
@@ -8410,7 +8410,7 @@ void RendererStorageRD::global_variables_load_settings(bool p_load_textures) {
List<PropertyInfo> settings;
ProjectSettings::get_singleton()->get_property_list(&settings);
- for (PropertyInfo &E : settings) {
+ for (const PropertyInfo &E : settings) {
if (E.name.begins_with("shader_globals/")) {
StringName name = E.name.get_slice("/", 1);
Dictionary d = ProjectSettings::get_singleton()->get(E.name);
@@ -8581,7 +8581,7 @@ void RendererStorageRD::_update_global_variables() {
if (global_variables.must_update_buffer_materials) {
// only happens in the case of a buffer variable added or removed,
// so not often.
- for (RID E : global_variables.materials_using_buffer) {
+ for (const RID &E : global_variables.materials_using_buffer) {
Material *material = material_owner.getornull(E);
ERR_CONTINUE(!material); //wtf
@@ -8594,7 +8594,7 @@ void RendererStorageRD::_update_global_variables() {
if (global_variables.must_update_texture_materials) {
// only happens in the case of a buffer variable added or removed,
// so not often.
- for (RID E : global_variables.materials_using_texture) {
+ for (const RID &E : global_variables.materials_using_texture) {
Material *material = material_owner.getornull(E);
ERR_CONTINUE(!material); //wtf
diff --git a/servers/rendering/renderer_rd/shader_compiler_rd.cpp b/servers/rendering/renderer_rd/shader_compiler_rd.cpp
index 66cd0ea15a..9c1068ea2e 100644
--- a/servers/rendering/renderer_rd/shader_compiler_rd.cpp
+++ b/servers/rendering/renderer_rd/shader_compiler_rd.cpp
@@ -760,7 +760,7 @@ String ShaderCompilerRD::_dump_node_code(const SL::Node *p_node, int p_level, Ge
if (var_frag_to_light.size() > 0) {
String gcode = "\n\nstruct {\n";
- for (Pair<StringName, SL::ShaderNode::Varying> &E : var_frag_to_light) {
+ for (const Pair<StringName, SL::ShaderNode::Varying> &E : var_frag_to_light) {
gcode += "\t" + _prestr(E.second.precision) + _typestr(E.second.type) + " " + _mkid(E.first);
if (E.second.array_size > 0) {
gcode += "[";
@@ -1394,7 +1394,7 @@ void ShaderCompilerRD::initialize(DefaultIdentifierActions p_actions) {
ShaderLanguage::get_builtin_funcs(&func_list);
- for (String &E : func_list) {
+ for (const String &E : func_list) {
internal_functions.insert(E);
}
texture_functions.insert("texture");
diff --git a/servers/rendering/renderer_scene_cull.cpp b/servers/rendering/renderer_scene_cull.cpp
index 53983d0bfd..83d1b33bf2 100644
--- a/servers/rendering/renderer_scene_cull.cpp
+++ b/servers/rendering/renderer_scene_cull.cpp
@@ -3391,7 +3391,7 @@ void RendererSceneCull::render_probes() {
idx++;
}
- for (Instance *instance : probe->owner->scenario->directional_lights) {
+ for (const Instance *instance : probe->owner->scenario->directional_lights) {
InstanceLightData *instance_light = (InstanceLightData *)instance->base_data;
if (!instance->visible) {
continue;
@@ -3464,7 +3464,7 @@ void RendererSceneCull::render_probes() {
idx++;
}
- for (Instance *instance : probe->owner->scenario->directional_lights) {
+ for (const Instance *instance : probe->owner->scenario->directional_lights) {
InstanceLightData *instance_light = (InstanceLightData *)instance->base_data;
if (!instance->visible) {
continue;
@@ -3571,7 +3571,7 @@ void RendererSceneCull::render_particle_colliders() {
void RendererSceneCull::_update_instance_shader_parameters_from_material(Map<StringName, Instance::InstanceShaderParameter> &isparams, const Map<StringName, Instance::InstanceShaderParameter> &existing_isparams, RID p_material) {
List<RendererStorage::InstanceShaderParam> plist;
RSG::storage->material_get_instance_shader_parameters(p_material, &plist);
- for (RendererStorage::InstanceShaderParam &E : plist) {
+ for (const RendererStorage::InstanceShaderParam &E : plist) {
StringName name = E.info.name;
if (isparams.has(name)) {
if (isparams[name].info.type != E.info.type) {
diff --git a/servers/rendering/rendering_device_binds.h b/servers/rendering/rendering_device_binds.h
index df1b40974f..75a91d8419 100644
--- a/servers/rendering/rendering_device_binds.h
+++ b/servers/rendering/rendering_device_binds.h
@@ -388,7 +388,7 @@ protected:
versions.clear();
List<Variant> keys;
p_versions.get_key_list(&keys);
- for (Variant &E : keys) {
+ for (const Variant &E : keys) {
StringName name = E;
Ref<RDShaderBytecode> bc = p_versions[E];
ERR_CONTINUE(bc.is_null());
diff --git a/servers/rendering/shader_language.cpp b/servers/rendering/shader_language.cpp
index 2db246c31f..7cfdb832e4 100644
--- a/servers/rendering/shader_language.cpp
+++ b/servers/rendering/shader_language.cpp
@@ -4448,7 +4448,7 @@ ShaderLanguage::Node *ShaderLanguage::_parse_expression(BlockNode *p_block, cons
String member_name = String(ident.ptr());
if (shader->structs.has(st)) {
StructNode *n = shader->structs[st].shader_struct;
- for (MemberNode *E : n->members) {
+ for (const MemberNode *E : n->members) {
if (String(E->name) == member_name) {
member_type = E->datatype;
array_size = E->array_size;
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp
index 9377075e76..1f01f47fff 100644
--- a/servers/rendering_server.cpp
+++ b/servers/rendering_server.cpp
@@ -972,7 +972,7 @@ Error RenderingServer::mesh_create_surface_data_from_arrays(SurfaceData *r_surfa
if (index_array_len) {
List<Variant> keys;
p_lods.get_key_list(&keys);
- for (Variant &E : keys) {
+ for (const Variant &E : keys) {
float distance = E;
ERR_CONTINUE(distance <= 0.0);
Vector<int> indices = p_lods[E];