1
0
forked from mirrors/0ad

Update some includes for iwyu part 1

First batch of fixes to please include-what-you-use.

Ref: #8086
Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
Ralph Sennhauser
2025-06-18 20:34:57 +02:00
parent 1652e82021
commit 4c165dd208
22 changed files with 136 additions and 31 deletions
+5 -2
View File
@@ -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,7 +27,10 @@
#ifndef INCLUDED_ALLOCATORS_DYNARRAY
#define INCLUDED_ALLOCATORS_DYNARRAY
#include "lib/posix/posix_mman.h" // PROT_*
#include "lib/debug.h"
#include "lib/types.h"
#include <cstddef>
/**
* provides a memory range that can be expanded but doesn't waste
+3 -1
View File
@@ -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_ALLOCATORS_FREELIST
#define INCLUDED_ALLOCATORS_FREELIST
#include "lib/debug.h"
#include <cstring>
// "freelist" is a pointer to the first unused element or a sentinel.
+6 -2
View File
@@ -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,7 +23,11 @@
#ifndef INCLUDED_ALLOCATORS_PAGE_ALIGNED
#define INCLUDED_ALLOCATORS_PAGE_ALIGNED
#include "lib/posix/posix_mman.h" // PROT_*
#include "lib/posix/posix_mman.h" // PROT_*
#include "lib/debug.h"
#include "lib/types.h"
#include <cstddef>
// very thin wrapper on top of sys/mman.h that makes the intent more obvious
// (its commit/decommit semantics are difficult to tell apart)
+9 -2
View File
@@ -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,8 +27,15 @@
#ifndef INCLUDED_ALLOCATORS_POOL
#define INCLUDED_ALLOCATORS_POOL
#include "lib/bits.h" // ROUND_UP
#include "lib/allocators/allocator_policies.h"
#include "lib/allocators/freelist.h"
#include "lib/bits.h" // ROUND_UP
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/status.h"
#include <cstddef>
#include <cstdint>
namespace Allocators {
+6 -1
View File
@@ -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
@@ -24,7 +24,12 @@
#define INCLUDED_ALLOCATORS_SHARED_PTR
#include "lib/alignment.h"
#include "lib/debug.h"
#include "lib/sysdep/rtl.h" // rtl_AllocateAligned
#include "lib/types.h"
#include <cstddef>
#include <memory>
struct DummyDeleter
{
+9 -1
View File
@@ -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
@@ -27,6 +27,14 @@
#ifndef INCLUDED_BITS
#define INCLUDED_BITS
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/status.h"
#include <climits>
#include <cstddef>
#include <limits>
/**
* value of bit number \<n\>.
*
+4 -1
View File
@@ -27,7 +27,10 @@
#ifndef INCLUDED_BYTE_ORDER
#define INCLUDED_BYTE_ORDER
#include "lib/sysdep/cpu.h"
#include "lib/sysdep/compiler.h"
#include "lib/types.h"
#include <cstddef>
// detect byte order via predefined macros.
#ifndef BYTE_ORDER
+5 -1
View File
@@ -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
@@ -27,6 +27,10 @@
#ifndef INCLUDED_DEBUG_STL
#define INCLUDED_DEBUG_STL
#include "lib/status.h"
#include "lib/types.h"
#include <cstddef>
namespace ERR
{
+10 -2
View File
@@ -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,9 +27,17 @@
#ifndef INCLUDED_ARCHIVE
#define INCLUDED_ARCHIVE
#include "lib/file/file_system.h" // FileInfo
#include "lib/file/common/file_loader.h"
#include "lib/file/file_system.h" // FileInfo
#include "lib/file/vfs/vfs_path.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include "lib/status.h"
#include "lib/types.h"
#include <cstdint>
#include <memory>
#include <time.h>
// 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
+7 -1
View File
@@ -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
@@ -29,6 +29,12 @@
#ifndef INCLUDED_CODEC
#define INCLUDED_CODEC
#include "lib/status.h"
#include "lib/types.h"
#include <cstddef>
#include <memory>
#define CODEC_COMPUTE_CHECKSUM 1
struct ICodec
+7 -1
View File
@@ -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,7 +27,13 @@
#ifndef INCLUDED_STREAM
#define INCLUDED_STREAM
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/archive/codec.h"
#include "lib/types.h"
#include <cstddef>
#include <memory>
// note: this is similar in function to std::vector, but we don't need
// iterators etc. and would prefer to avoid initializing each byte.
+6 -1
View File
@@ -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
@@ -24,6 +24,11 @@
#define INCLUDED_FILE_LOADER
#include "lib/os_path.h"
#include "lib/status.h"
#include "lib/types.h"
#include <cstddef>
#include <memory>
struct IFileLoader
{
+4 -2
View File
@@ -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
@@ -27,7 +27,9 @@
#ifndef INCLUDED_FILE_STATS
#define INCLUDED_FILE_STATS
#include "lib/posix/posix_aio.h" // LIO_READ, LIO_WRITE
#include "lib/code_annotation.h"
#include <sys/types.h>
#define FILE_STATS_ENABLED 0
+8 -1
View File
@@ -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
@@ -23,8 +23,15 @@
#ifndef INCLUDED_REAL_DIRECTORY
#define INCLUDED_REAL_DIRECTORY
#include "lib/code_annotation.h"
#include "lib/file/common/file_loader.h"
#include "lib/os_path.h"
#include "lib/status.h"
#include "lib/sysdep/dir_watch.h"
#include "lib/types.h"
#include <cstddef>
#include <memory>
class RealDirectory : public IFileLoader
{
+7 -1
View File
@@ -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
@@ -35,7 +35,13 @@
#ifndef INCLUDED_TRACE
#define INCLUDED_TRACE
#include "lib/debug.h"
#include "lib/os_path.h"
#include "lib/path.h"
#include <cstddef>
#include <memory>
#include <string>
// stores information about an IO event.
class TraceEntry
+2 -1
View File
@@ -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,7 @@
#include "precompiled.h"
#include "lib/file/io/io.h"
#include "lib/config2.h"
#include "lib/sysdep/rtl.h"
static const StatusDefinition ioStatusDefinitions[] = {
+14 -5
View File
@@ -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,14 +28,23 @@
#ifndef INCLUDED_IO
#define INCLUDED_IO
#include "lib/config2.h"
#include "lib/alignment.h"
#include "lib/bits.h"
#include "lib/timer.h"
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/file.h"
#include "lib/sysdep/rtl.h"
#include "lib/sysdep/filesystem.h" // wtruncate
#include "lib/lib.h"
#include "lib/os_path.h"
#include "lib/posix/posix_aio.h" // LIO_READ, LIO_WRITE
#include "lib/sysdep/filesystem.h" // wtruncate
#include "lib/sysdep/os.h"
#include "lib/sysdep/rtl.h"
#include "lib/types.h"
#include <algorithm>
#include <cstddef>
#include <cstdint>
#include <memory>
namespace ERR
{
+7 -1
View File
@@ -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
@@ -23,7 +23,13 @@
#ifndef INCLUDED_WRITE_BUFFER
#define INCLUDED_WRITE_BUFFER
#include "lib/code_annotation.h"
#include "lib/debug.h"
#include "lib/file/file.h"
#include "lib/types.h"
#include <cstddef>
#include <memory>
class WriteBuffer
{
+9 -1
View File
@@ -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,16 @@
#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/types.h"
#include <cstddef>
#include <limits>
#include <memory>
#include <string>
constexpr size_t VFS_MIN_PRIORITY = 0;
constexpr size_t VFS_MAX_PRIORITY = std::numeric_limits<size_t>::max();
+4 -1
View File
@@ -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,8 +27,11 @@
#ifndef INCLUDED_VFS_LOOKUP
#define INCLUDED_VFS_LOOKUP
#include "lib/debug.h"
#include "lib/file/vfs/vfs_path.h"
#include <cstddef>
class VfsFile;
class VfsDirectory;
+2 -1
View File
@@ -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,6 +25,7 @@
#include "lib/path.h"
#include <string>
#include <vector>
/**
+2 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2024 Wildfire Games.
/* Copyright (C) 2025 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -25,6 +25,7 @@
#include "lib/file/archive/archive_zip.h"
#include "lib/file/io/io.h"
#include "lib/utf8.h"
#include "lib/timer.h"
#include "maths/Vector3D.h"
#include "ps/CLogger.h"
#include "ps/Filesystem.h"