Merge pull request #112133 from akien-mga/4.2-fix-gcc-warnings

[4.2] CI: Fix build with latest MinGW-GCC 15
This commit is contained in:
Rémi Verschelde 2025-10-28 23:04:56 +01:00 committed by GitHub
commit 4c512045b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 22 additions and 13 deletions

View file

@ -2350,6 +2350,10 @@ void Image::initialize_data(const char **p_xpm) {
} break; } break;
case READING_PIXELS: { case READING_PIXELS: {
int y = line - colormap_size - 1; 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++) { for (int x = 0; x < size_width; x++) {
char pixelstr[6] = { 0, 0, 0, 0, 0, 0 }; char pixelstr[6] = { 0, 0, 0, 0, 0, 0 };
for (int i = 0; i < pixelchars; i++) { for (int i = 0; i < pixelchars; i++) {
@ -2364,6 +2368,9 @@ void Image::initialize_data(const char **p_xpm) {
} }
_put_pixelb(x, y, pixel_size, data_write, pixel); _put_pixelb(x, y, pixel_size, data_write, pixel);
} }
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
if (y == (size_height - 1)) { if (y == (size_height - 1)) {
status = DONE; status = DONE;

0
doc/tools/make_rst.py Normal file → Executable file
View file

View file

@ -1475,7 +1475,7 @@ void TextureStorage::update_texture_atlas() {
//generate atlas //generate atlas
Vector<TextureAtlas::SortItem> itemsv; Vector<TextureAtlas::SortItem> itemsv;
itemsv.resize(texture_atlas.textures.size()); itemsv.resize(texture_atlas.textures.size());
int base_size = 8; uint32_t base_size = 8;
int idx = 0; int idx = 0;
@ -1488,7 +1488,7 @@ void TextureStorage::update_texture_atlas() {
si.size.height = (src_tex->height / border) + 1; si.size.height = (src_tex->height / border) + 1;
si.pixel_size = Size2i(src_tex->width, src_tex->height); 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); base_size = nearest_power_of_2_templated(si.size.width);
} }
@ -1519,7 +1519,7 @@ void TextureStorage::update_texture_atlas() {
TextureAtlas::SortItem &si = items[i]; TextureAtlas::SortItem &si = items[i];
int best_idx = -1; int best_idx = -1;
int best_height = 0x7FFFFFFF; 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; int height = 0;
for (int k = 0; k < si.size.width; k++) { for (int k = 0; k < si.size.width; k++) {
int h = v_offsets[k + j]; int h = v_offsets[k + j];
@ -1550,7 +1550,7 @@ void TextureStorage::update_texture_atlas() {
} }
} }
if (max_height <= base_size * 2) { if ((uint32_t)max_height <= base_size * 2) {
atlas_height = max_height; atlas_height = max_height;
break; //good ratio, break; break; //good ratio, break;
} }

View file

@ -89,7 +89,7 @@ __CRT_UUID_DECL(IAudioClient3, 0x7ED4EE07, 0x8E67, 0x4CD4, 0x8C, 0x1A, 0x2B, 0x7
#endif // __MINGW32__ || __MINGW64__ #endif // __MINGW32__ || __MINGW64__
#ifndef PKEY_Device_FriendlyName #ifndef PKEY_Device_FriendlyNameGodot
#undef DEFINE_PROPERTYKEY #undef DEFINE_PROPERTYKEY
/* clang-format off */ /* 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 }; const PROPERTYKEY id = { { a, b, c, { d, e, f, g, h, i, j, k, } }, l };
/* clang-format on */ /* 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 #endif
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator); const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
@ -237,7 +237,7 @@ Error AudioDriverWASAPI::audio_device_init(AudioDeviceWASAPI *p_device, bool p_i
PROPVARIANT propvar; PROPVARIANT propvar;
PropVariantInit(&propvar); PropVariantInit(&propvar);
hr = props->GetValue(PKEY_Device_FriendlyName, &propvar); hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar);
ERR_BREAK(hr != S_OK); ERR_BREAK(hr != S_OK);
if (p_device->device_name == String(propvar.pwszVal)) { if (p_device->device_name == String(propvar.pwszVal)) {
@ -609,7 +609,7 @@ PackedStringArray AudioDriverWASAPI::audio_device_get_list(bool p_input) {
PROPVARIANT propvar; PROPVARIANT propvar;
PropVariantInit(&propvar); PropVariantInit(&propvar);
hr = props->GetValue(PKEY_Device_FriendlyName, &propvar); hr = props->GetValue(PKEY_Device_FriendlyNameGodot, &propvar);
ERR_BREAK(hr != S_OK); ERR_BREAK(hr != S_OK);
list.push_back(String(propvar.pwszVal)); list.push_back(String(propvar.pwszVal));

View file

@ -1938,7 +1938,8 @@ void TileMapLayer::set_tile_data(TileMapLayer::DataFormat p_format, const Vector
for (int i = 0; i < c; i += offset) { for (int i = 0; i < c; i += offset) {
const uint8_t *ptr = (const uint8_t *)&r[i]; const uint8_t *ptr = (const uint8_t *)&r[i];
uint8_t local[12]; uint8_t local[12];
for (int j = 0; j < ((p_format >= TileMapLayer::FORMAT_2) ? 12 : 8); j++) { const int buffer_size = (p_format >= TileMapLayer::FORMAT_2) ? 12 : 8;
for (int j = 0; j < buffer_size; j++) {
local[j] = ptr[j]; local[j] = ptr[j];
} }

View file

@ -157,6 +157,7 @@ Node *SceneState::instantiate(GenEditState p_edit_state) const {
const NodeData *nd = &nodes[0]; const NodeData *nd = &nodes[0];
Node **ret_nodes = (Node **)alloca(sizeof(Node *) * nc); 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(); bool gen_node_path_cache = p_edit_state != GEN_EDIT_STATE_DISABLED && node_path_cache.is_empty();

View file

@ -2552,7 +2552,7 @@ void TextureStorage::update_decal_atlas() {
//generate atlas //generate atlas
Vector<DecalAtlas::SortItem> itemsv; Vector<DecalAtlas::SortItem> itemsv;
itemsv.resize(decal_atlas.textures.size()); itemsv.resize(decal_atlas.textures.size());
int base_size = 8; uint32_t base_size = 8;
int idx = 0; int idx = 0;
@ -2565,7 +2565,7 @@ void TextureStorage::update_decal_atlas() {
si.size.height = (src_tex->height / border) + 1; si.size.height = (src_tex->height / border) + 1;
si.pixel_size = Size2i(src_tex->width, src_tex->height); 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); base_size = nearest_power_of_2_templated(si.size.width);
} }
@ -2596,7 +2596,7 @@ void TextureStorage::update_decal_atlas() {
DecalAtlas::SortItem &si = items[i]; DecalAtlas::SortItem &si = items[i];
int best_idx = -1; int best_idx = -1;
int best_height = 0x7FFFFFFF; 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; int height = 0;
for (int k = 0; k < si.size.width; k++) { for (int k = 0; k < si.size.width; k++) {
int h = v_offsets[k + j]; int h = v_offsets[k + j];
@ -2627,7 +2627,7 @@ void TextureStorage::update_decal_atlas() {
} }
} }
if (max_height <= base_size * 2) { if ((uint32_t)max_height <= base_size * 2) {
atlas_height = max_height; atlas_height = max_height;
break; //good ratio, break; break; //good ratio, break;
} }