Apply iwyu suggestion in core.

This commit is contained in:
Yufeng Ying 2024-12-18 19:56:23 +08:00
parent 6395450b10
commit be86ce3103
68 changed files with 7 additions and 111 deletions

View file

@ -34,7 +34,6 @@
#include "core/os/main_loop.h"
#include "core/string/ustring.h"
#include "core/templates/list.h"
#include "core/templates/vector.h"
template <typename T>
class TypedArray;

View file

@ -39,7 +39,6 @@
#include "core/io/marshalls.h"
#include "core/io/resource_uid.h"
#include "core/object/script_language.h"
#include "core/os/keyboard.h"
#include "core/templates/rb_set.h"
#include "core/variant/typed_array.h"
#include "core/variant/variant_parser.h"

View file

@ -35,8 +35,6 @@
#include "core/crypto/crypto_core.h"
#include "core/debugger/engine_debugger.h"
#include "core/debugger/script_debugger.h"
#include "core/io/file_access_compressed.h"
#include "core/io/file_access_encrypted.h"
#include "core/io/marshalls.h"
#include "core/math/geometry_2d.h"
#include "core/math/geometry_3d.h"

View file

@ -34,8 +34,6 @@
#include "core/debugger/engine_profiler.h"
#include "core/io/resource_loader.h"
#include "core/io/resource_saver.h"
#include "core/object/script_language.h"
#include "core/os/os.h"
#include "core/os/semaphore.h"
#include "core/os/thread.h"
#include "core/templates/safe_refcount.h"

View file

@ -33,7 +33,6 @@
#include "core/input/input_event.h"
#include "core/object/class_db.h"
#include "core/os/keyboard.h"
#include "core/templates/hash_set.h"
#include "core/variant/variant.h"
struct _CoreConstant {

View file

@ -32,7 +32,7 @@
#define CORE_CONSTANTS_H
#include "core/string/string_name.h"
#include "core/templates/hash_set.h"
#include "core/templates/hash_map.h"
class CoreConstants {
public:

View file

@ -30,10 +30,6 @@
#include "crypto.h"
#include "core/config/engine.h"
#include "core/io/certs_compressed.gen.h"
#include "core/io/compression.h"
/// Resources
CryptoKey *(*CryptoKey::_create)(bool p_notify_postinitialize) = nullptr;

View file

@ -36,7 +36,6 @@
#include "core/templates/hash_map.h"
#include "core/templates/vector.h"
#include "core/variant/array.h"
#include "core/variant/variant.h"
class RemoteDebuggerPeer;
class ScriptDebugger;

View file

@ -34,7 +34,6 @@
#include "core/object/script_language.h"
#include "core/string/string_name.h"
#include "core/templates/hash_set.h"
#include "core/templates/rb_map.h"
#include "core/templates/vector.h"
class ScriptDebugger {

View file

@ -29,7 +29,6 @@
/**************************************************************************/
#include "shortcut.h"
#include "core/os/keyboard.h"
void Shortcut::set_events(const Array &p_events) {
for (int i = 0; i < p_events.size(); i++) {

View file

@ -31,7 +31,6 @@
#include "config_file.h"
#include "core/io/file_access_encrypted.h"
#include "core/os/keyboard.h"
#include "core/string/string_builder.h"
#include "core/variant/variant_parser.h"

View file

@ -30,9 +30,6 @@
#include "dtls_server.h"
#include "core/config/project_settings.h"
#include "core/io/file_access.h"
DTLSServer *(*DTLSServer::_create)(bool p_notify_postinitialize) = nullptr;
bool DTLSServer::available = false;

View file

@ -30,8 +30,6 @@
#include "file_access_compressed.h"
#include "core/string/print_string.h"
void FileAccessCompressed::configure(const String &p_magic, Compression::Mode p_mode, uint32_t p_block_size) {
magic = p_magic.ascii().get_data();
magic = (magic + " ").substr(0, 4);

View file

@ -31,11 +31,8 @@
#include "file_access_encrypted.h"
#include "core/crypto/crypto_core.h"
#include "core/string/print_string.h"
#include "core/variant/variant.h"
#include <stdio.h>
Error FileAccessEncrypted::open_and_parse(Ref<FileAccess> p_base, const Vector<uint8_t> &p_key, Mode p_mode, bool p_with_magic, const Vector<uint8_t> &p_iv) {
ERR_FAIL_COND_V_MSG(file.is_valid(), ERR_ALREADY_IN_USE, vformat("Can't open file while another file from path '%s' is open.", file->get_path_absolute()));
ERR_FAIL_COND_V(p_key.size() != 32, ERR_INVALID_PARAMETER);

View file

@ -31,8 +31,6 @@
#include "file_access_memory.h"
#include "core/config/project_settings.h"
#include "core/io/dir_access.h"
#include "core/templates/rb_map.h"
static HashMap<String, Vector<uint8_t>> *files = nullptr;

View file

@ -35,8 +35,6 @@
#include "core/os/os.h"
#include "core/version.h"
#include <stdio.h>
Error PackedData::add_pack(const String &p_path, bool p_replace_files, uint64_t p_offset) {
for (int i = 0; i < sources.size(); i++) {
if (sources[i]->try_open_pack(p_path, p_replace_files, p_offset)) {

View file

@ -36,7 +36,6 @@
#include "core/string/print_string.h"
#include "core/templates/hash_set.h"
#include "core/templates/list.h"
#include "core/templates/rb_map.h"
// Godot's packed file magic header ("GDPC" in ASCII).
#define PACK_HEADER_MAGIC 0x43504447

View file

@ -34,12 +34,9 @@
#ifdef MINIZIP_ENABLED
#include "core/io/file_access_pack.h"
#include "core/templates/rb_map.h"
#include "thirdparty/minizip/unzip.h"
#include <stdlib.h>
class ZipArchive : public PackSource {
public:
struct File {

View file

@ -36,11 +36,9 @@
#include "core/io/image_loader.h"
#include "core/io/resource_loader.h"
#include "core/math/math_funcs.h"
#include "core/string/print_string.h"
#include "core/templates/hash_map.h"
#include "core/variant/dictionary.h"
#include <stdio.h>
#include <cmath>
const char *Image::format_names[Image::FORMAT_MAX] = {

View file

@ -33,7 +33,6 @@
#include "core/io/resource.h"
#include "core/math/color.h"
#include "core/math/rect2.h"
/**
* Image storage class. This is used to store an image in user memory, as well as

View file

@ -30,8 +30,6 @@
#include "image_loader.h"
#include "core/string/print_string.h"
void ImageFormatLoader::_bind_methods() {
BIND_BITFIELD_FLAG(FLAG_NONE);
BIND_BITFIELD_FLAG(FLAG_FORCE_LINEAR);

View file

@ -34,7 +34,6 @@ IPAddress::operator Variant() const {
return operator String();
}*/
#include <stdio.h>
#include <string.h>
IPAddress::operator String() const {

View file

@ -30,12 +30,9 @@
#include "logger.h"
#include "core/config/project_settings.h"
#include "core/core_globals.h"
#include "core/io/dir_access.h"
#include "core/os/os.h"
#include "core/os/time.h"
#include "core/string/print_string.h"
#include "modules/modules_enabled.gen.h" // For regex.

View file

@ -29,8 +29,6 @@
/**************************************************************************/
#include "packet_peer_dtls.h"
#include "core/config/project_settings.h"
#include "core/io/file_access.h"
PacketPeerDTLS *(*PacketPeerDTLS::_create)(bool p_notify_postinitialize) = nullptr;
bool PacketPeerDTLS::available = false;

View file

@ -30,6 +30,9 @@
#include "plist.h"
#include "core/crypto/crypto_core.h"
#include "core/os/time.h"
PList::PLNodeType PListNode::get_type() const {
return data_type;
}

View file

@ -33,9 +33,7 @@
// Property list file format (application/x-plist) parser, property list ASN-1 serialization.
#include "core/crypto/crypto_core.h"
#include "core/io/file_access.h"
#include "core/os/time.h"
class PListNode;

View file

@ -31,7 +31,6 @@
#ifndef REMOTE_FILESYSTEM_CLIENT_H
#define REMOTE_FILESYSTEM_CLIENT_H
#include "core/io/ip_address.h"
#include "core/string/ustring.h"
#include "core/templates/hash_set.h"
#include "core/templates/local_vector.h"

View file

@ -30,15 +30,11 @@
#include "resource.h"
#include "core/io/file_access.h"
#include "core/io/resource_loader.h"
#include "core/math/math_funcs.h"
#include "core/object/script_language.h"
#include "core/os/os.h"
#include "scene/main/node.h" //only so casting works
#include <stdio.h>
void Resource::emit_changed() {
if (ResourceLoader::is_within_load() && !Thread::is_main_thread()) {
ResourceLoader::resource_changed_emit(this);

View file

@ -33,8 +33,6 @@
#include "core/config/project_settings.h"
#include "core/io/dir_access.h"
#include "core/io/file_access_compressed.h"
#include "core/io/image.h"
#include "core/io/marshalls.h"
#include "core/io/missing_resource.h"
#include "core/object/script_language.h"
#include "core/version.h"

View file

@ -34,7 +34,6 @@
#include "core/io/resource.h"
#include "core/object/gdvirtual.gen.inc"
#include "core/object/worker_thread_pool.h"
#include "core/os/semaphore.h"
#include "core/os/thread.h"
class ConditionVariable;

View file

@ -30,7 +30,7 @@
#include "xml_parser.h"
#include "core/string/print_string.h"
#include "core/io/file_access.h"
//#define DEBUG_XML

View file

@ -31,7 +31,6 @@
#ifndef XML_PARSER_H
#define XML_PARSER_H
#include "core/io/file_access.h"
#include "core/object/ref_counted.h"
#include "core/string/ustring.h"
#include "core/templates/vector.h"

View file

@ -32,7 +32,6 @@
#include "a_star.compat.inc"
#include "core/math/geometry_3d.h"
#include "core/object/script_language.h"
int64_t AStar3D::get_available_point_id() const {
if (points.has(last_free_id)) {

View file

@ -33,7 +33,6 @@
#include "core/object/gdvirtual.gen.inc"
#include "core/object/ref_counted.h"
#include "core/templates/list.h"
#include "core/templates/local_vector.h"
class AStarGrid2D : public RefCounted {

View file

@ -61,12 +61,9 @@ subject to the following restrictions:
#include "core/error/error_macros.h"
#include "core/math/aabb.h"
#include "core/math/math_defs.h"
#include "core/os/memory.h"
#include "core/templates/oa_hash_map.h"
#include "core/templates/paged_allocator.h"
#include <string.h>
//#define DEBUG_CONVEX_HULL
//#define SHOW_ITERATIONS

View file

@ -30,8 +30,6 @@
#include "geometry_3d.h"
#include "thirdparty/misc/polypartition.h"
void Geometry3D::get_closest_points_between_segments(const Vector3 &p_p0, const Vector3 &p_p1, const Vector3 &p_q0, const Vector3 &p_q1, Vector3 &r_ps, Vector3 &r_qt) {
// Based on David Eberly's Computation of Distance Between Line Segments algorithm.

View file

@ -30,8 +30,6 @@
#include "quick_hull.h"
#include "core/templates/rb_map.h"
uint32_t QuickHull::debug_stop_after = 0xFFFFFFFF;
Error QuickHull::build(const Vector<Vector3> &p_points, Geometry3D::MeshData &r_mesh) {

View file

@ -31,9 +31,7 @@
#ifndef QUICK_HULL_H
#define QUICK_HULL_H
#include "core/math/aabb.h"
#include "core/math/geometry_3d.h"
#include "core/templates/hash_set.h"
#include "core/templates/list.h"
class QuickHull {

View file

@ -30,7 +30,6 @@
#include "transform_3d.h"
#include "core/math/math_funcs.h"
#include "core/string/ustring.h"
void Transform3D::affine_invert() {

View file

@ -32,8 +32,6 @@
#define CALLABLE_METHOD_POINTER_H
#include "core/object/object.h"
#include "core/templates/hashfuncs.h"
#include "core/templates/simple_type.h"
#include "core/variant/binder_common.h"
#include "core/variant/callable.h"

View file

@ -33,7 +33,6 @@
#include "core/config/engine.h"
#include "core/io/resource_loader.h"
#include "core/object/script_language.h"
#include "core/os/mutex.h"
#include "core/version.h"
#define OBJTYPE_RLOCK RWLockRead _rw_lockr_(lock);

View file

@ -38,7 +38,6 @@
#include "core/os/os.h"
#include "core/string/print_string.h"
#include "core/string/translation_server.h"
#include "core/templates/local_vector.h"
#include "core/variant/typed_array.h"
#ifdef DEBUG_ENABLED

View file

@ -35,8 +35,6 @@
#include "core/debugger/script_debugger.h"
#include "core/io/resource_loader.h"
#include <stdint.h>
ScriptLanguage *ScriptServer::_languages[MAX_LANGUAGES];
int ScriptServer::_language_count = 0;
bool ScriptServer::languages_ready = false;

View file

@ -35,7 +35,6 @@
#include "core/io/resource.h"
#include "core/object/script_instance.h"
#include "core/templates/pair.h"
#include "core/templates/rb_map.h"
#include "core/templates/safe_refcount.h"
#include "core/variant/typed_array.h"

View file

@ -30,8 +30,6 @@
#include "main_loop.h"
#include "core/object/script_language.h"
void MainLoop::_bind_methods() {
BIND_CONSTANT(NOTIFICATION_OS_MEMORY_WARNING);
BIND_CONSTANT(NOTIFICATION_TRANSLATION_CHANGED);

View file

@ -30,10 +30,8 @@
#include "memory.h"
#include "core/error/error_macros.h"
#include "core/templates/safe_refcount.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

View file

@ -31,7 +31,6 @@
#ifndef MUTEX_H
#define MUTEX_H
#include "core/error/error_macros.h"
#include "core/typedefs.h"
#ifdef MINGW_ENABLED

View file

@ -31,7 +31,6 @@
#include "os.h"
#include "core/config/project_settings.h"
#include "core/input/input.h"
#include "core/io/dir_access.h"
#include "core/io/file_access.h"
#include "core/io/json.h"

View file

@ -39,7 +39,6 @@
#include "core/templates/list.h"
#include "core/templates/vector.h"
#include <stdarg.h>
#include <stdlib.h>
class OS {

View file

@ -42,8 +42,6 @@
#include "core/templates/safe_refcount.h"
#include "core/typedefs.h"
#include <new>
#ifdef MINGW_ENABLED
#define MINGW_STDTHREAD_REDUNDANCY_WARNING
#include "thirdparty/mingw-std-threads/mingw.thread.h"

View file

@ -31,8 +31,6 @@
#ifndef THREAD_SAFE_H
#define THREAD_SAFE_H
#include "core/os/mutex.h"
#define _THREAD_SAFE_CLASS_ mutable Mutex _thread_safe_;
#define _THREAD_SAFE_METHOD_ MutexLock _thread_safe_method_(_thread_safe_);
#define _THREAD_SAFE_LOCK_ _thread_safe_.lock();

View file

@ -67,8 +67,6 @@
#include "core/math/a_star.h"
#include "core/math/a_star_grid_2d.h"
#include "core/math/expression.h"
#include "core/math/geometry_2d.h"
#include "core/math/geometry_3d.h"
#include "core/math/random_number_generator.h"
#include "core/math/triangle_mesh.h"
#include "core/object/class_db.h"

View file

@ -30,7 +30,7 @@
#include "node_path.h"
#include "core/string/print_string.h"
#include "core/variant/variant.h"
void NodePath::_update_hash_cache() const {
uint32_t h = data->absolute ? 1 : 0;

View file

@ -33,8 +33,6 @@
#include "core/core_globals.h"
#include "core/os/os.h"
#include <stdio.h>
static PrintHandlerList *print_handler_list = nullptr;
void add_print_handler(PrintHandlerList *p_handler) {

View file

@ -34,7 +34,6 @@
#include "core/math/color.h"
#include "core/math/math_funcs.h"
#include "core/object/object.h"
#include "core/os/memory.h"
#include "core/string/print_string.h"
#include "core/string/string_name.h"
#include "core/string/translation_server.h"

View file

@ -39,8 +39,6 @@
#include "core/typedefs.h"
#include "core/variant/array.h"
#include <utility>
/*************************************************************************/
/* Utility Functions */
/*************************************************************************/

View file

@ -30,9 +30,6 @@
#include "command_queue_mt.h"
#include "core/config/project_settings.h"
#include "core/os/os.h"
CommandQueueMT::CommandQueueMT() {
command_mem.reserve(DEFAULT_COMMAND_MEM_SIZE_KB * 1024);
}

View file

@ -35,7 +35,6 @@
#include "core/os/condition_variable.h"
#include "core/os/memory.h"
#include "core/os/mutex.h"
#include "core/string/print_string.h"
#include "core/templates/local_vector.h"
#include "core/templates/simple_type.h"
#include "core/typedefs.h"

View file

@ -31,10 +31,8 @@
#ifndef HASH_MAP_H
#define HASH_MAP_H
#include "core/math/math_funcs.h"
#include "core/os/memory.h"
#include "core/templates/hashfuncs.h"
#include "core/templates/paged_allocator.h"
#include "core/templates/pair.h"
/**

View file

@ -34,9 +34,7 @@
#include "core/os/memory.h"
#include "core/os/mutex.h"
#include "core/string/print_string.h"
#include "core/templates/hash_set.h"
#include "core/templates/list.h"
#include "core/templates/oa_hash_map.h"
#include "core/templates/rid.h"
#include "core/templates/safe_refcount.h"

View file

@ -32,7 +32,6 @@
#include "container_type_validate.h"
#include "core/math/math_funcs.h"
#include "core/object/class_db.h"
#include "core/object/script_language.h"
#include "core/templates/hashfuncs.h"
#include "core/templates/search_array.h"

View file

@ -36,7 +36,6 @@
#include <climits>
class Callable;
class Object;
class StringName;
class Variant;

View file

@ -33,7 +33,6 @@
#include "core/object/object_id.h"
#include "core/string/string_name.h"
#include "core/templates/list.h"
class Object;
class Variant;

View file

@ -32,10 +32,8 @@
#include "core/debugger/engine_debugger.h"
#include "core/io/json.h"
#include "core/io/marshalls.h"
#include "core/io/resource.h"
#include "core/math/math_funcs.h"
#include "core/string/print_string.h"
#include "core/variant/variant_parser.h"
PagedAllocator<Variant::Pools::BucketSmall, true> Variant::Pools::_bucket_small;

View file

@ -30,8 +30,6 @@
#include "variant_destruct.h"
#include "core/templates/local_vector.h"
static Variant::PTRDestructor destruct_pointers[Variant::VARIANT_MAX] = { nullptr };
template <typename T>

View file

@ -31,10 +31,8 @@
#include "variant_parser.h"
#include "core/crypto/crypto_core.h"
#include "core/input/input_event.h"
#include "core/io/resource_loader.h"
#include "core/object/script_language.h"
#include "core/os/keyboard.h"
#include "core/string/string_buffer.h"
char32_t VariantParser::Stream::get_char() {

View file

@ -35,7 +35,6 @@
#include "core/debugger/engine_debugger.h"
#include "core/object/class_db.h"
#include "core/templates/local_vector.h"
#include "core/variant/variant_internal.h"
/**** NAMED SETTERS AND GETTERS ****/

View file

@ -47,6 +47,7 @@
#include "core/io/ip.h"
#include "core/io/resource_loader.h"
#include "core/object/message_queue.h"
#include "core/object/script_language.h"
#include "core/os/os.h"
#include "core/os/time.h"
#include "core/register_core_types.h"