You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Core: Sidestep GCC false-positives
(cherry picked from commit acdb8667b5)
Adds some more fixes for 4.5 and earlier.
Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
This commit is contained in:
committed by
Rémi Verschelde
parent
81c1e8f9ad
commit
133780f530
@@ -2331,6 +2331,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++) {
|
||||||
@@ -2345,6 +2349,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;
|
||||||
|
|||||||
@@ -30,7 +30,14 @@
|
|||||||
|
|
||||||
#include "geometry_2d.h"
|
#include "geometry_2d.h"
|
||||||
|
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Walloc-zero"
|
||||||
|
#endif
|
||||||
#include "thirdparty/clipper2/include/clipper2/clipper.h"
|
#include "thirdparty/clipper2/include/clipper2/clipper.h"
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
#include "thirdparty/misc/polypartition.h"
|
#include "thirdparty/misc/polypartition.h"
|
||||||
#define STB_RECT_PACK_IMPLEMENTATION
|
#define STB_RECT_PACK_IMPLEMENTATION
|
||||||
#include "thirdparty/misc/stb_rect_pack.h"
|
#include "thirdparty/misc/stb_rect_pack.h"
|
||||||
|
|||||||
@@ -158,6 +158,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();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user