Merge pull request #98900 from akien-mga/3.2-ci-build-warnings-fixes
Some checks failed
🤖 Android Builds / Template (target=release, tools=no) (push) Has been cancelled
🍏 iOS Builds / Template (target=release, tools=no) (push) Has been cancelled
🌐 JavaScript Builds / Template (target=release, tools=no) (push) Has been cancelled
🐧 Linux Builds / Editor w/ Mono (target=release_debug, tools=yes) (push) Has been cancelled
🐧 Linux Builds / Template w/ Mono (target=release, tools=no) (push) Has been cancelled
🍎 macOS Builds / Editor (target=release_debug, tools=yes) (push) Has been cancelled
🍎 macOS Builds / Template (target=release, tools=no) (push) Has been cancelled
☁ Server Builds / Linux Headless w/ Mono (target=release_debug, tools=yes) (push) Has been cancelled
☁ Server Builds / Linux Server w/ Mono (target=release, tools=no) (push) Has been cancelled
📊 Static Checks / Static Checks (clang-format, black format, file format, documentation checks) (push) Has been cancelled
🏁 Windows Builds / Editor (target=release_debug, tools=yes) (push) Has been cancelled
🏁 Windows Builds / Template (target=release, tools=no) (push) Has been cancelled

[3.2] Misc. build and warning fixes to pass CI and compile with recent SCons and GCC/Clang
This commit is contained in:
Rémi Verschelde 2024-11-07 12:46:41 +01:00 committed by GitHub
commit a03019716e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
51 changed files with 3718 additions and 3611 deletions

View File

@ -4,6 +4,8 @@ on: [push, pull_request]
# Global Settings
env:
SCONSFLAGS: platform=android verbose=yes warnings=all werror=yes debug_symbols=no --jobs=2
ANDROID_HOME: /home/runner/work/godot/godot/android-sdk
ANDROID_NDK_ROOT: /home/runner/work/godot/godot/android-sdk/ndk/21.1.6352462
ANDROID_NDK_VERSION: 21.1.6352462
jobs:
@ -13,7 +15,7 @@ jobs:
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
@ -22,18 +24,23 @@ jobs:
sudo cp -f misc/ci/sources.list /etc/apt/sources.list
sudo apt-get update
- name: Set up Java 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Install Android NDK r21
- name: Set up Java 8, Android SDK and NDK
run: |
sudo ${ANDROID_HOME}/tools/bin/sdkmanager --install 'ndk;${{env.ANDROID_NDK_VERSION}}'
# Not using actions/setup-java and android-actions/setup-android as I couldn't make them work for such old Java/SDK/NDK combination.
sudo apt-get install openjdk-8-jdk
sudo update-alternatives --set java /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java
mkdir -p ${{env.ANDROID_HOME}}
cd ${{env.ANDROID_HOME}}
# Using an old version to be compatible with older Java.
curl -LO https://dl.google.com/android/repository/commandlinetools-linux-8512546_latest.zip
unzip commandlinetools-linux-8512546_latest.zip
yes | ./cmdline-tools/bin/sdkmanager --sdk_root=${{env.ANDROID_HOME}} --licenses
# https://github.com/godotengine/build-containers/blob/3.2/Dockerfile.android
./cmdline-tools/bin/sdkmanager --sdk_root=${{env.ANDROID_HOME}} 'build-tools;28.0.3' 'platforms;android-28' 'cmake;3.10.2.4988404' 'ndk;${{env.ANDROID_NDK_VERSION}}'
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
@ -48,8 +55,6 @@ jobs:
scons --version
- name: Compilation
env:
ANDROID_NDK_ROOT: /usr/local/lib/android/sdk/ndk/${{env.ANDROID_NDK_VERSION}}/
run: |
scons target=release tools=no android_arch=armv7
scons target=release tools=no android_arch=arm64v8

View File

@ -11,11 +11,11 @@ jobs:
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'

View File

@ -13,7 +13,7 @@ jobs:
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
@ -25,14 +25,14 @@ jobs:
# Additional cache for Emscripten generated system libraries
- name: Load Emscripten cache
id: javascript-template-emscripten-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{github.job}}
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
@ -48,7 +48,7 @@ jobs:
scons --version
- name: Set up Emscripten latest
uses: mymindstorm/setup-emsdk@v7
uses: mymindstorm/setup-emsdk@v14
with:
version: ${{env.EM_VERSION}}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}

View File

@ -11,7 +11,7 @@ jobs:
name: Editor w/ Mono (target=release_debug, tools=yes)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
@ -28,7 +28,7 @@ jobs:
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
@ -56,7 +56,7 @@ jobs:
name: Template w/ Mono (target=release, tools=no)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
@ -73,7 +73,7 @@ jobs:
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'

View File

@ -12,11 +12,11 @@ jobs:
name: Editor (target=release_debug, tools=yes)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
@ -42,11 +42,11 @@ jobs:
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'

View File

@ -11,7 +11,7 @@ jobs:
name: Linux Headless w/ Mono (target=release_debug, tools=yes)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
@ -27,7 +27,7 @@ jobs:
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
@ -52,7 +52,7 @@ jobs:
name: Linux Server w/ Mono (target=release, tools=no)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Azure repositories are not reliable, we need to prevent azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories
@ -68,7 +68,7 @@ jobs:
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'

View File

@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
# Azure repositories are not reliable, we need to prevent Azure giving us packages.
- name: Make apt sources.list use the default Ubuntu repositories

View File

@ -14,11 +14,11 @@ jobs:
name: Editor (target=release_debug, tools=yes)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Use python 3.x release (works cross platform; best to keep self contained in it's own step)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'
@ -44,11 +44,11 @@ jobs:
name: Template (target=release, tools=no)
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
# Use python 3.x release (works cross platform)
- name: Set up Python 3.x
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
# Semantic version range syntax or exact version of a Python version
python-version: '3.x'

View File

@ -407,18 +407,21 @@ if selected_platform in platform_list:
else: # Rest of the world
version = methods.get_compiler_version(env) or [-1, -1]
shadow_local_warning = []
all_plus_warnings = ["-Wwrite-strings"]
common_warnings = []
if methods.using_gcc(env):
env.Append(CCFLAGS=["-Wno-misleading-indentation"])
common_warnings += ["-Wno-misleading-indentation"]
if version[0] >= 7:
shadow_local_warning = ["-Wshadow-local"]
common_warnings += ["-Wshadow-local"]
elif methods.using_clang(env):
# We often implement `operator<` for structs of pointers as a requirement
# for putting them in `Set` or `Map`. We don't mind about unreliable ordering.
common_warnings += ["-Wno-ordered-compare-function-pointers"]
if env["warnings"] == "extra":
# Note: enable -Wimplicit-fallthrough for Clang (already part of -Wextra for GCC)
# once we switch to C++11 or later (necessary for our FALLTHROUGH macro).
env.Append(CCFLAGS=["-Wall", "-Wextra", "-Wno-unused-parameter"] + all_plus_warnings + shadow_local_warning)
env.Append(CCFLAGS=["-Wall", "-Wextra", "-Wwrite-strings", "-Wno-unused-parameter"] + common_warnings)
env.Append(CXXFLAGS=["-Wctor-dtor-privacy", "-Wnon-virtual-dtor"])
if methods.using_gcc(env):
env.Append(
@ -434,9 +437,9 @@ if selected_platform in platform_list:
if version[0] >= 9:
env.Append(CCFLAGS=["-Wattribute-alias=2"])
elif env["warnings"] == "all":
env.Append(CCFLAGS=["-Wall"] + shadow_local_warning)
env.Append(CCFLAGS=["-Wall"] + common_warnings)
elif env["warnings"] == "moderate":
env.Append(CCFLAGS=["-Wall", "-Wno-unused"] + shadow_local_warning)
env.Append(CCFLAGS=["-Wall", "-Wno-unused"] + common_warnings)
else: # 'no'
env.Append(CCFLAGS=["-w"])
if env["werror"]:

View File

@ -999,7 +999,9 @@ struct _OSCoreBindImg {
};
void _OS::print_all_textures_by_size() {
// HACK: This is broken, was fixed in 3.4+, we don't bother here.
// Just comment out to silence warnings.
/*
List<_OSCoreBindImg> imgs;
int total = 0;
{
@ -1031,6 +1033,7 @@ void _OS::print_all_textures_by_size() {
total -= E->get().vram;
}
*/
}
void _OS::print_resources_by_type(const Vector<String> &p_types) {

View File

@ -62,7 +62,6 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) {
int idx = 0;
int total_compression_size = 0;
int total_string_size = 0;
for (List<StringName>::Element *E = keys.front(); E; E = E->next()) {
@ -101,7 +100,6 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) {
compressed.write[idx] = ps;
total_compression_size += ps.compressed.size();
total_string_size += src_s.size();
idx++;
}
@ -148,7 +146,6 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) {
uint32_t *btw = (uint32_t *)&btwb[0];
int btindex = 0;
int collisions = 0;
for (int i = 0; i < size; i++) {
@ -156,8 +153,6 @@ void PHashTranslation::generate(const Ref<Translation> &p_from) {
if (t.size() == 0) {
htw[i] = 0xFFFFFFFF; //nothing
continue;
} else if (t.size() > 1) {
collisions += t.size() - 1;
}
htw[i] = btindex;

View File

@ -32,6 +32,7 @@
#define COWDATA_H_
#include <string.h>
#include <type_traits>
#include "core/error_macros.h"
#include "core/os/memory.h"
@ -199,7 +200,7 @@ void CowData<T>::_unref(void *p_data) {
return; // still in use
// clean up
if (!__has_trivial_destructor(T)) {
if (!std::is_trivially_destructible<T>::value) {
uint32_t *count = _get_size();
T *data = (T *)(count + 1);
@ -233,7 +234,7 @@ void CowData<T>::_copy_on_write() {
T *_data = (T *)(mem_new);
// initialize new elements
if (__has_trivial_copy(T)) {
if (std::is_trivially_copyable<T>::value) {
memcpy(mem_new, _ptr, current_size * sizeof(T));
} else {
@ -292,7 +293,7 @@ Error CowData<T>::resize(int p_size) {
// construct the newly created elements
if (!__has_trivial_constructor(T)) {
if (!std::is_trivially_constructible<T>::value) {
T *elems = _get_data();
for (int i = *_get_size(); i < p_size; i++) {
@ -303,8 +304,7 @@ Error CowData<T>::resize(int p_size) {
*_get_size() = p_size;
} else if (p_size < current_size) {
if (!__has_trivial_destructor(T)) {
if (!std::is_trivially_destructible<T>::value) {
// deinitialize no longer needed elements
for (uint32_t i = p_size; i < *_get_size(); i++) {
T *t = &_get_data()[i];

View File

@ -151,10 +151,11 @@ void RotatedFileLogger::rotate_file() {
if (FileAccess::exists(base_path)) {
if (max_files > 1) {
char timestamp[21];
const size_t TIMESTAMP_SIZE = 21;
char timestamp[TIMESTAMP_SIZE];
OS::Date date = OS::get_singleton()->get_date();
OS::Time time = OS::get_singleton()->get_time();
sprintf(timestamp, "_%04d-%02d-%02d_%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec);
snprintf(timestamp, TIMESTAMP_SIZE, "_%04d-%02d-%02d_%02d-%02d-%02d", date.year, date.month, date.day, time.hour, time.min, time.sec);
String backup_name = base_path.get_basename() + timestamp;
if (base_path.get_extension() != String()) {

View File

@ -50,7 +50,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
*r_error = ERR_FILE_CORRUPT;
Ref<Translation> translation = Ref<Translation>(memnew(Translation));
#ifdef DEBUG_ENABLED
int line = 1;
#endif
bool skip_this = false;
bool skip_next = false;
bool is_eof = false;
@ -108,7 +110,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
if (l.find("fuzzy") != -1) {
skip_next = true;
}
#ifdef DEBUG_ENABLED
line++;
#endif
continue; //nothing to read or comment
}
@ -141,7 +145,9 @@ RES TranslationLoaderPO::load_translation(FileAccess *f, Error *r_error) {
else
msg_str += l;
#ifdef DEBUG_ENABLED
line++;
#endif
}
memdelete(f);

View File

@ -286,7 +286,7 @@ static int _bsp_find_best_half_plane(const Face3 *p_faces, const Vector<int> &p_
const Face3 &f = p_faces[indices[i]];
Plane p = f.get_plane();
int num_over = 0, num_under = 0, num_spanning = 0;
int num_over = 0, num_under = 0; //num_spanning = 0;
for (int j = 0; j < ic; j++) {
@ -309,9 +309,9 @@ static int _bsp_find_best_half_plane(const Face3 *p_faces, const Vector<int> &p_
}
}
if (over && under)
num_spanning++;
else if (over)
if (over && under) {
//num_spanning++;
} else if (over)
num_over++;
else
num_under++;

View File

@ -404,7 +404,6 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me
if (O->get().plane.is_equal_approx(f.plane)) {
//merge and delete edge and contiguous face, while repointing edges (uuugh!)
int ois = O->get().indices.size();
int merged = 0;
for (int j = 0; j < ois; j++) {
//search a
@ -420,7 +419,6 @@ Error QuickHull::build(const Vector<Vector3> &p_points, Geometry::MeshData &r_me
if (idx != a) {
f.indices.insert(i + 1, idx);
i++;
merged++;
}
Edge e2(idx, idxn);

View File

@ -35,6 +35,7 @@
#include "core/safe_refcount.h"
#include <stddef.h>
#include <type_traits>
#ifndef PAD_ALIGN
#define PAD_ALIGN 16 //must always be greater than this at much
@ -113,8 +114,9 @@ void memdelete(T *p_class) {
if (!predelete_handler(p_class))
return; // doesn't want to be deleted
if (!__has_trivial_destructor(T))
if (!std::is_trivially_destructible<T>::value) {
p_class->~T();
}
Memory::free_static(p_class, false);
}
@ -124,8 +126,9 @@ void memdelete_allocator(T *p_class) {
if (!predelete_handler(p_class))
return; // doesn't want to be deleted
if (!__has_trivial_destructor(T))
if (!std::is_trivially_destructible<T>::value) {
p_class->~T();
}
A::free(p_class);
}
@ -151,7 +154,7 @@ T *memnew_arr_template(size_t p_elements, const char *p_descr = "") {
ERR_FAIL_COND_V(!mem, failptr);
*(mem - 1) = p_elements;
if (!__has_trivial_constructor(T)) {
if (!std::is_trivially_constructible<T>::value) {
T *elems = (T *)mem;
/* call operator new */
@ -180,7 +183,7 @@ void memdelete_arr(T *p_class) {
uint64_t *ptr = (uint64_t *)p_class;
if (!__has_trivial_destructor(T)) {
if (!std::is_trivially_destructible<T>::value) {
uint64_t elem_count = *(ptr - 1);
for (uint64_t i = 0; i < elem_count; i++) {

View File

@ -213,12 +213,12 @@ public:
size_mask = mask;
};
RingBuffer<T>(int p_power = 0) {
RingBuffer(int p_power = 0) {
read_pos = 0;
write_pos = 0;
resize(p_power);
};
~RingBuffer<T>(){};
~RingBuffer() {}
};
#endif

View File

@ -2733,8 +2733,9 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
use_post_process = use_post_process && (env->adjustments_enabled || env->glow_enabled || env->dof_blur_far_enabled || env->dof_blur_near_enabled);
}
// If using multisample buffer, resolve to post_process_effect buffer or to front buffer
if (storage->frame.current_rt && storage->frame.current_rt->multisample_active) {
GLuint next_buffer;
if (use_post_process) {
next_buffer = storage->frame.current_rt->mip_maps[0].sizes[0].fbo;
} else if (storage->frame.current_rt->external.fbo != 0) {
@ -2744,10 +2745,7 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
next_buffer = storage->frame.current_rt->fbo;
}
// If using multisample buffer, resolve to post_process_effect buffer or to front buffer
if (storage->frame.current_rt && storage->frame.current_rt->multisample_active) {
#ifdef GLES_OVER_GL
glBindFramebuffer(GL_READ_FRAMEBUFFER, storage->frame.current_rt->multisample_fbo);
glReadBuffer(GL_COLOR_ATTACHMENT0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, next_buffer);
@ -2769,6 +2767,7 @@ void RasterizerSceneGLES2::_post_process(Environment *env, const CameraMatrix &p
_copy_texture_to_buffer(storage->frame.current_rt->multisample_color, next_buffer);
#else
// TODO: any other platform not supported? this will fail.. maybe we should just call _copy_texture_to_buffer here as well?
(void)next_buffer; // Silence warning as it's unused.
#endif
} else if (use_post_process) {
if (storage->frame.current_rt->external.fbo != 0) {

View File

@ -535,7 +535,6 @@ private:
Vector<String> failed_files;
int idx = 0;
while (ret == UNZ_OK) {
//get filename
@ -587,7 +586,6 @@ private:
}
}
idx++;
ret = unzGoToNextFile(pkg);
}

View File

@ -200,18 +200,14 @@ String ScriptCreateDialog::_validate_path(const String &p_path, bool p_file_must
bool found = false;
bool match = false;
int index = 0;
for (List<String>::Element *E = extensions.front(); E; E = E->next()) {
if (E->get().nocasecmp_to(extension) == 0) {
//FIXME (?) - changing language this way doesn't update controls, needs rework
//language_menu->select(index); // change Language option by extension
found = true;
if (E->get() == ScriptServer::get_language(language_menu->get_selected())->get_extension()) {
match = true;
}
break;
}
index++;
}
if (!found) return TTR("Invalid extension.");

View File

@ -1022,7 +1022,7 @@ InputDefault::JoyEvent InputDefault::_get_mapped_axis_event(const JoyDeviceMappi
return event;
}
void InputDefault::_get_mapped_hat_events(const JoyDeviceMapping &mapping, int p_hat, JoyEvent r_events[]) {
void InputDefault::_get_mapped_hat_events(const JoyDeviceMapping &mapping, int p_hat, JoyEvent r_events[(size_t)HAT_MAX]) {
for (int i = 0; i < mapping.bindings.size(); i++) {
const JoyBinding binding = mapping.bindings[i];

View File

@ -703,7 +703,7 @@ def get_compiler_version(env):
return None
else: # TODO: Implement for MSVC
return None
match = re.search("[0-9]+\.[0-9.]+", version)
match = re.search(r"[0-9]+\.[0-9.]+", version)
if match is not None:
return list(map(int, match.group().split(".")))
else:

View File

@ -726,7 +726,7 @@ void CSGBrushOperation::MeshMerge::mark_inside_faces() {
}
}
void CSGBrushOperation::MeshMerge::add_face(const Vector3 p_points[], const Vector2 p_uvs[], bool p_smooth, bool p_invert, const Ref<Material> &p_material, bool p_from_b) {
void CSGBrushOperation::MeshMerge::add_face(const Vector3 p_points[3], const Vector2 p_uvs[3], bool p_smooth, bool p_invert, const Ref<Material> &p_material, bool p_from_b) {
int indices[3];
for (int i = 0; i < 3; i++) {
@ -1380,14 +1380,14 @@ void CSGBrushOperation::update_faces(const CSGBrush &p_brush_a, const int p_face
if (has_degenerate) return;
// Ensure B has points either side of or in the plane of A.
int in_plane_count = 0, over_count = 0, under_count = 0;
int over_count = 0, under_count = 0;
Plane plane_a(vertices_a[0], vertices_a[1], vertices_a[2]);
ERR_FAIL_COND_MSG(plane_a.normal == Vector3(), "Couldn't form plane from Brush A face.");
for (int i = 0; i < 3; i++) {
if (plane_a.has_point(vertices_b[i]))
in_plane_count++;
else if (plane_a.is_point_over(vertices_b[i]))
if (plane_a.has_point(vertices_b[i])) {
// In plane.
} else if (plane_a.is_point_over(vertices_b[i]))
over_count++;
else
under_count++;
@ -1396,16 +1396,15 @@ void CSGBrushOperation::update_faces(const CSGBrush &p_brush_a, const int p_face
if (over_count == 3 || under_count == 3) return;
// Ensure A has points either side of or in the plane of B.
in_plane_count = 0;
over_count = 0;
under_count = 0;
Plane plane_b(vertices_b[0], vertices_b[1], vertices_b[2]);
ERR_FAIL_COND_MSG(plane_b.normal == Vector3(), "Couldn't form plane from Brush B face.");
for (int i = 0; i < 3; i++) {
if (plane_b.has_point(vertices_a[i]))
in_plane_count++;
else if (plane_b.is_point_over(vertices_a[i]))
if (plane_b.has_point(vertices_a[i])) {
// In plane.
} else if (plane_b.is_point_over(vertices_a[i]))
over_count++;
else
under_count++;

View File

@ -170,6 +170,7 @@ void image_compress_cvtt(Image *p_image, float p_lossy_quality, Image::CompressS
if (p_source == Image::COMPRESS_SOURCE_NORMAL) {
flags |= cvtt::Flags::Uniform;
}
options.flags = flags;
Image::Format target_format = Image::FORMAT_BPTC_RGBA;

View File

@ -1264,7 +1264,6 @@ int GDScriptCompiler::_parse_expression(CodeGen &codegen, const GDScriptParser::
Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::BlockNode *p_block, int p_stack_level, int p_break_addr, int p_continue_addr) {
codegen.push_stack_identifiers();
int new_identifiers = 0;
codegen.current_line = p_block->line;
for (int i = 0; i < p_block->statements.size(); i++) {
@ -1297,7 +1296,6 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
// copied because there is no _parse_statement :(
codegen.add_stack_identifier(id->name, p_stack_level++);
codegen.alloc_stack(p_stack_level);
new_identifiers++;
GDScriptParser::OperatorNode *op = memnew(GDScriptParser::OperatorNode);
op->op = GDScriptParser::OperatorNode::OP_ASSIGN;
@ -1557,8 +1555,6 @@ Error GDScriptCompiler::_parse_block(CodeGen &codegen, const GDScriptParser::Blo
codegen.add_stack_identifier(lv->name, p_stack_level++);
codegen.alloc_stack(p_stack_level);
new_identifiers++;
} break;
default: {
//expression

View File

@ -7109,9 +7109,11 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
DataType return_type;
List<DataType> arg_types;
int default_args_count = 0;
int arg_count = p_call->arguments.size();
String callee_name;
bool is_vararg = false;
#ifdef DEBUG_ENABLED
int arg_count = p_call->arguments.size();
#endif
switch (p_call->arguments[0]->type) {
case GDScriptParser::Node::TYPE_TYPE: {
@ -7218,7 +7220,9 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
default_args_count = mi.default_arguments.size();
callee_name = mi.name;
#ifdef DEBUG_ENABLED
arg_count -= 1;
#endif
// Check each argument type
for (List<PropertyInfo>::Element *E = mi.arguments.front(); E; E = E->next()) {
@ -7245,7 +7249,9 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
IdentifierNode *func_id = static_cast<IdentifierNode *>(p_call->arguments[arg_id]);
callee_name = func_id->name;
#ifdef DEBUG_ENABLED
arg_count -= 1 + arg_id;
#endif
DataType base_type;
if (p_call->op == OperatorNode::OP_PARENT_CALL) {
@ -7424,7 +7430,6 @@ GDScriptParser::DataType GDScriptParser::_reduce_function_call_type(const Operat
}
}
}
#endif // DEBUG_ENABLED
return return_type;

View File

@ -470,9 +470,8 @@ def copy_mono_root_files(env, mono_root):
def copy_mono_etc_dir(mono_root, target_mono_config_dir, platform):
from distutils.dir_util import copy_tree
from glob import glob
from shutil import copy
from shutil import copy, copytree
if not os.path.isdir(target_mono_config_dir):
os.makedirs(target_mono_config_dir)
@ -492,11 +491,11 @@ def copy_mono_etc_dir(mono_root, target_mono_config_dir, platform):
if not mono_etc_dir:
raise RuntimeError("Mono installation etc directory not found")
copy_tree(os.path.join(mono_etc_dir, "2.0"), os.path.join(target_mono_config_dir, "2.0"))
copy_tree(os.path.join(mono_etc_dir, "4.0"), os.path.join(target_mono_config_dir, "4.0"))
copy_tree(os.path.join(mono_etc_dir, "4.5"), os.path.join(target_mono_config_dir, "4.5"))
copytree(os.path.join(mono_etc_dir, "2.0"), os.path.join(target_mono_config_dir, "2.0"))
copytree(os.path.join(mono_etc_dir, "4.0"), os.path.join(target_mono_config_dir, "4.0"))
copytree(os.path.join(mono_etc_dir, "4.5"), os.path.join(target_mono_config_dir, "4.5"))
if os.path.isdir(os.path.join(mono_etc_dir, "mconfig")):
copy_tree(os.path.join(mono_etc_dir, "mconfig"), os.path.join(target_mono_config_dir, "mconfig"))
copytree(os.path.join(mono_etc_dir, "mconfig"), os.path.join(target_mono_config_dir, "mconfig"))
for file in glob(os.path.join(mono_etc_dir, "*")):
if os.path.isfile(file):

View File

@ -1,7 +1,6 @@
import os
import sys
import platform
from distutils.version import LooseVersion
def is_active():
@ -265,8 +264,14 @@ def configure(env):
# Link flags
# HACK: Replaced use of now obsoleted distutils.version.LooseVersion with this simple method,
# which isn't bullet proof but should be sufficient here with "x.y.z" parameters.
# Alternatives imply adding more dependencies.
def version_tuple(v):
return tuple(map(int, (v.split("."))))
ndk_version = get_ndk_version(env["ANDROID_NDK_ROOT"])
if ndk_version != None and LooseVersion(ndk_version) >= LooseVersion("17.1.4828580"):
if ndk_version != None and version_tuple(ndk_version) >= version_tuple("17.1.4828580"):
env.Append(LINKFLAGS=["-Wl,--exclude-libs,libgcc.a", "-Wl,--exclude-libs,libatomic.a", "-nostdlib++"])
else:
env.Append(

View File

@ -1169,7 +1169,6 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
pkg_name = "Unnamed";
bool found_library = false;
int total_size = 0;
const String project_file = "godot_ios.xcodeproj/project.pbxproj";
Set<String> files_to_parse;
@ -1275,7 +1274,6 @@ Error EditorExportPlatformIOS::export_project(const Ref<EditorExportPreset> &p_p
file = file.replace("godot_ios", binary_name);
print_line("ADDING: " + file + " size: " + itos(data.size()));
total_size += data.size();
/* write it into our folder structure */
file = dest_dir + file;

View File

@ -32,20 +32,9 @@
#include "game_center.h"
#ifdef __IPHONE_9_0
#import <GameKit/GameKit.h>
extern "C" {
#else
extern "C" {
#import <GameKit/GameKit.h>
#endif
#import "app_delegate.h"
};
#import <GameKit/GameKit.h>
GameCenter *GameCenter::instance = NULL;

View File

@ -32,18 +32,10 @@
#include "icloud.h"
#ifndef __IPHONE_9_0
extern "C" {
#endif
#import "app_delegate.h"
#import <Foundation/Foundation.h>
#ifndef __IPHONE_9_0
};
#endif
ICloud *ICloud::instance = NULL;
void ICloud::_bind_methods() {

View File

@ -32,10 +32,8 @@
#include "in_app_store.h"
extern "C" {
#import <Foundation/Foundation.h>
#import <StoreKit/StoreKit.h>
};
bool auto_finish_transactions = true;
NSMutableDictionary *pending_transactions = [NSMutableDictionary dictionary];

View File

@ -1,6 +1,7 @@
import os
from emscripten_helpers import parse_config, run_closure_compiler, create_engine_file
from emscripten_helpers import run_closure_compiler, create_engine_file
from SCons.Util import WhereIs
def is_active():
@ -12,7 +13,7 @@ def get_name():
def can_build():
return "EM_CONFIG" in os.environ or os.path.exists(os.path.expanduser("~/.emscripten"))
return WhereIs("emcc") is not None
def get_opts():
@ -100,9 +101,6 @@ def configure(env):
# Closure compiler extern and support for ecmascript specs (const, let, etc).
env["ENV"]["EMCC_CLOSURE_ARGS"] = "--language_in ECMASCRIPT6"
em_config = parse_config()
env.PrependENVPath("PATH", em_config["EMCC_ROOT"])
env["CC"] = "emcc"
env["CXX"] = "em++"
env["LINK"] = "emcc"

View File

@ -1,28 +1,11 @@
import os
def parse_config():
em_config_file = os.getenv("EM_CONFIG") or os.path.expanduser("~/.emscripten")
if not os.path.exists(em_config_file):
raise RuntimeError("Emscripten configuration file '%s' does not exist" % em_config_file)
normalized = {}
em_config = {}
with open(em_config_file) as f:
try:
# Emscripten configuration file is a Python file with simple assignments.
exec(f.read(), em_config)
except StandardError as e:
raise RuntimeError("Emscripten configuration file '%s' is invalid:\n%s" % (em_config_file, e))
normalized["EMCC_ROOT"] = em_config.get("EMSCRIPTEN_ROOT")
normalized["NODE_JS"] = em_config.get("NODE_JS")
normalized["CLOSURE_BIN"] = os.path.join(normalized["EMCC_ROOT"], "node_modules", ".bin", "google-closure-compiler")
return normalized
from SCons.Util import WhereIs
def run_closure_compiler(target, source, env, for_signature):
cfg = parse_config()
cmd = [cfg["NODE_JS"], cfg["CLOSURE_BIN"]]
closure_bin = os.path.join(os.path.dirname(WhereIs("emcc")), "node_modules", ".bin", "google-closure-compiler")
cmd = [WhereIs("node"), closure_bin]
cmd.extend(["--compilation_level", "ADVANCED_OPTIMIZATIONS"])
for f in env["JSEXTERNS"]:
cmd.extend(["--externs", f.get_abspath()])

View File

@ -538,7 +538,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
// Now process our template.
bool found_binary = false;
int total_size = 0;
while (ret == UNZ_OK && err == OK) {
bool is_execute = false;
@ -621,7 +620,6 @@ Error EditorExportPlatformOSX::export_project(const Ref<EditorExportPreset> &p_p
}
print_line("ADDING: " + file + " size: " + itos(data.size()));
total_size += data.size();
// Write it into our application bundle.
file = tmp_app_path_name.plus_file(file);

View File

@ -323,7 +323,7 @@ bool JoypadOSX::configure_joypad(IOHIDDeviceRef p_device_ref, joypad *p_joy) {
if (vendor && product_id) {
char uid[128];
sprintf(uid, "%08x%08x%08x%08x", OSSwapHostToBigInt32(3), OSSwapHostToBigInt32(vendor), OSSwapHostToBigInt32(product_id), OSSwapHostToBigInt32(version));
snprintf(uid, 128, "%08x%08x%08x%08x", OSSwapHostToBigInt32(3), OSSwapHostToBigInt32(vendor), OSSwapHostToBigInt32(product_id), OSSwapHostToBigInt32(version));
input->joy_connection_changed(id, true, name, uid);
} else {
//bluetooth device

View File

@ -149,7 +149,7 @@ def setup_msvc_auto(env):
env["TARGET_ARCH"] = None
if env["bits"] != "default":
env["TARGET_ARCH"] = {"32": "x86", "64": "x86_64"}[env["bits"]]
if env.has_key("msvc_version"):
if "msvc_version" in env:
env["MSVC_VERSION"] = env["msvc_version"]
env.Tool("msvc")
env.Tool("mssdk") # we want the MS SDK

View File

@ -344,7 +344,7 @@ def configure(env):
import re
linker_version_str = subprocess.check_output([env.subst(env["LINK"]), "-Wl,--version"]).decode("utf-8")
gnu_ld_version = re.search("^GNU ld [^$]*(\d+\.\d+)$", linker_version_str, re.MULTILINE)
gnu_ld_version = re.search(r"^GNU ld [^$]*(\d+\.\d+)$", linker_version_str, re.MULTILINE)
if not gnu_ld_version:
print(
"Warning: Creating template binaries enabled for PCK embedding is currently only supported with GNU ld"

View File

@ -850,8 +850,6 @@ void VoxelLightBaker::plot_light_directional(const Vector3 &p_direction, const C
float distance_adv = _get_normal_advance(light_axis);
int success_count = 0;
Vector3 light_energy = Vector3(p_color.r, p_color.g, p_color.b) * p_energy * p_indirect_energy;
int idx = first_leaf;
@ -915,7 +913,6 @@ void VoxelLightBaker::plot_light_directional(const Vector3 &p_direction, const C
light->direct_accum[i][2] += light_energy.z * s;
}
}
success_count++;
}
idx = light_data[idx].next_leaf;

View File

@ -182,7 +182,6 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
}
int wofs = margin;
int spaces_size = 0;
int align_ofs = 0;
if (p_mode != PROCESS_CACHE && align != ALIGN_FILL)
@ -240,7 +239,6 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
line_ascent = 0; \
line_descent = 0; \
spaces = 0; \
spaces_size = 0; \
wofs = begin; \
align_ofs = 0; \
if (p_mode != PROCESS_CACHE) { \
@ -423,9 +421,7 @@ int RichTextLabel::_process_line(ItemFrame *p_frame, const Vector2 &p_ofs, int &
fh = line_ascent + line_descent;
if (end && c[end - 1] == ' ') {
if (p_mode == PROCESS_CACHE) {
spaces_size += font->get_char_size(' ').width;
} else if (align == ALIGN_FILL) {
if (align == ALIGN_FILL) {
int ln = MIN(l.offset_caches.size() - 1, line);
if (l.space_caches[ln]) {
align_ofs = spaces * l.offset_caches[ln] / l.space_caches[ln];

View File

@ -144,7 +144,7 @@ Vector<Vector2> PolygonPathFinder::find_path(const Vector2 &p_from, const Vector
if (!_is_point_inside(from)) {
float closest_dist = 1e20;
float closest_dist = 1e20f;
Vector2 closest_point;
for (Set<Edge>::Element *E = edges.front(); E; E = E->next()) {
@ -169,7 +169,7 @@ Vector<Vector2> PolygonPathFinder::find_path(const Vector2 &p_from, const Vector
};
if (!_is_point_inside(to)) {
float closest_dist = 1e20;
float closest_dist = 1e20f;
Vector2 closest_point;
for (Set<Edge>::Element *E = edges.front(); E; E = E->next()) {
@ -516,7 +516,7 @@ bool PolygonPathFinder::is_point_inside(const Vector2 &p_point) const {
Vector2 PolygonPathFinder::get_closest_point(const Vector2 &p_point) const {
float closest_dist = 1e20;
float closest_dist = 1e20f;
Vector2 closest_point;
for (Set<Edge>::Element *E = edges.front(); E; E = E->next()) {
@ -536,7 +536,7 @@ Vector2 PolygonPathFinder::get_closest_point(const Vector2 &p_point) const {
}
}
ERR_FAIL_COND_V(closest_dist == 1e20, Vector2());
ERR_FAIL_COND_V(Math::is_equal_approx(closest_dist, 1e20f), Vector2());
return closest_point;
}

View File

@ -2673,10 +2673,6 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
float distance_adv = _get_normal_advance(light_axis);
int success_count = 0;
// uint64_t us = OS::get_singleton()->get_ticks_usec();
for (int i = 0; i < p_leaf_count; i++) {
uint32_t idx = leaves[i];
@ -2727,19 +2723,11 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
light->energy[0] += int32_t(light_r * att * ((cell->albedo >> 16) & 0xFF) / 255.0);
light->energy[1] += int32_t(light_g * att * ((cell->albedo >> 8) & 0xFF) / 255.0);
light->energy[2] += int32_t(light_b * att * ((cell->albedo) & 0xFF) / 255.0);
success_count++;
}
}
// print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
// print_line("valid cells: " + itos(success_count));
} break;
case VS::LIGHT_OMNI:
case VS::LIGHT_SPOT: {
// uint64_t us = OS::get_singleton()->get_ticks_usec();
Vector3 light_pos = light_cache.transform.origin;
Vector3 spot_axis = -light_cache.transform.basis.get_axis(2).normalized();
@ -2839,7 +2827,6 @@ void VisualServerScene::_bake_gi_probe_light(const GIProbeDataHeader *header, co
light->energy[2] += int32_t(light_b * att * ((cell->albedo) & 0xFF) / 255.0);
}
}
//print_line("BAKE TIME: " + rtos((OS::get_singleton()->get_ticks_usec() - us) / 1000000.0));
} break;
}
}

View File

@ -107,8 +107,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
}
if (!p_viewport->hide_canvas) {
int i = 0;
Map<Viewport::CanvasKey, Viewport::CanvasData *> canvas_map;
Rect2 clip_rect(0, 0, p_viewport->size.x, p_viewport->size.y);
@ -117,8 +115,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
RasterizerCanvas::Light *lights_with_mask = NULL;
Rect2 shadow_rect;
int light_count = 0;
for (Map<RID, Viewport::CanvasData>::Element *E = p_viewport->canvas_map.front(); E; E = E->next()) {
VisualServerCanvas::Canvas *canvas = static_cast<VisualServerCanvas::Canvas *>(E->get().canvas);
@ -164,8 +160,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
cl->mask_next_ptr = lights_with_mask;
lights_with_mask = cl;
}
light_count++;
}
VSG::canvas_render->light_internal_update(cl->light_internal, cl);
@ -239,7 +233,6 @@ void VisualServerViewport::_draw_viewport(Viewport *p_viewport, ARVRInterface::E
}
VSG::canvas->render_canvas(canvas, xform, canvas_lights, lights_with_mask, clip_rect, canvas_layer_id);
i++;
if (scenario_draw_canvas_bg && E->key().get_layer() >= scenario_canvas_max_layer) {
if (!can_draw_3d) {

12
thirdparty/README.md vendored
View File

@ -33,14 +33,14 @@ Files extracted from upstream source:
## certs
- Upstream: Mozilla, via https://apps.fedoraproject.org/packages/ca-certificates
- Version: 2018.2.26 (2018)
- Upstream: Mozilla, via https://github.com/bagder/ca-bundle
- Version: git (4d3fe6683f651d96be1bbef316b201e9b33b274d, 2024),
generated from mozilla-release changeset b8ea2342548b8571e58f9176d9555ccdb5ec199f
- License: MPL 2.0
File extracted from a recent Fedora install:
/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
(It can't be extracted directly from the package,
as it's generated on the user's system.)
Files extracted from upstream source:
- `ca-bundle.crt` renamed to `ca-certificates.crt`
## cvtt

View File

@ -233,8 +233,8 @@ struct btSparseSdf
//int sz = sizeof(Cell);
if (ncells > m_clampCells)
{
static int numResets = 0;
numResets++;
//static int numResets = 0;
//numResets++;
//printf("numResets=%d\n",numResets);
Reset();
}

View File

@ -0,0 +1,17 @@
diff --git a/thirdparty/bullet/BulletSoftBody/btSparseSDF.h b/thirdparty/bullet/BulletSoftBody/btSparseSDF.h
index ae1288d9e6..243b80f8ae 100644
--- a/thirdparty/bullet/BulletSoftBody/btSparseSDF.h
+++ b/thirdparty/bullet/BulletSoftBody/btSparseSDF.h
@@ -233,9 +233,9 @@ struct btSparseSdf
//int sz = sizeof(Cell);
if (ncells > m_clampCells)
{
- static int numResets = 0;
- numResets++;
- // printf("numResets=%d\n",numResets);
+ //static int numResets = 0;
+ //numResets++;
+ //printf("numResets=%d\n",numResets);
Reset();
}

File diff suppressed because it is too large Load Diff

38
thirdparty/vhacd/0006-fix-gcc13.patch vendored Normal file
View File

@ -0,0 +1,38 @@
diff --git a/thirdparty/vhacd/inc/vhacdICHull.h b/thirdparty/vhacd/inc/vhacdICHull.h
index 132bdcfb3e..925584cf52 100644
--- a/thirdparty/vhacd/inc/vhacdICHull.h
+++ b/thirdparty/vhacd/inc/vhacdICHull.h
@@ -18,6 +18,10 @@
#include "vhacdManifoldMesh.h"
#include "vhacdVector.h"
+// -- GODOT start --
+#include <cstdint>
+// -- GODOT end --
+
namespace VHACD {
//! Incremental Convex Hull algorithm (cf. http://cs.smith.edu/~orourke/books/ftp.html ).
enum ICHullError {
diff --git a/thirdparty/vhacd/inc/vhacdManifoldMesh.h b/thirdparty/vhacd/inc/vhacdManifoldMesh.h
index a48f53c5c5..5eed4e13aa 100644
--- a/thirdparty/vhacd/inc/vhacdManifoldMesh.h
+++ b/thirdparty/vhacd/inc/vhacdManifoldMesh.h
@@ -18,6 +18,11 @@ All rights reserved.
#include "vhacdCircularList.h"
#include "vhacdSArray.h"
#include "vhacdVector.h"
+
+// -- GODOT start --
+#include <cstdint>
+// -- GODOT end --
+
namespace VHACD {
class TMMTriangle;
class TMMEdge;
@@ -139,4 +144,4 @@ private:
friend class ICHull;
};
}
-#endif // VHACD_MANIFOLD_MESH_H
\ No newline at end of file
+#endif // VHACD_MANIFOLD_MESH_H

View File

@ -18,6 +18,10 @@
#include "vhacdManifoldMesh.h"
#include "vhacdVector.h"
// -- GODOT start --
#include <cstdint>
// -- GODOT end --
namespace VHACD {
//! Incremental Convex Hull algorithm (cf. http://cs.smith.edu/~orourke/books/ftp.html ).
enum ICHullError {

View File

@ -18,6 +18,11 @@ All rights reserved.
#include "vhacdCircularList.h"
#include "vhacdSArray.h"
#include "vhacdVector.h"
// -- GODOT start --
#include <cstdint>
// -- GODOT end --
namespace VHACD {
class TMMTriangle;
class TMMEdge;