Skip to content

Commit 28aa939

Browse files
mathbunnyrudanmar
authored andcommitted
iwyu - include what you use
1 parent 809ccc7 commit 28aa939

File tree

162 files changed

+1162
-475
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

162 files changed

+1162
-475
lines changed

Makefile

Lines changed: 99 additions & 99 deletions
Large diffs are not rendered by default.

cli/cmdlineparser.cpp

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,27 @@
1717
*/
1818

1919
#include "cmdlineparser.h"
20-
#include "cppcheck.h"
20+
21+
#include "check.h"
2122
#include "cppcheckexecutor.h"
2223
#include "filelister.h"
24+
#include "importproject.h"
2325
#include "path.h"
26+
#include "platform.h"
2427
#include "settings.h"
25-
#include "timer.h"
26-
#include "check.h"
28+
#include "standards.h"
29+
#include "suppressions.h"
2730
#include "threadexecutor.h" // Threading model
31+
#include "timer.h"
2832
#include "utils.h"
2933

3034
#include <algorithm>
31-
#include <iostream>
32-
#include <sstream>
33-
#include <fstream>
34-
#include <string>
35-
#include <cstring>
35+
#include <cstdio>
3636
#include <cstdlib> // EXIT_FAILURE
37+
#include <cstring>
38+
#include <iostream>
39+
#include <list>
40+
#include <set>
3741

3842
#ifdef HAVE_RULES
3943
// xml is used for rules

cli/cmdlineparser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#ifndef CMDLINE_PARSER_H
2020
#define CMDLINE_PARSER_H
2121

22-
#include <vector>
2322
#include <string>
23+
#include <vector>
2424

2525
class Settings;
2626

cli/cppcheckexecutor.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,30 +17,39 @@
1717
*/
1818

1919
#include "cppcheckexecutor.h"
20+
2021
#include "analyzerinfo.h"
2122
#include "cmdlineparser.h"
23+
#include "config.h"
2224
#include "cppcheck.h"
2325
#include "filelister.h"
26+
#include "importproject.h"
27+
#include "library.h"
2428
#include "path.h"
2529
#include "pathmatch.h"
2630
#include "preprocessor.h"
31+
#include "settings.h"
32+
#include "standards.h"
33+
#include "suppressions.h"
2734
#include "threadexecutor.h"
2835
#include "utils.h"
2936

3037
#include <cstdlib> // EXIT_SUCCESS and EXIT_FAILURE
3138
#include <cstring>
32-
#include <algorithm>
3339
#include <iostream>
34-
#include <sstream>
40+
#include <list>
41+
#include <utility>
42+
#include <vector>
3543

3644
#if !defined(NO_UNIX_SIGNAL_HANDLING) && defined(__GNUC__) && !defined(__CYGWIN__) && !defined(__MINGW32__) && !defined(__OS2__)
3745
#define USE_UNIX_SIGNAL_HANDLING
38-
#include <cstdio>
3946
#include <signal.h>
4047
#include <unistd.h>
48+
#include <cstdio>
4149
#if defined(__APPLE__)
4250
# define _XOPEN_SOURCE // ucontext.h APIs can only be used on Mac OSX >= 10.7 if _XOPEN_SOURCE is defined
4351
# include <ucontext.h>
52+
4453
# undef _XOPEN_SOURCE
4554
#elif !defined(__OpenBSD__)
4655
# include <ucontext.h>
@@ -59,10 +68,10 @@
5968

6069
#if defined(_MSC_VER)
6170
#define USE_WINDOWS_SEH
62-
#include <Windows.h>
6371
#include <DbgHelp.h>
64-
#include <excpt.h>
6572
#include <TCHAR.H>
73+
#include <Windows.h>
74+
#include <excpt.h>
6675
#endif
6776

6877

cli/cppcheckexecutor.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,16 @@
2020
#define CPPCHECKEXECUTOR_H
2121

2222
#include "errorlogger.h"
23+
2324
#include <cstdio>
2425
#include <ctime>
26+
#include <map>
2527
#include <set>
2628
#include <string>
2729

2830
class CppCheck;
29-
class Settings;
3031
class Library;
32+
class Settings;
3133

3234
/**
3335
* This class works as an example of how CppCheck can be used in external

cli/filelister.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@
1717
*/
1818

1919
#include "filelister.h"
20+
2021
#include "path.h"
2122
#include "pathmatch.h"
22-
#include <cstring>
23-
#include <string>
2423

24+
#include <cstddef>
25+
#include <cstring>
2526

2627
#ifdef _WIN32
2728

@@ -163,9 +164,6 @@ bool FileLister::fileExists(const std::string &path)
163164
#endif
164165

165166
#include <dirent.h>
166-
#include <unistd.h>
167-
#include <stdlib.h>
168-
#include <limits.h>
169167
#include <sys/stat.h>
170168

171169

cli/filelister.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919
#ifndef filelisterH
2020
#define filelisterH
2121

22-
#include <string>
23-
#include <set>
22+
#include <cstddef>
2423
#include <map>
24+
#include <set>
25+
#include <string>
2526

2627
class PathMatch;
2728

cli/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,10 @@ void CheckOther::checkZeroDivision()
103103
#include "cppcheckexecutor.h"
104104

105105
#include <iostream>
106-
#include <cstdlib>
107106

108107
#ifdef _WIN32
109108
#include <windows.h>
109+
110110
static char exename[1024] = {0};
111111
#endif
112112

cli/threadexecutor.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,31 +17,34 @@
1717
*/
1818

1919
#include "threadexecutor.h"
20+
21+
#include "config.h"
2022
#include "cppcheck.h"
2123
#include "cppcheckexecutor.h"
24+
#include "importproject.h"
25+
#include "settings.h"
26+
#include "suppressions.h"
27+
28+
#include <algorithm>
29+
#include <cstdlib>
30+
#include <cstring>
2231
#include <iostream>
32+
#include <utility>
33+
2334
#ifdef __SVR4 // Solaris
2435
#include <sys/loadavg.h>
2536
#endif
2637
#ifdef THREADING_MODEL_FORK
27-
#include <algorithm>
2838
#include <sys/select.h>
2939
#include <sys/wait.h>
30-
#include <unistd.h>
31-
#include <fcntl.h>
32-
#include <cstdlib>
33-
#include <cstdio>
3440
#include <errno.h>
35-
#include <time.h>
36-
#include <cstring>
37-
#include <sstream>
41+
#include <fcntl.h>
42+
#include <unistd.h>
3843
#endif
3944
#ifdef THREADING_MODEL_WIN
45+
#include <errno.h>
4046
#include <process.h>
4147
#include <windows.h>
42-
#include <algorithm>
43-
#include <cstring>
44-
#include <errno.h>
4548
#endif
4649

4750
// required for FD_ZERO

cli/threadexecutor.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
#ifndef THREADEXECUTOR_H
2020
#define THREADEXECUTOR_H
2121

22-
#include <map>
23-
#include <string>
24-
#include <list>
2522
#include "errorlogger.h"
2623
#include "importproject.h"
2724

25+
#include <cstddef>
26+
#include <list>
27+
#include <map>
28+
#include <string>
29+
2830
#if (defined(__GNUC__) || defined(__sun)) && !defined(__MINGW32__)
2931
#define THREADING_MODEL_FORK
3032
#elif defined(_WIN32)

0 commit comments

Comments
 (0)