Skip to content

Commit 9130bf1

Browse files
authored
Remove unused includes (#1604)
* Remove unused includes * Fix * Add back `cstring` where needed * Remove unused includes from examples and tutorials * Add `cstdlib` * Remove unused includes for DPDK * Remove unused includes for PF_RING * Remove one more unused include for PF_RING
1 parent 44972d0 commit 9130bf1

File tree

91 files changed

+20
-160
lines changed

Some content is hidden

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

91 files changed

+20
-160
lines changed

Common++/src/GeneralUtils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
#include "Logger.h"
55
#include <sstream>
66
#include <iomanip>
7-
#include <string.h>
8-
#include <stdlib.h>
7+
#include <cstring>
98

109
namespace pcpp
1110
{

Common++/src/IpAddress.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
#define LOG_MODULE CommonLogModuleIpUtils
22

33
#include <algorithm>
4-
#include <cmath>
5-
#include <errno.h>
64
#include <sstream>
75
#include <stdexcept>
8-
#include <stdint.h>
96
#include <bitset>
107
#include "Logger.h"
118
#include "IpUtils.h"

Common++/src/IpUtils.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
#include "IpUtils.h"
44
#include "Logger.h"
5-
#include <string.h>
6-
#include <stdio.h>
5+
#include <cstring>
76
#include <stdexcept>
87
#ifndef NS_INADDRSZ
98
# define NS_INADDRSZ 4

Common++/src/MacAddress.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#include <stdio.h>
2-
31
#include "MacAddress.h"
42

53
namespace pcpp

Common++/src/SystemUtils.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99
#include <array>
1010
#include <iostream>
1111
#include <mutex>
12-
#include <signal.h>
13-
#include <stdio.h>
14-
#include <string.h>
12+
#include <cstring>
13+
#include <csignal>
1514
#include <sys/stat.h>
1615
#if defined(__APPLE__)
1716
# include <mach/clock.h>

Common++/src/TablePrinter.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include <iomanip>
44
#include <sstream>
55
#include <iostream>
6-
#include <iterator>
76
#include <numeric>
87
#include <utility>
98
#include "TablePrinter.h"

Examples/ArpSpoofing/main.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
1-
#include <stdio.h>
2-
#include <stdlib.h>
31
#include <iostream>
42
#include <fstream>
5-
#include <memory>
63
#include <MacAddress.h>
74
#include <IpAddress.h>
85
#include <PcapPlusPlusVersion.h>
@@ -11,7 +8,6 @@
118
#include <PcapLiveDevice.h>
129
#include <EthLayer.h>
1310
#include <ArpLayer.h>
14-
#include <Logger.h>
1511
#include <getopt.h>
1612

1713
#define EXIT_WITH_ERROR(reason) \

Examples/Arping/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
* response. Its basic input is the target IP address and the interface name/IP to send the ARP request from
66
*/
77

8-
#include <stdlib.h>
98
#include <iostream>
109
#include <MacAddress.h>
1110
#include <IpAddress.h>

Examples/DNSResolver/main.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#include <stdlib.h>
21
#include <iostream>
32
#include "PcapPlusPlusVersion.h"
43
#include "PcapLiveDevice.h"

Examples/DpdkBridge/Common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
#include <iomanip>
1212
#include <iostream>
1313
#include <sstream>
14-
#include <stdlib.h>
1514

1615
/**
1716
* Macros for exiting the application with error

0 commit comments

Comments
 (0)