Skip to content

Commit d9b6940

Browse files
Cleanup: unnecessary includes, fix include order, fix unreferenced va… (cppcheck-opensource#3418)
1 parent f31fbba commit d9b6940

4 files changed

Lines changed: 7 additions & 9 deletions

File tree

cli/cppcheckexecutor.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@
6868
#include <execinfo.h>
6969
#endif
7070

71+
#if defined(_WIN32)
7172
#if defined(_MSC_VER)
7273
#define USE_WINDOWS_SEH
74+
#endif
75+
#include <Windows.h>
7376
#include <DbgHelp.h>
7477
#include <TCHAR.H>
75-
#include <Windows.h>
7678
#include <excpt.h>
7779
#endif
7880

cli/threadexecutor.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@
3232
#include <cstring>
3333
#include <iostream>
3434
#include <utility>
35-
#include <future>
36-
#include <numeric>
3735

3836
#ifdef __SVR4 // Solaris
3937
#include <sys/loadavg.h>
@@ -48,8 +46,8 @@
4846
#include <unistd.h>
4947
#endif
5048
#ifdef THREADING_MODEL_WIN
51-
#include <process.h>
52-
#include <windows.h>
49+
#include <future>
50+
#include <numeric>
5351
#endif
5452

5553
// required for FD_ZERO

cli/threadexecutor.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@
3333
#define THREADING_MODEL_FORK
3434
#elif defined(_WIN32)
3535
#define THREADING_MODEL_WIN
36-
#include <windows.h>
37-
3836
#include "importproject.h"
3937
#endif
4038

lib/tokenize.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,7 +2263,7 @@ bool Tokenizer::simplifyUsing()
22632263
Token::Match(tok, "using namespace %name% ;|::")) {
22642264
try {
22652265
setScopeInfo(tok, &currentScope, mSettings->debugwarnings);
2266-
} catch (const std::runtime_error &e) {
2266+
} catch (const std::runtime_error &) {
22672267
reportError(tok, Severity::debug, "simplifyUsingUnmatchedBodyEnd",
22682268
"simplifyUsing: unmatched body end");
22692269
}
@@ -2417,7 +2417,7 @@ bool Tokenizer::simplifyUsing()
24172417
Token::Match(tok1, "using namespace %name% ;|::")) {
24182418
try {
24192419
setScopeInfo(tok1, &currentScope1, mSettings->debugwarnings);
2420-
} catch (const std::runtime_error &e) {
2420+
} catch (const std::runtime_error &) {
24212421
reportError(tok1, Severity::debug, "simplifyUsingUnmatchedBodyEnd",
24222422
"simplifyUsing: unmatched body end");
24232423
}

0 commit comments

Comments
 (0)