summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/image.cpp6
-rw-r--r--core/os/memory.cpp4
2 files changed, 7 insertions, 3 deletions
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..d212efe3cf 100644
--- a/core/os/memory.cpp
+++ b/core/os/memory.cpp
@@ -91,11 +91,15 @@ void *Memory::alloc_static(size_t p_bytes, bool p_pad_align) {
if (prepad) {
// Clang 5 wrongly complains about 's' being unused,
// while it's used to modify 'mem'.
+#ifdef __clang__
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wunused-variable"
+#endif // __clang__
uint64_t *s = (uint64_t *)mem;
*s = p_bytes;
+#ifdef __clang__
#pragma clang diagnostic pop
+#endif // __clang__
uint8_t *s8 = (uint8_t *)mem;