summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml6
-rw-r--r--core/image.cpp6
-rw-r--r--core/os/memory.cpp7
-rw-r--r--core/rid.h1
-rw-r--r--editor/audio_stream_preview.cpp4
-rw-r--r--editor/editor_themes.cpp2
-rw-r--r--editor/plugins/animation_blend_space_2d_editor.cpp4
-rw-r--r--editor/plugins/canvas_item_editor_plugin.h4
-rw-r--r--main/tests/test_oa_hash_map.cpp2
-rw-r--r--modules/csg/csg.cpp2
-rw-r--r--modules/csg/csg_shape.cpp2
-rw-r--r--modules/gdnative/nativescript/api_generator.cpp1
-rw-r--r--scene/2d/tile_map.cpp2
-rw-r--r--scene/3d/voxel_light_baker.cpp4
-rw-r--r--scene/animation/animation_blend_space_2d.cpp2
15 files changed, 24 insertions, 25 deletions
diff --git a/.travis.yml b/.travis.yml
index 7161a3e029..a5217c1d9c 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -29,7 +29,7 @@ matrix:
- clang-format-6.0
- libstdc++6 # >= 4.9 needed for clang-format-6.0
- - env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc EXTRA_ARGS="module_mono_enabled=yes mono_glue=no"
+ - env: PLATFORM=x11 TOOLS=yes TARGET=debug CACHE_NAME=${PLATFORM}-tools-mono-gcc EXTRA_ARGS="module_mono_enabled=yes mono_glue=no werror=yes"
os: linux
compiler: gcc
addons:
@@ -49,7 +49,7 @@ matrix:
build_command: "scons p=x11 -j2 $OPTIONS"
branch_pattern: coverity_scan
- - env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang
+ - env: PLATFORM=x11 TOOLS=no TARGET=release CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="werror=yes"
os: linux
compiler: clang
addons:
@@ -57,7 +57,7 @@ matrix:
packages:
- *linux_deps
- - env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang
+ - env: PLATFORM=android TOOLS=no TARGET=release_debug CACHE_NAME=${PLATFORM}-clang EXTRA_ARGS="werror=yes"
os: linux
compiler: clang
diff --git a/core/image.cpp b/core/image.cpp
index e90ed96499..e2b56c51dc 100644
--- a/core/image.cpp
+++ b/core/image.cpp
@@ -780,9 +780,9 @@ void Image::resize(int p_width, int p_height, Interpolation p_interpolation) {
// Setup mipmap-aware scaling
Image dst2;
- int mip1;
- int mip2;
- float mip1_weight;
+ int mip1 = 0;
+ int mip2 = 0;
+ float mip1_weight = 0;
if (mipmap_aware) {
float avg_scale = ((float)p_width / width + (float)p_height / height) * 0.5f;
if (avg_scale >= 1.0f) {
diff --git a/core/os/memory.cpp b/core/os/memory.cpp
index be48c927b6..f25e40ef78 100644
--- a/core/os/memory.cpp
+++ b/core/os/memory.cpp
@@ -89,13 +89,8 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
atomic_increment(&alloc_count);
if (prepad) {
- // Clang 5 wrongly complains about 's' being unused,
- // while it's used to modify 'mem'.
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-variable"
uint64_t *s = (uint64_t *)mem;
*s = p_bytes;
-#pragma clang diagnostic pop
uint8_t *s8 = (uint8_t *)mem;
@@ -177,9 +172,9 @@ void Memory::free_static(void *p_ptr, bool p_pad_align) {
if (prepad) {
mem -= PAD_ALIGN;
- uint64_t *s = (uint64_t *)mem;
#ifdef DEBUG_ENABLED
+ uint64_t *s = (uint64_t *)mem;
atomic_sub(&mem_usage, *s);
#endif
diff --git a/core/rid.h b/core/rid.h
index fbb3e443fc..81d5b45d21 100644
--- a/core/rid.h
+++ b/core/rid.h
@@ -118,7 +118,6 @@ protected:
p_rid._data->_owner = NULL;
}
-#
#endif
public:
diff --git a/editor/audio_stream_preview.cpp b/editor/audio_stream_preview.cpp
index c5759ac076..5a94d41aba 100644
--- a/editor/audio_stream_preview.cpp
+++ b/editor/audio_stream_preview.cpp
@@ -50,7 +50,7 @@ float AudioStreamPreview::get_max(float p_time, float p_time_next) const {
time_to = time_from + 1;
}
- uint8_t vmax;
+ uint8_t vmax = 0;
for (int i = time_from; i < time_to; i++) {
@@ -77,7 +77,7 @@ float AudioStreamPreview::get_min(float p_time, float p_time_next) const {
time_to = time_from + 1;
}
- uint8_t vmin;
+ uint8_t vmin = 0;
for (int i = time_from; i < time_to; i++) {
diff --git a/editor/editor_themes.cpp b/editor/editor_themes.cpp
index a1e8e4d838..768a8fc066 100644
--- a/editor/editor_themes.cpp
+++ b/editor/editor_themes.cpp
@@ -251,7 +251,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
Color preset_accent_color;
Color preset_base_color;
- float preset_contrast;
+ float preset_contrast = 0;
// Please, use alphabet order if you've added new theme here(After "Default" and "Custom")
diff --git a/editor/plugins/animation_blend_space_2d_editor.cpp b/editor/plugins/animation_blend_space_2d_editor.cpp
index c4f8cdc3d7..394b888d0e 100644
--- a/editor/plugins/animation_blend_space_2d_editor.cpp
+++ b/editor/plugins/animation_blend_space_2d_editor.cpp
@@ -434,7 +434,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() {
if (blend_space->get_snap().x > 0) {
- int prev_idx;
+ int prev_idx = 0;
for (int i = 0; i < s.x; i++) {
float v = blend_space->get_min_space().x + i * (blend_space->get_max_space().x - blend_space->get_min_space().x) / s.x;
@@ -450,7 +450,7 @@ void AnimationNodeBlendSpace2DEditor::_blend_space_draw() {
if (blend_space->get_snap().y > 0) {
- int prev_idx;
+ int prev_idx = 0;
for (int i = 0; i < s.y; i++) {
float v = blend_space->get_max_space().y - i * (blend_space->get_max_space().y - blend_space->get_min_space().y) / s.y;
diff --git a/editor/plugins/canvas_item_editor_plugin.h b/editor/plugins/canvas_item_editor_plugin.h
index 6a788692d7..4f8cc6ab5e 100644
--- a/editor/plugins/canvas_item_editor_plugin.h
+++ b/editor/plugins/canvas_item_editor_plugin.h
@@ -280,6 +280,10 @@ private:
Transform2D xform;
float length;
uint64_t last_pass;
+
+ BoneList() :
+ length(0.f),
+ last_pass(0) {}
};
uint64_t bone_last_frame;
diff --git a/main/tests/test_oa_hash_map.cpp b/main/tests/test_oa_hash_map.cpp
index 0e34faace7..26e728d3aa 100644
--- a/main/tests/test_oa_hash_map.cpp
+++ b/main/tests/test_oa_hash_map.cpp
@@ -48,7 +48,7 @@ MainLoop *test() {
map.set(1337, 21);
map.set(42, 11880);
- int value;
+ int value = 0;
map.lookup(42, value);
OS::get_singleton()->print("capacity %d\n", map.get_capacity());
diff --git a/modules/csg/csg.cpp b/modules/csg/csg.cpp
index 567485c2c7..f0103bb71d 100644
--- a/modules/csg/csg.cpp
+++ b/modules/csg/csg.cpp
@@ -750,7 +750,7 @@ void CSGBrushOperation::_add_poly_outline(const BuildPoly &p_poly, int p_from_po
t2d.affine_invert();
- float max_angle;
+ float max_angle = 0;
int next_point_angle = -1;
for (int i = 0; i < vertex_process[to_point].size(); i++) {
diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp
index 714be16db7..d1ef08dc83 100644
--- a/modules/csg/csg_shape.cpp
+++ b/modules/csg/csg_shape.cpp
@@ -1573,7 +1573,7 @@ CSGBrush *CSGPolygon::_build_brush() {
}
CSGBrush *brush = memnew(CSGBrush);
- int face_count;
+ int face_count = 0;
switch (mode) {
case MODE_DEPTH: face_count = triangles.size() * 2 / 3 + (final_polygon.size()) * 2; break;
diff --git a/modules/gdnative/nativescript/api_generator.cpp b/modules/gdnative/nativescript/api_generator.cpp
index 0983c12619..8c6dace847 100644
--- a/modules/gdnative/nativescript/api_generator.cpp
+++ b/modules/gdnative/nativescript/api_generator.cpp
@@ -292,6 +292,7 @@ List<ClassAPI> generate_c_api_classes() {
method_api.has_varargs = method_bind && method_bind->is_vararg();
// Method flags
+ method_api.is_virtual = false;
if (method_info.flags) {
const uint32_t flags = method_info.flags;
method_api.is_editor = flags & METHOD_FLAG_EDITOR;
diff --git a/scene/2d/tile_map.cpp b/scene/2d/tile_map.cpp
index 5b8d10ea85..a60ce47f5c 100644
--- a/scene/2d/tile_map.cpp
+++ b/scene/2d/tile_map.cpp
@@ -304,7 +304,7 @@ void TileMap::update_dirty_quadrants() {
}
q.occluder_instances.clear();
Ref<ShaderMaterial> prev_material;
- int prev_z_index;
+ int prev_z_index = 0;
RID prev_canvas_item;
RID prev_debug_canvas_item;
diff --git a/scene/3d/voxel_light_baker.cpp b/scene/3d/voxel_light_baker.cpp
index 68359eac52..5580cabe30 100644
--- a/scene/3d/voxel_light_baker.cpp
+++ b/scene/3d/voxel_light_baker.cpp
@@ -1589,8 +1589,8 @@ Vector3 VoxelLightBaker::_compute_pixel_light_at_pos(const Vector3 &p_pos, const
const Vector3 *cone_dirs;
const float *cone_weights;
- int cone_dir_count;
- float cone_aperture;
+ int cone_dir_count = 0;
+ float cone_aperture = 0;
switch (bake_quality) {
case BAKE_QUALITY_LOW: {
diff --git a/scene/animation/animation_blend_space_2d.cpp b/scene/animation/animation_blend_space_2d.cpp
index f5f899a6cd..9321133d5f 100644
--- a/scene/animation/animation_blend_space_2d.cpp
+++ b/scene/animation/animation_blend_space_2d.cpp
@@ -468,7 +468,7 @@ float AnimationNodeBlendSpace2D::process(float p_time, bool p_seek) {
}
first = true;
- float mind;
+ float mind = 0;
for (int i = 0; i < blend_points_used; i++) {
bool found = false;