diff --git a/source/lib/adts/cache_adt.h b/source/lib/adts/cache_adt.h index c28090487a..6fbbedb219 100644 --- a/source/lib/adts/cache_adt.h +++ b/source/lib/adts/cache_adt.h @@ -27,6 +27,9 @@ #ifndef INCLUDED_CACHE_ADT #define INCLUDED_CACHE_ADT +#include "lib/debug.h" + +#include #include #include #include // std::priority_queue diff --git a/source/lib/adts/ring_buf.h b/source/lib/adts/ring_buf.h index 56b3708b95..52b603d792 100644 --- a/source/lib/adts/ring_buf.h +++ b/source/lib/adts/ring_buf.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,12 @@ #ifndef INCLUDED_ADTS_RING_BUF #define INCLUDED_ADTS_RING_BUF +#include "lib/debug.h" +#include "lib/status.h" + +#include +#include + template class RingBuf { size_t size_; // # of entries in buffer diff --git a/source/lib/allocators/allocator_checker.h b/source/lib/allocators/allocator_checker.h index e50870d090..9ea147d89f 100644 --- a/source/lib/allocators/allocator_checker.h +++ b/source/lib/allocators/allocator_checker.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,6 +23,8 @@ #ifndef INCLUDED_ALLOCATORS_ALLOCATOR_CHECKER #define INCLUDED_ALLOCATORS_ALLOCATOR_CHECKER +#include "lib/debug.h" + #include /** diff --git a/source/lib/allocators/dynarray.cpp b/source/lib/allocators/dynarray.cpp index aeca59dd7b..72806972aa 100644 --- a/source/lib/allocators/dynarray.cpp +++ b/source/lib/allocators/dynarray.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,13 +25,17 @@ */ #include "precompiled.h" -#include "lib/allocators/dynarray.h" + +#include "dynarray.h" #include "lib/alignment.h" +#include "lib/debug.h" +#include "lib/posix/posix_types.h" #include "lib/sysdep/vm.h" +#include +#include #include -#include static Status validate_da(DynArray* da) { diff --git a/source/lib/allocators/pool.cpp b/source/lib/allocators/pool.cpp index cef438f979..b8b373e8c4 100644 --- a/source/lib/allocators/pool.cpp +++ b/source/lib/allocators/pool.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,12 +25,15 @@ */ #include "precompiled.h" -#include "lib/allocators/pool.h" + +#include "pool.h" #include "lib/alignment.h" #include "lib/allocators/freelist.h" - #include "lib/timer.h" +#include "lib/types.h" + +#include namespace Allocators { diff --git a/source/lib/allocators/shared_ptr.cpp b/source/lib/allocators/shared_ptr.cpp index 6f20d2a975..4c9a5da070 100644 --- a/source/lib/allocators/shared_ptr.cpp +++ b/source/lib/allocators/shared_ptr.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -21,10 +21,11 @@ */ #include "precompiled.h" -#include "lib/allocators/shared_ptr.h" + +#include "shared_ptr.h" #include "lib/allocators/allocator_checker.h" - +#include "lib/debug.h" #ifndef NDEBUG static AllocatorChecker s_allocatorChecker; diff --git a/source/lib/allocators/shared_ptr.h b/source/lib/allocators/shared_ptr.h index be6dcc7025..5afbdbc53d 100644 --- a/source/lib/allocators/shared_ptr.h +++ b/source/lib/allocators/shared_ptr.h @@ -24,7 +24,7 @@ #define INCLUDED_ALLOCATORS_SHARED_PTR #include "lib/alignment.h" -#include "lib/debug.h" +#include "lib/status.h" #include "lib/sysdep/rtl.h" // rtl_AllocateAligned #include "lib/types.h" diff --git a/source/lib/allocators/stateless_allocators.h b/source/lib/allocators/stateless_allocators.h index ea500c021e..daae82f7bd 100644 --- a/source/lib/allocators/stateless_allocators.h +++ b/source/lib/allocators/stateless_allocators.h @@ -26,6 +26,7 @@ #include "lib/sysdep/rtl.h" #include "lib/sysdep/vm.h" +#include #include // NB: STL allocators are parameterized on the object type and indicate diff --git a/source/lib/app_hooks.cpp b/source/lib/app_hooks.cpp index dfbc94b7db..9ef4e870b5 100644 --- a/source/lib/app_hooks.cpp +++ b/source/lib/app_hooks.cpp @@ -22,9 +22,10 @@ #include "precompiled.h" -#include "lib/app_hooks.h" +#include "app_hooks.h" #include "lib/sysdep/sysdep.h" +#include "lib/types.h" #include diff --git a/source/lib/bits.cpp b/source/lib/bits.cpp index 2fa39998ec..a4b7659e33 100644 --- a/source/lib/bits.cpp +++ b/source/lib/bits.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,7 +25,10 @@ */ #include "precompiled.h" -#include "lib/bits.h" + +#include "bits.h" + +#include "lib/types.h" #include diff --git a/source/lib/byte_order.cpp b/source/lib/byte_order.cpp index 2d44257a94..6bb4428665 100644 --- a/source/lib/byte_order.cpp +++ b/source/lib/byte_order.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,10 +25,12 @@ */ #include "precompiled.h" -#include "lib/byte_order.h" + +#include "byte_order.h" #include "lib/bits.h" +#include #include #ifndef swap16 diff --git a/source/lib/debug.cpp b/source/lib/debug.cpp index 15c0b8bf0b..71e5572be7 100644 --- a/source/lib/debug.cpp +++ b/source/lib/debug.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -21,17 +21,27 @@ */ #include "precompiled.h" -#include "lib/debug.h" + +#include "debug.h" #include "lib/alignment.h" #include "lib/app_hooks.h" #include "lib/fnv_hash.h" +#include "lib/os_path.h" +#include "lib/path.h" +#include "lib/secure_crt.h" #include "lib/sysdep/sysdep.h" -#include "lib/sysdep/vm.h" +#include "lib/utf8.h" +#include +#include #include -#include #include +#include +#include +#include +#include +#include namespace { diff --git a/source/lib/debug_stl.cpp b/source/lib/debug_stl.cpp index 7c40c3e17d..355dc9ea5d 100644 --- a/source/lib/debug_stl.cpp +++ b/source/lib/debug_stl.cpp @@ -25,15 +25,20 @@ */ #include "precompiled.h" -#include "lib/debug_stl.h" +#include "debug_stl.h" + +#include "lib/code_annotation.h" +#include "lib/debug.h" #include "lib/regex.h" +#include "lib/secure_crt.h" +#include "lib/sysdep/compiler.h" +#include "lib/sysdep/stl.h" -#include +#include #include #include -#include -#include +#include #include static const StatusDefinition debugStlStatusDefinitions[] = { diff --git a/source/lib/external_libraries/dbghelp.cpp b/source/lib/external_libraries/dbghelp.cpp index 509af4a1df..73317786ce 100644 --- a/source/lib/external_libraries/dbghelp.cpp +++ b/source/lib/external_libraries/dbghelp.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -22,6 +22,7 @@ #include "precompiled.h" +#include "lib/sysdep/os.h" #if OS_WIN #include "lib/sysdep/sysdep.h" diff --git a/source/lib/external_libraries/libsdl.cpp b/source/lib/external_libraries/libsdl.cpp index 78befb8ef7..f74917af22 100644 --- a/source/lib/external_libraries/libsdl.cpp +++ b/source/lib/external_libraries/libsdl.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -26,9 +26,9 @@ #include "lib/debug.h" +#include #include - #if defined(SDL_VIDEO_DRIVER_X11) && !CONFIG2_GLES void* GetX11Display(SDL_Window* window) { diff --git a/source/lib/file/archive/archive.cpp b/source/lib/file/archive/archive.cpp index 2312dadd65..06c70755c9 100644 --- a/source/lib/file/archive/archive.cpp +++ b/source/lib/file/archive/archive.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,7 +25,10 @@ */ #include "precompiled.h" -#include "lib/file/archive/archive.h" + +#include "archive.h" + +#include "lib/code_annotation.h" static const StatusDefinition archiveStatusDefinitions[] = { { ERR::ARCHIVE_UNKNOWN_FORMAT, L"Unknown archive format" }, diff --git a/source/lib/file/archive/archive.h b/source/lib/file/archive/archive.h index 85d5e51d07..c1915fee8a 100644 --- a/source/lib/file/archive/archive.h +++ b/source/lib/file/archive/archive.h @@ -36,8 +36,8 @@ #include "lib/types.h" #include +#include #include -#include // rationale: this module doesn't build a directory tree of the entries // within an archive. that task is left to the VFS; here, we are only diff --git a/source/lib/file/archive/archive_zip.cpp b/source/lib/file/archive/archive_zip.cpp index e84742cffa..29c3e02d75 100644 --- a/source/lib/file/archive/archive_zip.cpp +++ b/source/lib/file/archive/archive_zip.cpp @@ -25,21 +25,37 @@ */ #include "precompiled.h" -#include "lib/file/archive/archive_zip.h" -#include -#include +#include "archive_zip.h" -#include "lib/utf8.h" +#include "lib/alignment.h" +#include "lib/allocators/dynarray.h" +#include "lib/allocators/pool.h" #include "lib/bits.h" #include "lib/byte_order.h" -#include "lib/allocators/pool.h" -#include "lib/sysdep/filesystem.h" +#include "lib/code_annotation.h" +#include "lib/debug.h" #include "lib/file/archive/archive.h" +#include "lib/file/archive/codec.h" #include "lib/file/archive/codec_zlib.h" #include "lib/file/archive/stream.h" #include "lib/file/file.h" +#include "lib/file/file_system.h" #include "lib/file/io/io.h" +#include "lib/lib.h" +#include "lib/path.h" +#include "lib/posix/posix_types.h" +#include "lib/status.h" +#include "lib/types.h" +#include "lib/utf8.h" + +#include +#include +#include +#include +#include +#include +#include //----------------------------------------------------------------------------- // timestamp conversion: DOS FAT <-> Unix time_t diff --git a/source/lib/file/archive/codec_zlib.cpp b/source/lib/file/archive/codec_zlib.cpp index 730a86a924..a489d17c49 100644 --- a/source/lib/file/archive/codec_zlib.cpp +++ b/source/lib/file/archive/codec_zlib.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -21,14 +21,17 @@ */ #include "precompiled.h" -#include "lib/file/archive/codec_zlib.h" + +#include "codec_zlib.h" #include "lib/alignment.h" -#include "lib/file/archive/codec.h" +#include "lib/debug.h" #include "lib/external_libraries/zlib.h" +#include "lib/file/archive/codec.h" +#include "lib/status.h" +#include "lib/types.h" -#include "lib/sysdep/cpu.h" - +#include #include class Codec_ZLib : public ICodec diff --git a/source/lib/file/archive/stream.cpp b/source/lib/file/archive/stream.cpp index 3f732c0fa9..d69157dce1 100644 --- a/source/lib/file/archive/stream.cpp +++ b/source/lib/file/archive/stream.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -21,10 +21,11 @@ */ #include "precompiled.h" -#include "lib/file/archive/stream.h" -#include "lib/allocators/page_aligned.h" +#include "stream.h" + #include "lib/allocators/shared_ptr.h" +#include "lib/debug.h" #include "lib/file/archive/codec.h" //#include "lib/timer.h" diff --git a/source/lib/file/common/file_stats.cpp b/source/lib/file/common/file_stats.cpp index cd5751d622..9294849d83 100644 --- a/source/lib/file/common/file_stats.cpp +++ b/source/lib/file/common/file_stats.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,13 +25,14 @@ */ #include "precompiled.h" -#include "lib/file/common/file_stats.h" -#include +#include "file_stats.h" + +#if FILE_STATS_ENABLED #include "lib/timer.h" -#if FILE_STATS_ENABLED +#include // vfs static size_t vfs_files; diff --git a/source/lib/file/common/real_directory.cpp b/source/lib/file/common/real_directory.cpp index 88a9075471..eb3a8c2c21 100644 --- a/source/lib/file/common/real_directory.cpp +++ b/source/lib/file/common/real_directory.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -21,11 +21,12 @@ */ #include "precompiled.h" -#include "lib/file/common/real_directory.h" -#include "lib/sysdep/filesystem.h" -#include "lib/file/file.h" +#include "real_directory.h" + +#include "lib/debug.h" #include "lib/file/io/io.h" +#include "lib/path.h" RealDirectory::RealDirectory(const OsPath& path, size_t priority, size_t flags) diff --git a/source/lib/file/common/trace.cpp b/source/lib/file/common/trace.cpp index a600844861..8aa451ce8c 100644 --- a/source/lib/file/common/trace.cpp +++ b/source/lib/file/common/trace.cpp @@ -25,14 +25,24 @@ */ #include "precompiled.h" -#include "lib/file/common/trace.h" -#include -#include +#include "trace.h" +#include "lib/allocators/dynarray.h" #include "lib/allocators/pool.h" -#include "lib/timer.h" // timer_Time +#include "lib/code_annotation.h" +#include "lib/debug.h" +#include "lib/secure_crt.h" #include "lib/sysdep/sysdep.h" // sys_OpenFile +#include "lib/timer.h" // timer_Time + +#include +#include +#include +#include +#include +#include +#include /*virtual*/ ITrace::~ITrace() diff --git a/source/lib/file/common/trace.h b/source/lib/file/common/trace.h index aae5412950..2a51ec1b25 100644 --- a/source/lib/file/common/trace.h +++ b/source/lib/file/common/trace.h @@ -35,9 +35,9 @@ #ifndef INCLUDED_TRACE #define INCLUDED_TRACE -#include "lib/debug.h" #include "lib/os_path.h" #include "lib/path.h" +#include "lib/status.h" #include #include diff --git a/source/lib/file/file.cpp b/source/lib/file/file.cpp index b33fb1546b..25845ad58a 100644 --- a/source/lib/file/file.cpp +++ b/source/lib/file/file.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,9 +25,16 @@ */ #include "precompiled.h" -#include "lib/file/file.h" +#include "file.h" + +#include "lib/code_annotation.h" +#include "lib/debug.h" #include "lib/file/common/file_stats.h" +#include "lib/posix/posix_types.h" +#include "lib/sysdep/filesystem.h" + +#include static const StatusDefinition fileStatusDefinitions[] = { { ERR::FILE_ACCESS, L"Insufficient access rights to open file", EACCES }, diff --git a/source/lib/file/io/io.cpp b/source/lib/file/io/io.cpp index 2d981e1ce6..886321a61e 100644 --- a/source/lib/file/io/io.cpp +++ b/source/lib/file/io/io.cpp @@ -21,10 +21,12 @@ */ #include "precompiled.h" -#include "lib/file/io/io.h" + +#include "io.h" #include "lib/config2.h" -#include "lib/sysdep/rtl.h" + +#include static const StatusDefinition ioStatusDefinitions[] = { { ERR::IO, L"Error during IO", EIO } diff --git a/source/lib/file/io/write_buffer.cpp b/source/lib/file/io/write_buffer.cpp index 58f47affdd..7c4de6e927 100644 --- a/source/lib/file/io/write_buffer.cpp +++ b/source/lib/file/io/write_buffer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -21,13 +21,18 @@ */ #include "precompiled.h" -#include "lib/file/io/write_buffer.h" -#include "lib/bits.h" // IsAligned -#include "lib/sysdep/cpu.h" +#include "write_buffer.h" + +#include "lib/alignment.h" #include "lib/allocators/shared_ptr.h" +#include "lib/bits.h" // IsAligned +#include "lib/debug.h" #include "lib/file/io/io.h" +#include "lib/sysdep/rtl.h" +#include +#include static const size_t BLOCK_SIZE = 512*KiB; diff --git a/source/lib/file/vfs/vfs.cpp b/source/lib/file/vfs/vfs.cpp index 64fab980bd..2c2a0b6db9 100644 --- a/source/lib/file/vfs/vfs.cpp +++ b/source/lib/file/vfs/vfs.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -21,20 +21,28 @@ */ #include "precompiled.h" -#include "lib/file/vfs/vfs.h" +#include "vfs.h" + +#include "lib/alignment.h" #include "lib/allocators/shared_ptr.h" -#include "lib/file/file_system.h" +#include "lib/code_annotation.h" +#include "lib/debug.h" +#include "lib/file/common/file_loader.h" #include "lib/file/common/file_stats.h" +#include "lib/file/common/real_directory.h" #include "lib/file/common/trace.h" -#include "lib/file/archive/archive.h" -#include "lib/file/io/io.h" -#include "lib/file/vfs/vfs_tree.h" +#include "lib/file/file.h" +#include "lib/file/file_system.h" #include "lib/file/vfs/vfs_lookup.h" #include "lib/file/vfs/vfs_populate.h" +#include "lib/file/vfs/vfs_tree.h" +#include "lib/path.h" +#include +#include #include -#include +#include static const StatusDefinition vfsStatusDefinitions[] = { { ERR::VFS_DIR_NOT_FOUND, L"VFS directory not found" }, diff --git a/source/lib/file/vfs/vfs.h b/source/lib/file/vfs/vfs.h index 01e426e6fe..d9923a5556 100644 --- a/source/lib/file/vfs/vfs.h +++ b/source/lib/file/vfs/vfs.h @@ -28,10 +28,10 @@ #ifndef INCLUDED_VFS #define INCLUDED_VFS -#include "lib/debug.h" #include "lib/file/file_system.h" // CFileInfo #include "lib/file/vfs/vfs_path.h" #include "lib/os_path.h" +#include "lib/status.h" #include "lib/types.h" #include diff --git a/source/lib/file/vfs/vfs_lookup.cpp b/source/lib/file/vfs/vfs_lookup.cpp index fb7668a54d..56a2e3a7e4 100644 --- a/source/lib/file/vfs/vfs_lookup.cpp +++ b/source/lib/file/vfs/vfs_lookup.cpp @@ -26,15 +26,22 @@ #include "precompiled.h" -#include "lib/file/vfs/vfs_lookup.h" -#include "lib/sysdep/filesystem.h" +#include "vfs_lookup.h" + +#include "lib/debug.h" +#include "lib/file/common/real_directory.h" #include "lib/file/file.h" +#include "lib/file/file_system.h" #include "lib/file/vfs/vfs.h" // error codes -#include "lib/file/vfs/vfs_tree.h" #include "lib/file/vfs/vfs_populate.h" +#include "lib/file/vfs/vfs_tree.h" +#include "lib/os_path.h" +#include "lib/path.h" +#include "lib/posix/posix_types.h" +#include "lib/sysdep/filesystem.h" -#include "lib/timer.h" - +#include +#include static Status CreateDirectory(const OsPath& path) { diff --git a/source/lib/file/vfs/vfs_populate.cpp b/source/lib/file/vfs/vfs_populate.cpp index d9b42c0470..fddb943e6a 100644 --- a/source/lib/file/vfs/vfs_populate.cpp +++ b/source/lib/file/vfs/vfs_populate.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,12 +25,22 @@ */ #include "precompiled.h" -#include "lib/file/vfs/vfs_populate.h" +#include "vfs_populate.h" + +#include "lib/code_annotation.h" +#include "lib/file/archive/archive.h" #include "lib/file/archive/archive_zip.h" -#include "lib/file/vfs/vfs_tree.h" -#include "lib/file/vfs/vfs_lookup.h" +#include "lib/file/file_system.h" #include "lib/file/vfs/vfs.h" // error codes +#include "lib/file/vfs/vfs_lookup.h" +#include "lib/file/vfs/vfs_path.h" +#include "lib/file/vfs/vfs_tree.h" +#include "lib/os_path.h" +#include "lib/path.h" + +#include +#include struct CompareFileInfoByName { diff --git a/source/lib/file/vfs/vfs_tree.cpp b/source/lib/file/vfs/vfs_tree.cpp index 4d66856845..f39ff83963 100644 --- a/source/lib/file/vfs/vfs_tree.cpp +++ b/source/lib/file/vfs/vfs_tree.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,12 +25,18 @@ */ #include "precompiled.h" -#include "lib/file/vfs/vfs_tree.h" -#include -#include +#include "vfs_tree.h" +#include "lib/code_annotation.h" +#include "lib/debug.h" #include "lib/file/common/file_stats.h" +#include "lib/secure_crt.h" +#include "lib/status.h" + +#include +#include +#include //----------------------------------------------------------------------------- diff --git a/source/lib/file/vfs/vfs_util.cpp b/source/lib/file/vfs/vfs_util.cpp index 8b068180fd..88ca3137ae 100644 --- a/source/lib/file/vfs/vfs_util.cpp +++ b/source/lib/file/vfs/vfs_util.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -26,15 +26,19 @@ #include "precompiled.h" -#include "lib/file/vfs/vfs_util.h" - -#include -#include -#include +#include "vfs_util.h" +#include "lib/code_annotation.h" +#include "lib/path.h" #include "lib/regex.h" +#include "lib/secure_crt.h" #include "lib/sysdep/filesystem.h" +#include +#include +#include +#include +#include namespace vfs { diff --git a/source/lib/fnv_hash.h b/source/lib/fnv_hash.h index bda93004ec..fe0f921ce2 100644 --- a/source/lib/fnv_hash.h +++ b/source/lib/fnv_hash.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,10 @@ #ifndef INCLUDED_FNV_HASH #define INCLUDED_FNV_HASH +#include "lib/types.h" + +#include + /** * rationale: this algorithm was chosen because it delivers 'good' results * for string data and is relatively simple. other good alternatives exist; diff --git a/source/lib/frequency_filter.cpp b/source/lib/frequency_filter.cpp index 7627b2c0d5..15ab6262ae 100644 --- a/source/lib/frequency_filter.cpp +++ b/source/lib/frequency_filter.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2018 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -21,7 +21,15 @@ */ #include "precompiled.h" -#include "lib/frequency_filter.h" + +#include "frequency_filter.h" + +#include "lib/code_annotation.h" +#include "lib/debug.h" + +#include +#include +#include static const double errorTolerance = 0.25; static const double g_Sensitivity = 0.10; diff --git a/source/lib/frequency_filter.h b/source/lib/frequency_filter.h index ed67e9eeff..aacd1e4e5b 100644 --- a/source/lib/frequency_filter.h +++ b/source/lib/frequency_filter.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,6 +23,8 @@ #ifndef INCLUDED_FREQUENCY_FILTER #define INCLUDED_FREQUENCY_FILTER +#include + // calculate frequency of events (tuned for 100 Hz) struct IFrequencyFilter { diff --git a/source/lib/hash.h b/source/lib/hash.h index 1dce2c4056..7af5d3f662 100644 --- a/source/lib/hash.h +++ b/source/lib/hash.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,6 +23,9 @@ #ifndef INCLUDED_HASH #define INCLUDED_HASH +#include +#include + /** * This function is the same as hash_combine, i.e. allows dropping the boost dependency just for this function. */ diff --git a/source/lib/lib.cpp b/source/lib/lib.cpp index 399812d784..91991003b5 100644 --- a/source/lib/lib.cpp +++ b/source/lib/lib.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,15 +25,10 @@ */ #include "precompiled.h" -#include "lib/lib.h" -#include -#include -#include - -#include "lib/app_hooks.h" -#include "lib/sysdep/sysdep.h" +#include "lib.h" +#include "lib/status.h" //----------------------------------------------------------------------------- // type conversion diff --git a/source/lib/lib.h b/source/lib/lib.h index 3bc200aaaa..466ce807ae 100644 --- a/source/lib/lib.h +++ b/source/lib/lib.h @@ -60,6 +60,7 @@ scope #ifndef INCLUDED_LIB #define INCLUDED_LIB +#include "lib/debug.h" #include "lib/types.h" #include // fabsf diff --git a/source/lib/module_init.cpp b/source/lib/module_init.cpp index c5c891dcc5..cdd9cb66f3 100644 --- a/source/lib/module_init.cpp +++ b/source/lib/module_init.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,8 +25,10 @@ */ #include "precompiled.h" -#include "lib/module_init.h" +#include "module_init.h" + +#include "lib/debug.h" #include "lib/sysdep/cpu.h" // not yet initialized, or already shutdown diff --git a/source/lib/module_init.h b/source/lib/module_init.h index dea0f8e764..664a78c894 100644 --- a/source/lib/module_init.h +++ b/source/lib/module_init.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,8 @@ #ifndef INCLUDED_MODULE_INIT #define INCLUDED_MODULE_INIT +#include "lib/status.h" + #include /** diff --git a/source/lib/path.cpp b/source/lib/path.cpp index 85a8f43fce..7ae6bc7f0b 100644 --- a/source/lib/path.cpp +++ b/source/lib/path.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,10 +25,13 @@ */ #include "precompiled.h" -#include "lib/path.h" -#include -#include +#include "path.h" + +#include "lib/code_annotation.h" + +#include +#include static const StatusDefinition pathStatusDefinitions[] = { { ERR::PATH_CHARACTER_ILLEGAL, L"illegal path character" }, diff --git a/source/lib/rand.cpp b/source/lib/rand.cpp index 95364fb24b..b49f75e6ca 100644 --- a/source/lib/rand.cpp +++ b/source/lib/rand.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,7 +25,13 @@ */ #include "precompiled.h" -#include "lib/rand.h" + +#include "rand.h" + +#include "lib/debug.h" +#include "lib/status.h" + +#include // avoids several common pitfalls; see discussion at // http://www.azillionmonkeys.com/qed/random.html diff --git a/source/lib/rand.h b/source/lib/rand.h index 9427f1305c..a379ddca78 100644 --- a/source/lib/rand.h +++ b/source/lib/rand.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,8 @@ #ifndef INCLUDED_RAND #define INCLUDED_RAND +#include + /** * return random integer in [min, max). * avoids several common pitfalls; see discussion at diff --git a/source/lib/secure_crt.cpp b/source/lib/secure_crt.cpp index 2ca3350724..7b553e7807 100644 --- a/source/lib/secure_crt.cpp +++ b/source/lib/secure_crt.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -26,12 +26,17 @@ #include "precompiled.h" +#include "secure_crt.h" + +#include "lib/code_generation.h" +#include "lib/debug.h" + +#include +#include +#include +#include #include #include -#include -#include - -#include "lib/secure_crt.h" #if OS_ANDROID # include diff --git a/source/lib/secure_crt.h b/source/lib/secure_crt.h index d059e01bd2..f6cbedad39 100644 --- a/source/lib/secure_crt.h +++ b/source/lib/secure_crt.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,10 +27,11 @@ #ifndef INCLUDED_SECURE_CRT #define INCLUDED_SECURE_CRT -#include - +#include "lib/code_annotation.h" #include "lib/status.h" +#include + namespace ERR { const Status STRING_NOT_TERMINATED = -100600; diff --git a/source/lib/sysdep/arch/x86_x64/apic.h b/source/lib/sysdep/arch/x86_x64/apic.h index 472cf7a0f5..4cc6ae7958 100644 --- a/source/lib/sysdep/arch/x86_x64/apic.h +++ b/source/lib/sysdep/arch/x86_x64/apic.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,6 +23,10 @@ #ifndef INCLUDED_X86_X64_APIC #define INCLUDED_X86_X64_APIC +#include "lib/types.h" + +#include + typedef u8 ApicId; // not necessarily contiguous values /** diff --git a/source/lib/sysdep/cpu.h b/source/lib/sysdep/cpu.h index 3dc46097c5..daeaa51e49 100644 --- a/source/lib/sysdep/cpu.h +++ b/source/lib/sysdep/cpu.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,7 @@ #ifndef INCLUDED_CPU #define INCLUDED_CPU +#include "lib/status.h" #include "lib/sysdep/compiler.h" diff --git a/source/lib/sysdep/numa.h b/source/lib/sysdep/numa.h index de9970b895..87e816d3f1 100644 --- a/source/lib/sysdep/numa.h +++ b/source/lib/sysdep/numa.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -23,6 +23,9 @@ #ifndef INCLUDED_NUMA #define INCLUDED_NUMA +#include +#include + //----------------------------------------------------------------------------- // node topology diff --git a/source/lib/sysdep/rtl.h b/source/lib/sysdep/rtl.h index 4c0c3940fa..74a0f10f40 100644 --- a/source/lib/sysdep/rtl.h +++ b/source/lib/sysdep/rtl.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,8 @@ #ifndef INCLUDED_RTL #define INCLUDED_RTL +#include + void* rtl_AllocateAligned(size_t size, size_t alignment); void rtl_FreeAligned(void* alignedPointer); diff --git a/source/lib/sysdep/smbios.h b/source/lib/sysdep/smbios.h index c32509a5f5..ec258b56f0 100644 --- a/source/lib/sysdep/smbios.h +++ b/source/lib/sysdep/smbios.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -27,6 +27,10 @@ #ifndef INCLUDED_SMBIOS #define INCLUDED_SMBIOS +#include "lib/types.h" + +#include + namespace SMBIOS { // to introduce another enumeration: diff --git a/source/lib/sysdep/vm.h b/source/lib/sysdep/vm.h index df8dba0980..0346a6a2af 100644 --- a/source/lib/sysdep/vm.h +++ b/source/lib/sysdep/vm.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -28,8 +28,11 @@ #ifndef INCLUDED_SYSDEP_VM #define INCLUDED_SYSDEP_VM +#include "lib/alignment.h" #include "lib/posix/posix_mman.h" // PROT_* +#include + namespace vm { // committing large pages (2 MiB) instead of regular 4 KiB pages can