diff --git a/core/io/image.cpp b/core/io/image.cpp index 57408dc8034..eb5df23927a 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -2338,6 +2338,10 @@ void Image::initialize_data(const char **p_xpm) { } break; case READING_PIXELS: { int y = line - colormap_size - 1; +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic warning "-Wstringop-overflow=0" +#endif for (int x = 0; x < size_width; x++) { char pixelstr[6] = { 0, 0, 0, 0, 0, 0 }; for (int i = 0; i < pixelchars; i++) { @@ -2352,6 +2356,9 @@ void Image::initialize_data(const char **p_xpm) { } _put_pixelb(x, y, pixel_size, data_write, pixel); } +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif if (y == (size_height - 1)) { status = DONE; diff --git a/drivers/gles3/storage/texture_storage.cpp b/drivers/gles3/storage/texture_storage.cpp index 256a5c8ef5c..d5619d48604 100644 --- a/drivers/gles3/storage/texture_storage.cpp +++ b/drivers/gles3/storage/texture_storage.cpp @@ -1453,7 +1453,7 @@ void TextureStorage::update_texture_atlas() { //generate atlas Vector itemsv; itemsv.resize(texture_atlas.textures.size()); - int base_size = 8; + uint32_t base_size = 8; int idx = 0; @@ -1466,7 +1466,7 @@ void TextureStorage::update_texture_atlas() { si.size.height = (src_tex->height / border) + 1; si.pixel_size = Size2i(src_tex->width, src_tex->height); - if (base_size < si.size.width) { + if (base_size < (uint32_t)si.size.width) { base_size = nearest_power_of_2_templated(si.size.width); } @@ -1497,7 +1497,7 @@ void TextureStorage::update_texture_atlas() { TextureAtlas::SortItem &si = items[i]; int best_idx = -1; int best_height = 0x7FFFFFFF; - for (int j = 0; j <= base_size - si.size.width; j++) { + for (uint32_t j = 0; j <= base_size - si.size.width; j++) { int height = 0; for (int k = 0; k < si.size.width; k++) { int h = v_offsets[k + j]; @@ -1528,7 +1528,7 @@ void TextureStorage::update_texture_atlas() { } } - if (max_height <= base_size * 2) { + if ((uint32_t)max_height <= base_size * 2) { atlas_height = max_height; break; //good ratio, break; } diff --git a/drivers/wasapi/audio_driver_wasapi.cpp b/drivers/wasapi/audio_driver_wasapi.cpp index bea3c1d47d1..c46297e18c7 100644 --- a/drivers/wasapi/audio_driver_wasapi.cpp +++ b/drivers/wasapi/audio_driver_wasapi.cpp @@ -89,7 +89,7 @@ __CRT_UUID_DECL(IAudioClient3, 0x7ED4EE07, 0x8E67, 0x4CD4, 0x8C, 0x1A, 0x2B, 0x7 #endif // __MINGW32__ || __MINGW64__ -#ifndef PKEY_Device_FriendlyName +#ifndef PKEY_Device_FriendlyNameGodot #undef DEFINE_PROPERTYKEY /* clang-format off */ @@ -97,7 +97,7 @@ __CRT_UUID_DECL(IAudioClient3, 0x7ED4EE07, 0x8E67, 0x4CD4, 0x8C, 0x1A, 0x2B, 0x7 const PROPERTYKEY id = { { a, b, c, { d, e, f, g, h, i, j, k, } }, l }; /* clang-format on */ -DEFINE_PROPERTYKEY(PKEY_Device_FriendlyName, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); +DEFINE_PROPERTYKEY(PKEY_Device_FriendlyNameGodot, 0xa45c254e, 0xdf1c, 0x4efd, 0x80, 0x20, 0x67, 0xd1, 0x46, 0xa8, 0x50, 0xe0, 14); #endif const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator); @@ -237,7 +237,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_i PROPVARIANT propvar; PropVariantInit(&propvar); - hr = props->GetValue(PKEY_Device_FriendlyName, &propvar); + hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar); ERR_BREAK(hr != S_OK); if (p_device->device_name == String(propvar.pwszVal)) { @@ -609,7 +609,7 @@ PackedStringArray AudioDriverWASAPI::audio_device_get_list(bool p_input) { PROPVARIANT propvar; PropVariantInit(&propvar); - hr = props->GetValue(PKEY_Device_FriendlyName, &propvar); + hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar); ERR_BREAK(hr != S_OK); list.push_back(String(propvar.pwszVal)); diff --git a/scene/resources/packed_scene.cpp b/scene/resources/packed_scene.cpp index 9dcb7cecae4..b9e698d5294 100644 --- a/scene/resources/packed_scene.cpp +++ b/scene/resources/packed_scene.cpp @@ -108,6 +108,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const { const NodeData *nd = &nodes[0]; Node **ret_nodes = (Node **)alloca(sizeof(Node *) * nc); + ret_nodes[0] = nullptr; // Sidesteps "maybe uninitialized" false-positives on GCC. bool gen_node_path_cache = p_edit_state != GEN_EDIT_STATE_DISABLED && node_path_cache.is_empty(); diff --git a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp index 1d0ec7d204a..a2838361eca 100644 --- a/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp +++ b/servers/rendering/renderer_rd/storage_rd/texture_storage.cpp @@ -2101,7 +2101,7 @@ void TextureStorage::update_decal_atlas() { //generate atlas Vector itemsv; itemsv.resize(decal_atlas.textures.size()); - int base_size = 8; + uint32_t base_size = 8; int idx = 0; @@ -2114,7 +2114,7 @@ void TextureStorage::update_decal_atlas() { si.size.height = (src_tex->height / border) + 1; si.pixel_size = Size2i(src_tex->width, src_tex->height); - if (base_size < si.size.width) { + if (base_size < (uint32_t)si.size.width) { base_size = nearest_power_of_2_templated(si.size.width); } @@ -2145,7 +2145,7 @@ void TextureStorage::update_decal_atlas() { DecalAtlas::SortItem &si = items[i]; int best_idx = -1; int best_height = 0x7FFFFFFF; - for (int j = 0; j <= base_size - si.size.width; j++) { + for (uint32_t j = 0; j <= base_size - si.size.width; j++) { int height = 0; for (int k = 0; k < si.size.width; k++) { int h = v_offsets[k + j]; @@ -2176,7 +2176,7 @@ void TextureStorage::update_decal_atlas() { } } - if (max_height <= base_size * 2) { + if ((uint32_t)max_height <= base_size * 2) { atlas_height = max_height; break; //good ratio, break; } diff --git a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h index 21c7b667fd5..089f30912c3 100644 --- a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h +++ b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h @@ -20,7 +20,7 @@ extern "C" { #define vulkan_video_codec_h264std 1 -#include +#include "vulkan_video_codecs_common.h" #define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32 #define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6 #define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16 diff --git a/thirdparty/vulkan/include/vk_video/vulkan_video_codecs_common.h b/thirdparty/vulkan/include/vk_video/vulkan_video_codecs_common.h index f486d3ca3fe..43bfcd09ada 100644 --- a/thirdparty/vulkan/include/vk_video/vulkan_video_codecs_common.h +++ b/thirdparty/vulkan/include/vk_video/vulkan_video_codecs_common.h @@ -20,6 +20,10 @@ extern "C" { #define vulkan_video_codecs_common 1 +#if !defined(VK_NO_STDINT_H) + #include +#endif + #define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) diff --git a/thirdparty/vulkan/patches/vulkan-fix-apple-llvm-extern-c.patch b/thirdparty/vulkan/patches/vulkan-fix-apple-llvm-extern-c.patch new file mode 100644 index 00000000000..95c772a72cb --- /dev/null +++ b/thirdparty/vulkan/patches/vulkan-fix-apple-llvm-extern-c.patch @@ -0,0 +1,28 @@ +diff --git a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h +index 21c7b667fd..089f30912c 100644 +--- a/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h ++++ b/thirdparty/vulkan/include/vk_video/vulkan_video_codec_h264std.h +@@ -20,7 +20,7 @@ extern "C" { + + + #define vulkan_video_codec_h264std 1 +-#include ++#include "vulkan_video_codecs_common.h" + #define STD_VIDEO_H264_CPB_CNT_LIST_SIZE 32 + #define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_LISTS 6 + #define STD_VIDEO_H264_SCALING_LIST_4X4_NUM_ELEMENTS 16 +diff --git a/thirdparty/vulkan/include/vk_video/vulkan_video_codecs_common.h b/thirdparty/vulkan/include/vk_video/vulkan_video_codecs_common.h +index f486d3ca3f..43bfcd09ad 100644 +--- a/thirdparty/vulkan/include/vk_video/vulkan_video_codecs_common.h ++++ b/thirdparty/vulkan/include/vk_video/vulkan_video_codecs_common.h +@@ -20,6 +20,10 @@ extern "C" { + + + #define vulkan_video_codecs_common 1 ++#if !defined(VK_NO_STDINT_H) ++ #include ++#endif ++ + #define VK_MAKE_VIDEO_STD_VERSION(major, minor, patch) \ + ((((uint32_t)(major)) << 22) | (((uint32_t)(minor)) << 12) | ((uint32_t)(patch))) +