diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/image.cpp | 6 | ||||
-rw-r--r-- | core/io/translation_loader_po.cpp | 4 | ||||
-rw-r--r-- | core/math/face3.cpp | 2 | ||||
-rw-r--r-- | core/math/quick_hull.cpp | 6 | ||||
-rw-r--r-- | core/os/os.cpp | 3 | ||||
-rw-r--r-- | core/reference.h | 2 | ||||
-rw-r--r-- | core/ustring.cpp | 20 | ||||
-rw-r--r-- | core/vmap.h | 6 | ||||
-rw-r--r-- | core/vset.h | 7 |
9 files changed, 33 insertions, 23 deletions
diff --git a/core/image.cpp b/core/image.cpp index bb1ce2cee3..4d1f32c360 100644 --- a/core/image.cpp +++ b/core/image.cpp @@ -1256,9 +1256,9 @@ void Image::create(const char **p_xpm) { if (*line_ptr == '#') { line_ptr++; - uint8_t col_r; - uint8_t col_g; - uint8_t col_b; + uint8_t col_r = 0; + uint8_t col_g = 0; + uint8_t col_b = 0; //uint8_t col_a=255; for (int i = 0; i < 6; i++) { diff --git a/core/io/translation_loader_po.cpp b/core/io/translation_loader_po.cpp index 353eabea45..92af247823 100644 --- a/core/io/translation_loader_po.cpp +++ b/core/io/translation_loader_po.cpp @@ -51,8 +51,8 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error, const S Ref<Translation> translation = Ref<Translation>(memnew(Translation)); int line = 1; - bool skip_this; - bool skip_next; + bool skip_this = false; + bool skip_next = false; while (true) { diff --git a/core/math/face3.cpp b/core/math/face3.cpp index 748faad28f..e1b172e491 100644 --- a/core/math/face3.cpp +++ b/core/math/face3.cpp @@ -296,7 +296,7 @@ void Face3::get_support(const Vector3 &p_normal, const Transform &p_transform, V /** FIND SUPPORT VERTEX **/ int vert_support_idx = -1; - real_t support_max; + real_t support_max = 0; for (int i = 0; i < 3; i++) { diff --git a/core/math/quick_hull.cpp b/core/math/quick_hull.cpp index 2f3445bdcd..e0137b6921 100644 --- a/core/math/quick_hull.cpp +++ b/core/math/quick_hull.cpp @@ -76,7 +76,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me int simplex[4]; { - real_t max, min; + real_t max = 0, min = 0; for (int i = 0; i < p_points.size(); i++) { @@ -99,7 +99,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me //third vertex is one most further away from the line { - real_t maxd; + real_t maxd = 0; Vector3 rel12 = p_points[simplex[0]] - p_points[simplex[1]]; for (int i = 0; i < p_points.size(); i++) { @@ -121,7 +121,7 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me //fourth vertex is the one most further away from the plane { - real_t maxd; + real_t maxd = 0; Plane p(p_points[simplex[0]], p_points[simplex[1]], p_points[simplex[2]]); for (int i = 0; i < p_points.size(); i++) { diff --git a/core/os/os.cpp b/core/os/os.cpp index 1292b7eeed..764f7fe6e6 100644 --- a/core/os/os.cpp +++ b/core/os/os.cpp @@ -64,12 +64,13 @@ void OS::debug_break(){ void OS::print_error(const char *p_function, const char *p_file, int p_line, const char *p_code, const char *p_rationale, ErrorType p_type) { - const char *err_type; + const char *err_type = "**ERROR**"; switch (p_type) { case ERR_ERROR: err_type = "**ERROR**"; break; case ERR_WARNING: err_type = "**WARNING**"; break; case ERR_SCRIPT: err_type = "**SCRIPT ERROR**"; break; case ERR_SHADER: err_type = "**SHADER ERROR**"; break; + default: ERR_PRINT("Unknown error type"); break; } if (p_rationale && *p_rationale) diff --git a/core/reference.h b/core/reference.h index 5fe8296314..ca3ae60418 100644 --- a/core/reference.h +++ b/core/reference.h @@ -62,7 +62,7 @@ public: template <class T> class Ref { - T *reference; + T *reference = NULL; void ref(const Ref &p_from) { diff --git a/core/ustring.cpp b/core/ustring.cpp index 7f073b4e02..8273ed144b 100644 --- a/core/ustring.cpp +++ b/core/ustring.cpp @@ -3655,12 +3655,12 @@ String String::sprintf(const Array &values, bool *error) const { CharType *self = (CharType *)c_str(); bool in_format = false; int value_index = 0; - int min_chars; - int min_decimals; - bool in_decimals; - bool pad_with_zeroes; - bool left_justified; - bool show_sign; + int min_chars = 0; + int min_decimals = 0; + bool in_decimals = false; + bool pad_with_zeroes = false; + bool left_justified = false; + bool show_sign = false; *error = true; @@ -3687,12 +3687,12 @@ String String::sprintf(const Array &values, bool *error) const { } int64_t value = values[value_index]; - int base; + int base = 16; bool capitalize = false; switch (c) { case 'd': base = 10; break; case 'o': base = 8; break; - case 'x': base = 16; break; + case 'x': break; case 'X': base = 16; capitalize = true; @@ -3842,7 +3842,7 @@ String String::sprintf(const Array &values, bool *error) const { } break; } - case '.': { // Float separtor. + case '.': { // Float separator. if (in_decimals) { return "too many decimal points in format"; } @@ -3851,7 +3851,7 @@ String String::sprintf(const Array &values, bool *error) const { break; } - case '*': { // Dyanmic width, based on value. + case '*': { // Dynamic width, based on value. if (value_index >= values.size()) { return "not enough arguments for format string"; } diff --git a/core/vmap.h b/core/vmap.h index f0977341ec..8165a919b6 100644 --- a/core/vmap.h +++ b/core/vmap.h @@ -60,9 +60,13 @@ class VMap { int low = 0; int high = _data.size() - 1; - int middle; const _Pair *a = &_data[0]; + int middle = 0; +#if DEBUG_ENABLED + if (low > high) + ERR_PRINT("low > high, this may be a bug"); +#endif while (low <= high) { middle = (low + high) / 2; diff --git a/core/vset.h b/core/vset.h index 7b12ae0b25..67af6c1a4c 100644 --- a/core/vset.h +++ b/core/vset.h @@ -46,8 +46,13 @@ class VSet { int low = 0; int high = _data.size() - 1; - int middle; const T *a = &_data[0]; + int middle = 0; + +#if DEBUG_ENABLED + if (low > high) + ERR_PRINT("low > high, this may be a bug"); +#endif while (low <= high) { middle = (low + high) / 2; |