Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

src: apply clang-tidy rule modernize-deprecated-headers #26159

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/api/exceptions.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include "uv.h"
#include "v8.h"

#include <string.h>
#include <cstring>

namespace node {

Expand Down
2 changes: 1 addition & 1 deletion src/api/utils.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "node.h"
#include "node_internals.h"

#include <signal.h>
#include <csignal>

namespace node {

Expand Down
2 changes: 1 addition & 1 deletion src/async_wrap.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#include "base_object.h"
#include "v8.h"

#include <stdint.h>
#include <cstdint>

namespace node {

Expand Down
4 changes: 2 additions & 2 deletions src/base64.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

#include "util.h"

#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>

namespace node {
//// Base 64 ////
Expand Down
4 changes: 2 additions & 2 deletions src/cares_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "util-inl.h"
#include "uv.h"

#include <errno.h>
#include <string.h>
#include <cerrno>
#include <cstring>
#include <vector>
#include <unordered_set>

Expand Down
2 changes: 1 addition & 1 deletion src/debug_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
#include <execinfo.h>
#include <unistd.h>
#include <sys/mman.h>
#include <stdio.h>
#include <cstdio>
#endif

#else // __POSIX__
Expand Down
4 changes: 2 additions & 2 deletions src/env-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "node_context_data.h"
#include "node_worker.h"

#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>

namespace node {

Expand Down
2 changes: 1 addition & 1 deletion src/env.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "tracing/traced_value.h"
#include "v8-profiler.h"

#include <stdio.h>
#include <cstdio>
#include <algorithm>
#include <atomic>

Expand Down
2 changes: 1 addition & 1 deletion src/env.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#include "uv.h"
#include "v8.h"

#include <stdint.h>
#include <cstdint>
#include <functional>
#include <list>
#include <unordered_map>
Expand Down
4 changes: 2 additions & 2 deletions src/inspector_agent.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@

#include "libplatform/libplatform.h"

#include <string.h>
#include <cstring>
#include <sstream>
#include <unordered_map>
#include <vector>

#ifdef __POSIX__
#include <limits.h> // PTHREAD_STACK_MIN
#include <climits> // PTHREAD_STACK_MIN
#include <pthread.h>
#endif // __POSIX__

Expand Down
2 changes: 1 addition & 1 deletion src/inspector_agent.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

#include <memory>

#include <stddef.h>
#include <cstddef>

#if !HAVE_INSPECTOR
#error("This header can only be used when inspector is enabled")
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_io.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "zlib.h"

#include <deque>
#include <string.h>
#include <cstring>
#include <vector>

namespace node {
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#include "uv.h"

#include <memory>
#include <stddef.h>
#include <cstddef>

#if !HAVE_INSPECTOR
#error("This header can only be used when inspector is enabled")
Expand Down
2 changes: 1 addition & 1 deletion src/inspector_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "openssl/sha.h" // Sha-1 hash

#include <map>
#include <string.h>
#include <cstring>

#define ACCEPT_KEY_LENGTH base64_encoded_size(20)
#define BUFFER_GROWTH_CHUNK_SIZE 1024
Expand Down
2 changes: 1 addition & 1 deletion src/module_wrap.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <algorithm>
#include <limits.h> // PATH_MAX
#include <climits> // PATH_MAX
#include <sys/stat.h> // S_IFDIR
#include "module_wrap.h"

Expand Down
12 changes: 6 additions & 6 deletions src/node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@
#include "large_pages/node_large_page.h"
#endif

#include <errno.h>
#include <cerrno>
#include <fcntl.h> // _O_RDWR
#include <limits.h> // PATH_MAX
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <climits> // PATH_MAX
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <sys/types.h>

#include <string>
Expand Down
4 changes: 2 additions & 2 deletions src/node.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ NODE_DEPRECATED("Use MakeCallback(..., async_context)",

} // namespace node

#include <assert.h>
#include <stdint.h>
#include <cassert>
#include <cstdint>

#ifndef NODE_STRINGIFY
#define NODE_STRINGIFY(n) NODE_STRINGIFY_HELPER(n)
Expand Down
4 changes: 2 additions & 2 deletions src/node_buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
#include "v8-profiler.h"
#include "v8.h"

#include <string.h>
#include <limits.h>
#include <cstring>
#include <climits>

#define THROW_AND_RETURN_UNLESS_BUFFER(env, obj) \
THROW_AND_RETURN_IF_NOT_BUFFER(env, obj, "argument") \
Expand Down
4 changes: 2 additions & 2 deletions src/node_constants.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@

#include "zlib.h"

#include <errno.h>
#include <cerrno>
#if !defined(_MSC_VER)
#include <unistd.h>
#endif
#include <fcntl.h>
#include <signal.h>
#include <csignal>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits>
Expand Down
6 changes: 3 additions & 3 deletions src/node_crypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
#include "util-inl.h"
#include "v8.h"

#include <errno.h>
#include <limits.h> // INT_MAX
#include <string.h>
#include <cerrno>
#include <climits> // INT_MAX
#include <cstring>

#include <algorithm>
#include <memory>
Expand Down
4 changes: 2 additions & 2 deletions src/node_crypto_bio.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
#include "node_crypto_bio.h"
#include "openssl/bio.h"
#include "util-inl.h"
#include <limits.h>
#include <string.h>
#include <climits>
#include <cstring>

namespace node {
namespace crypto {
Expand Down
4 changes: 2 additions & 2 deletions src/node_crypto_clienthello.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include <stddef.h> // size_t
#include <stdint.h>
#include <cstddef> // size_t
#include <cstdint>

namespace node {
namespace crypto {
Expand Down
2 changes: 1 addition & 1 deletion src/node_dtrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

#include "node_errors.h"

#include <string.h>
#include <cstring>

namespace node {

Expand Down
4 changes: 2 additions & 2 deletions src/node_errors.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include <errno.h>
#include <stdarg.h>
#include <cerrno>
#include <cstdarg>

#include "node_errors.h"
#include "node_internals.h"
Expand Down
6 changes: 3 additions & 3 deletions src/node_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <errno.h>
#include <limits.h>
#include <cstring>
#include <cerrno>
#include <climits>

#if defined(__MINGW32__) || defined(_MSC_VER)
# include <io.h>
Expand Down
2 changes: 1 addition & 1 deletion src/node_http2.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

// FIXME(joyeecheung): nghttp2.h needs stdint.h to compile on Windows
#include <stdint.h>
#include <cstdint>
#include "nghttp2/nghttp2.h"

#include "node_http2_state.h"
Expand Down
4 changes: 2 additions & 2 deletions src/node_http_parser_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
#include "util-inl.h"
#include "v8.h"

#include <stdlib.h> // free()
#include <string.h> // strdup(), strchr()
#include <cstdlib> // free()
#include <cstring> // strdup(), strchr()

#include "http_parser_adaptor.h"

Expand Down
4 changes: 2 additions & 2 deletions src/node_internals.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
#include "uv.h"
#include "v8.h"

#include <stdint.h>
#include <stdlib.h>
#include <cstdint>
#include <cstdlib>

#include <string>
#include <vector>
Expand Down
2 changes: 1 addition & 1 deletion src/node_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

#include "node.h"
#include <stdio.h>
#include <cstdio>

#ifdef _WIN32
#include <windows.h>
Expand Down
2 changes: 1 addition & 1 deletion src/node_options.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <errno.h>
#include <cerrno>
#include "env-inl.h"
#include "node_binding.h"
#include "node_options-inl.h"
Expand Down
6 changes: 3 additions & 3 deletions src/node_os.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
#include "util.h"

#include <array>
#include <errno.h>
#include <string.h>
#include <cerrno>
#include <cstring>

#ifdef __MINGW32__
# include <io.h>
#endif // __MINGW32__

#ifdef __POSIX__
# include <limits.h> // PATH_MAX on Solaris.
# include <climits> // PATH_MAX on Solaris.
# include <unistd.h> // gethostname, sysconf
#endif // __POSIX__

Expand Down
2 changes: 1 addition & 1 deletion src/node_process_events.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <stdarg.h>
#include <cstdarg>

#include "env-inl.h"
#include "node_process.h"
Expand Down
4 changes: 2 additions & 2 deletions src/node_process_methods.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "inspector_io.h"
#endif

#include <limits.h> // PATH_MAX
#include <stdio.h>
#include <climits> // PATH_MAX
#include <cstdio>

#if defined(_MSC_VER)
#include <direct.h>
Expand Down
2 changes: 1 addition & 1 deletion src/node_process_object.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <limits.h> // PATH_MAX
#include <climits> // PATH_MAX

#include "env-inl.h"
#include "node_internals.h"
Expand Down
6 changes: 3 additions & 3 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
#endif
#include <cxxabi.h>
#include <dlfcn.h>
#include <inttypes.h>
#include <cinttypes>
#endif

#include <fcntl.h>
#include <string.h>
#include <time.h>
#include <cstring>
#include <ctime>
#include <iomanip>

#ifndef _MSC_VER
Expand Down
4 changes: 2 additions & 2 deletions src/node_report.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
#include <vector>
#include "v8.h"

#include <stdio.h>
#include <stdlib.h>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <sstream>
Expand Down
4 changes: 2 additions & 2 deletions src/node_stat_watcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
#include "node_file.h"
#include "util.h"

#include <string.h>
#include <stdlib.h>
#include <cstring>
#include <cstdlib>

namespace node {

Expand Down
Loading