Skip to content

Commit

Permalink
Merge pull request #91 from delroth/iwyu
Browse files Browse the repository at this point in the history
Include-what-you-use suggested fixes.
  • Loading branch information
delroth committed Feb 23, 2014
2 parents 9fa0fda + f344a43 commit 7cabe17
Show file tree
Hide file tree
Showing 192 changed files with 1,975 additions and 471 deletions.
1 change: 1 addition & 0 deletions Source/Core/Common/ArmCPUDetect.cpp
Expand Up @@ -5,6 +5,7 @@
#include "Common/Common.h"
#include "Common/CPUDetect.h"
#include "Common/FileUtil.h"
#include "Common/StringUtil.h"

// Only Linux platforms have /proc/cpuinfo
#if !defined(BLACKBERRY) && !defined(IOS) && !defined(__SYMBIAN32__)
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/Common/Atomic.h
Expand Up @@ -6,11 +6,11 @@

#ifdef _WIN32

#include "Common/Atomic_Win32.h"
#include "Common/Atomic_Win32.h" // IWYU pragma: export

#else

// GCC-compatible compiler assumed!
#include "Common/Atomic_GCC.h"
#include "Common/Atomic_GCC.h" // IWYU pragma: export

#endif
2 changes: 2 additions & 0 deletions Source/Core/Common/Atomic_GCC.h
Expand Up @@ -2,6 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.

// IWYU pragma: private, include "Common/Atomic.h"

#pragma once

#include "Common/Common.h"
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Common/Atomic_Win32.h
Expand Up @@ -2,6 +2,8 @@
// Licensed under GPLv2
// Refer to the license.txt file included.

// IWYU pragma: private, include "Common/Atomic.h"

#pragma once

#include <intrin.h>
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/Common/BreakPoints.cpp
Expand Up @@ -3,11 +3,14 @@
// Refer to the license.txt file included.

#include <sstream>
#include <string>
#include <vector>

#include "Common/BreakPoints.h"
#include "Common/Common.h"
#include "Common/DebugInterface.h"
#include "Core/PowerPC/JitCommon/JitBase.h"
#include "Core/PowerPC/JitCommon/JitCache.h"

bool BreakPoints::IsAddressBreakPoint(u32 _iAddress)
{
Expand Down
6 changes: 5 additions & 1 deletion Source/Core/Common/CDUtils.cpp
@@ -1,6 +1,9 @@
// Most of the code in this file was shamelessly ripped from libcdio With minor adjustments

#include <memory> // for std::unique_ptr
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>

#include "Common/CDUtils.h"
#include "Common/Common.h"
Expand All @@ -19,6 +22,7 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <unistd.h>
#endif // WIN32

#ifdef __linux__
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Common/ChunkFile.h
Expand Up @@ -13,12 +13,14 @@
// - Zero backwards/forwards compatibility
// - Serialization code for anything complex has to be manually written.

#include <cstddef>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <string>
#include <type_traits>
#include <utility>
#include <vector>

#include "Common/Common.h"
Expand Down
8 changes: 4 additions & 4 deletions Source/Core/Common/Common.h
Expand Up @@ -168,7 +168,7 @@ enum EMUSTATE_CHANGE
EMUSTATE_CHANGE_STOP
};

#include "Common/CommonTypes.h"
#include "Common/CommonFuncs.h" // NOLINT: needs to be included after CommonTypes
#include "Common/Log.h"
#include "Common/MsgHandler.h"
#include "Common/CommonTypes.h" // IWYU pragma: export
#include "Common/CommonFuncs.h" // IWYU pragma: export // NOLINT
#include "Common/Log.h" // IWYU pragma: export
#include "Common/MsgHandler.h" // IWYU pragma: export
3 changes: 0 additions & 3 deletions Source/Core/Common/CommonPaths.h
Expand Up @@ -4,9 +4,6 @@

#pragma once

// Make sure we pick up USER_DIR if set in config.h
#include "Common/Common.h"

// Directory seperators, do we need this?
#define DIR_SEP "/"
#define DIR_SEP_CHR '/'
Expand Down
1 change: 0 additions & 1 deletion Source/Core/Common/CommonTypes.h
Expand Up @@ -9,7 +9,6 @@

#pragma once

#include <cstddef>
#include <cstdint>

#ifdef _WIN32
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/DebugInterface.h
@@ -1,5 +1,6 @@
#pragma once

#include <cstring>
#include <string>

class DebugInterface
Expand Down
4 changes: 4 additions & 0 deletions Source/Core/Common/FifoQueue.h
Expand Up @@ -3,7 +3,11 @@
// a simple lockless thread-safe,
// single reader, single writer queue

#include <algorithm>
#include <cstddef>

#include "Common/Atomic.h"
#include "Common/CommonTypes.h"

namespace Common
{
Expand Down
3 changes: 1 addition & 2 deletions Source/Core/Common/FileSearch.cpp
Expand Up @@ -3,14 +3,13 @@
// Refer to the license.txt file included.

#include <algorithm>
#include <cstring>

#include "Common/Common.h"
#include "Common/CommonPaths.h"
#include "Common/FileSearch.h"
#include "Common/StringUtil.h"

#ifndef _WIN32
#include <sys/types.h>
#include <dirent.h>
#else
#include <windows.h>
Expand Down
11 changes: 9 additions & 2 deletions Source/Core/Common/FileUtil.cpp
Expand Up @@ -3,9 +3,16 @@
// Refer to the license.txt file included.

#include <algorithm>
#include <cstddef>
#include <cstdio>
#include <cstring>
#include <fcntl.h>
#include <limits.h>
#include <string>
#include <vector>
#include <sys/stat.h>

#include "Common/Common.h"
#include "Common/CommonPaths.h"
#include "Common/FileUtil.h"

Expand All @@ -21,14 +28,14 @@
#include <errno.h>
#include <libgen.h>
#include <stdlib.h>
#include <sys/param.h>
#include <sys/types.h>
#include <unistd.h>
#endif

#if defined(__APPLE__)
#include <CoreFoundation/CFBundle.h>
#include <CoreFoundation/CFString.h>
#include <CoreFoundation/CFURL.h>
#include <sys/param.h>
#endif

#ifndef S_ISDIR
Expand Down
5 changes: 4 additions & 1 deletion Source/Core/Common/FileUtil.h
Expand Up @@ -4,14 +4,17 @@

#pragma once

#include <cstddef>
#include <cstdio>
#include <fstream>
#include <string>
#include <string.h>
#include <vector>

#include "Common/Common.h"

#ifdef _WIN32
#include "Common/StringUtil.h"
#endif

// User directory indices for GetUserPath
enum {
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Common/FixedSizeQueue.h
Expand Up @@ -4,6 +4,8 @@

#pragma once

#include <cstddef>

// STL-look-a-like interface, but name is mixed case to distinguish it clearly from the
// real STL classes.

Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Common/GenericFPURoundMode.cpp
Expand Up @@ -15,7 +15,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/

#include "FPURoundMode.h"
#include "Common/CommonTypes.h"
#include "Common/FPURoundMode.h"

// Generic, do nothing
namespace FPURoundMode
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Common/Hash.h
Expand Up @@ -4,6 +4,8 @@

#pragma once

#include <cstddef>

#include "Common/Common.h"

u32 HashFletcher(const u8* data_u8, size_t length); // FAST. Length & 1 == 0.
Expand Down
8 changes: 5 additions & 3 deletions Source/Core/Common/IniFile.cpp
Expand Up @@ -6,13 +6,15 @@
// see IniFile.h

#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstddef>
#include <cstring>
#include <fstream>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <vector>

#include "Common/CommonTypes.h"
#include "Common/FileUtil.h"
#include "Common/IniFile.h"
#include "Common/StringUtil.h"
Expand Down
3 changes: 2 additions & 1 deletion Source/Core/Common/IniFile.h
Expand Up @@ -4,11 +4,12 @@

#pragma once

#include <cstring>
#include <map>
#include <set>
#include <string>
#include <vector>

#include "Common/CommonTypes.h"
#include "Common/StringUtil.h"

struct CaseInsensitiveStringCompare
Expand Down
1 change: 1 addition & 0 deletions Source/Core/Common/LinearDiskCache.h
Expand Up @@ -4,6 +4,7 @@

#pragma once

#include <cstring>
#include <fstream>

#include "Common/Common.h"
Expand Down
10 changes: 8 additions & 2 deletions Source/Core/Common/LogManager.cpp
Expand Up @@ -2,14 +2,20 @@
// Licensed under GPLv2
// Refer to the license.txt file included.

#include <algorithm>
#include <cstdarg>
#include <cstring>
#include <mutex>
#include <ostream>
#include <set>
#include <string>

#ifdef ANDROID
#include "Core/Host.h"
#endif
#include "Common/FileUtil.h"
#include "Common/Log.h"
#include "Common/LogManager.h"
#include "Common/Thread.h"
#include "Common/StringUtil.h"
#include "Common/Timer.h"

void GenericLog(LogTypes::LOG_LEVELS level, LogTypes::LOG_TYPE type,
Expand Down
9 changes: 4 additions & 5 deletions Source/Core/Common/LogManager.h
Expand Up @@ -4,13 +4,12 @@

#pragma once

#include <cstdarg>
#include <fstream>
#include <mutex>
#include <set>
#include <string.h>

#include "Common/FileUtil.h"
#include "Common/Log.h"
#include "Common/StringUtil.h"
#include "Common/Thread.h"
#include "Common/Common.h"

#define MAX_MESSAGES 8000
#define MAX_MSGLEN 1024
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Common/MathUtil.cpp
Expand Up @@ -3,8 +3,10 @@
// Refer to the license.txt file included.

#include <cmath>
#include <cstring>
#include <numeric>

#include "Common/CommonTypes.h"
#include "Common/MathUtil.h"

namespace MathUtil
Expand Down
2 changes: 1 addition & 1 deletion Source/Core/Common/MathUtil.h
Expand Up @@ -4,10 +4,10 @@

#pragma once

#include <cstdlib>
#include <vector>

#include "Common/Common.h"
#include "Common/FPURoundMode.h"

namespace MathUtil
{
Expand Down
11 changes: 7 additions & 4 deletions Source/Core/Common/MemArena.cpp
Expand Up @@ -2,20 +2,23 @@
// Licensed under GPLv2
// Refer to the license.txt file included.

#include <cstddef>
#include <cstdlib>
#include <set>
#include <string>

#include "Common/Common.h"
#include "Common/MemArena.h"
#include "Common/MemoryUtil.h"
#include "Common/StringUtil.h"

#ifdef _WIN32
#include <windows.h>
#else
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <cerrno>
#include <cstring>
#include <fcntl.h>
#include <unistd.h>
#include <sys/mman.h>
#ifdef ANDROID
#include <sys/ioctl.h>
#include <linux/ashmem.h>
Expand Down
2 changes: 2 additions & 0 deletions Source/Core/Common/MemArena.h
Expand Up @@ -4,6 +4,8 @@

#pragma once

#include <cstddef>

#ifdef _WIN32
#include <windows.h>
#endif
Expand Down
8 changes: 5 additions & 3 deletions Source/Core/Common/MemoryUtil.cpp
Expand Up @@ -2,17 +2,19 @@
// Licensed under GPLv2
// Refer to the license.txt file included.

#include <cstddef>
#include <cstdlib>
#include <string>

#include "Common/Common.h"
#include "Common/MemoryUtil.h"
#include "Common/StringUtil.h"

#ifdef _WIN32
#include <windows.h>
#include <psapi.h>
#include "Common/StringUtil.h"
#else
#include <errno.h>
#include <stdio.h>
#include <sys/mman.h>
#endif

#if !defined(_WIN32) && defined(__x86_64__) && !defined(MAP_32BIT)
Expand Down

0 comments on commit 7cabe17

Please sign in to comment.