Skip to content

Commit

Permalink
fixed misc-include-cleaner clang-tidy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
firewave committed Aug 22, 2023
1 parent dff9e77 commit e7abce7
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 3 deletions.
7 changes: 6 additions & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,14 @@

#include "simplecpp.h"

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

int main(int argc, char **argv)
{
Expand Down
9 changes: 9 additions & 0 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,14 @@
#define SIMPLECPP_WINDOWS
#define NOMINMAX
#endif

#include "simplecpp.h"

#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
Expand All @@ -33,13 +36,18 @@
#include <fstream> // IWYU pragma: keep
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <set>
#include <sstream> // IWYU pragma: keep
#include <stack>
#include <stdexcept>
#include <string>
#if __cplusplus >= 201103L
#include <unordered_map>
#endif
#include <utility>
#include <vector>

#ifdef SIMPLECPP_WINDOWS
#include <windows.h>
Expand Down Expand Up @@ -3132,6 +3140,7 @@ static void getLocaltime(struct tm &ltime)
time_t t;
time(&t);
#ifndef _WIN32
// NOLINTNEXTLINE(misc-include-cleaner) - false positive
localtime_r(&t, &ltime);
#else
localtime_s(&ltime, &t);
Expand Down
11 changes: 9 additions & 2 deletions test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,18 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "simplecpp.h"

#include <cctype>
#include <cstdlib>
#include <cstring>
#include <exception>
#include <iostream>
#include <limits>
#include <map>
#include <sstream>
#include <stdexcept>
#include <string>
#include <vector>
#include "simplecpp.h"

static int numberOfFailedAssertions = 0;

Expand Down

0 comments on commit e7abce7

Please sign in to comment.