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 20, 2023
1 parent 2b3d191 commit c88d76e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 4 deletions.
11 changes: 8 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

#include "simplecpp.h"

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

#include "simplecpp.h"

int main(int argc, char **argv)
{
Expand Down
7 changes: 7 additions & 0 deletions simplecpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cstdio>
#include <cstdlib>
Expand All @@ -33,13 +34,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 +3138,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
9 changes: 8 additions & 1 deletion test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,17 @@
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/

#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 c88d76e

Please sign in to comment.