This is an automated email from the ASF dual-hosted git repository. alexey pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/kudu.git
commit bb5129444162e66ecaafe1f3396df16f11e10dbb Author: Alexey Serbin <[email protected]> AuthorDate: Wed Jun 16 19:32:39 2021 -0700 [iwyu] modernize stdlib/stdint header files This patch changes <stdlib.h> and <stdint.h> to <cstdlib> and <cstdint> correspondingly in the list of header files. I didn't touch files in src/kudu/gutil in this context since those are close to be something like thirdparty imports. This changelist doesn't contain any functional changes. Change-Id: I49d2fb94fa033e71a4396b67b155512fb4e60932 Reviewed-on: http://gerrit.cloudera.org:8080/17602 Reviewed-by: Andrew Wong <[email protected]> Tested-by: Alexey Serbin <[email protected]> --- src/kudu/cfile/bitshuffle_arch_wrapper.cc | 2 +- src/kudu/cfile/bitshuffle_arch_wrapper.h | 4 ++-- src/kudu/cfile/block_encodings.h | 3 ++- src/kudu/client/resource_metrics-internal.h | 2 +- src/kudu/client/stubs.h | 3 +-- src/kudu/client/value.h | 2 ++ src/kudu/client/write_op.h | 2 ++ src/kudu/common/iterator_stats.h | 2 +- src/kudu/fs/block_manager-test.cc | 3 +-- src/kudu/integration-tests/registration-test.cc | 3 +-- src/kudu/integration-tests/ts_tablet_manager-itest.cc | 3 +-- src/kudu/subprocess/subprocess_protocol.cc | 6 +++--- src/kudu/tserver/tablet_copy_client-test.cc | 3 +-- src/kudu/tserver/tablet_server-test.cc | 2 +- src/kudu/tserver/tablet_server_authorization-test.cc | 6 +++--- src/kudu/util/bit-util.h | 5 ++--- src/kudu/util/crc.h | 4 ++-- src/kudu/util/decimal_util.h | 2 +- src/kudu/util/jsonwriter-test.cc | 2 +- src/kudu/util/malloc.h | 2 +- src/kudu/util/safe_math-test.cc | 2 +- 21 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/kudu/cfile/bitshuffle_arch_wrapper.cc b/src/kudu/cfile/bitshuffle_arch_wrapper.cc index 8d21f87..1889a4c 100644 --- a/src/kudu/cfile/bitshuffle_arch_wrapper.cc +++ b/src/kudu/cfile/bitshuffle_arch_wrapper.cc @@ -17,7 +17,7 @@ #include "kudu/cfile/bitshuffle_arch_wrapper.h" -#include <stdint.h> +#include <cstdint> // Include the bitshuffle header once to get the default (non-AVX2) // symbols. diff --git a/src/kudu/cfile/bitshuffle_arch_wrapper.h b/src/kudu/cfile/bitshuffle_arch_wrapper.h index cf5fd73..4a30ab9 100644 --- a/src/kudu/cfile/bitshuffle_arch_wrapper.h +++ b/src/kudu/cfile/bitshuffle_arch_wrapper.h @@ -16,8 +16,8 @@ // under the License. #pragma once -#include <stddef.h> -#include <stdint.h> +#include <cstddef> +#include <cstdint> // This namespace has wrappers for the Bitshuffle library which do runtime dispatch to // either AVX2-accelerated or regular SSE2 implementations based on the available CPU. diff --git a/src/kudu/cfile/block_encodings.h b/src/kudu/cfile/block_encodings.h index 08a9e96..9f7c56a 100644 --- a/src/kudu/cfile/block_encodings.h +++ b/src/kudu/cfile/block_encodings.h @@ -19,8 +19,9 @@ #define KUDU_CFILE_BLOCK_ENCODINGS_H #include <algorithm> +#include <cstdint> #include <vector> -#include <stdint.h> + #include <glog/logging.h> #include "kudu/common/column_materialization_context.h" diff --git a/src/kudu/client/resource_metrics-internal.h b/src/kudu/client/resource_metrics-internal.h index 498e292..2867a9d 100644 --- a/src/kudu/client/resource_metrics-internal.h +++ b/src/kudu/client/resource_metrics-internal.h @@ -17,10 +17,10 @@ #ifndef KUDU_CLIENT_RESOURCE_METRICS_INTERNAL_H #define KUDU_CLIENT_RESOURCE_METRICS_INTERNAL_H +#include <cstdint> #include <list> #include <map> #include <mutex> -#include <stdint.h> #include <set> #include <string> diff --git a/src/kudu/client/stubs.h b/src/kudu/client/stubs.h index 0040b44..798b206 100644 --- a/src/kudu/client/stubs.h +++ b/src/kudu/client/stubs.h @@ -17,8 +17,7 @@ #ifndef KUDU_CLIENT_STUBS_H #define KUDU_CLIENT_STUBS_H -#include <stdlib.h> // for exit() - +#include <cstdlib> // for exit() #include <iostream> // diff --git a/src/kudu/client/value.h b/src/kudu/client/value.h index 7791555..6cb0b68 100644 --- a/src/kudu/client/value.h +++ b/src/kudu/client/value.h @@ -17,6 +17,8 @@ #ifndef KUDU_CLIENT_VALUE_H #define KUDU_CLIENT_VALUE_H +// NOTE: using stdint.h instead of cstdint because this file is supposed +// to be processed by a compiler lacking C++11 support. #include <stdint.h> #ifdef KUDU_HEADERS_NO_STUBS diff --git a/src/kudu/client/write_op.h b/src/kudu/client/write_op.h index d639188..9420cea 100644 --- a/src/kudu/client/write_op.h +++ b/src/kudu/client/write_op.h @@ -17,6 +17,8 @@ #ifndef KUDU_CLIENT_WRITE_OP_H #define KUDU_CLIENT_WRITE_OP_H +// NOTE: using stdint.h instead of cstdint because this file is supposed +// to be processed by a compiler lacking C++11 support. #include <stdint.h> // IWYU pragma: no_include <memory> diff --git a/src/kudu/common/iterator_stats.h b/src/kudu/common/iterator_stats.h index 2197423..12c0f49 100644 --- a/src/kudu/common/iterator_stats.h +++ b/src/kudu/common/iterator_stats.h @@ -17,7 +17,7 @@ #ifndef KUDU_COMMON_ITERATOR_STATS_H #define KUDU_COMMON_ITERATOR_STATS_H -#include <stdint.h> +#include <cstdint> #include <string> namespace kudu { diff --git a/src/kudu/fs/block_manager-test.cc b/src/kudu/fs/block_manager-test.cc index 588f091..a861a2c 100644 --- a/src/kudu/fs/block_manager-test.cc +++ b/src/kudu/fs/block_manager-test.cc @@ -17,11 +17,10 @@ #include "kudu/fs/block_manager.h" -#include <stdlib.h> - #include <algorithm> #include <cstddef> #include <cstdint> +#include <cstdlib> #include <initializer_list> #include <memory> #include <ostream> diff --git a/src/kudu/integration-tests/registration-test.cc b/src/kudu/integration-tests/registration-test.cc index 4241bd6..94698d5 100644 --- a/src/kudu/integration-tests/registration-test.cc +++ b/src/kudu/integration-tests/registration-test.cc @@ -15,9 +15,8 @@ // specific language governing permissions and limitations // under the License. -#include <stdint.h> - #include <algorithm> +#include <cstdint> #include <functional> #include <memory> #include <ostream> diff --git a/src/kudu/integration-tests/ts_tablet_manager-itest.cc b/src/kudu/integration-tests/ts_tablet_manager-itest.cc index 018f933..1aa0b39 100644 --- a/src/kudu/integration-tests/ts_tablet_manager-itest.cc +++ b/src/kudu/integration-tests/ts_tablet_manager-itest.cc @@ -15,8 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include <stdint.h> - +#include <cstdint> #include <cstdlib> #include <functional> #include <limits> diff --git a/src/kudu/subprocess/subprocess_protocol.cc b/src/kudu/subprocess/subprocess_protocol.cc index fdda541..e131dc6 100644 --- a/src/kudu/subprocess/subprocess_protocol.cc +++ b/src/kudu/subprocess/subprocess_protocol.cc @@ -17,11 +17,11 @@ #include "kudu/subprocess/subprocess_protocol.h" -#include <errno.h> -#include <stddef.h> -#include <stdint.h> #include <unistd.h> +#include <cerrno> +#include <cstddef> +#include <cstdint> #include <ostream> #include <string> diff --git a/src/kudu/tserver/tablet_copy_client-test.cc b/src/kudu/tserver/tablet_copy_client-test.cc index ae49633..faa10b0 100644 --- a/src/kudu/tserver/tablet_copy_client-test.cc +++ b/src/kudu/tserver/tablet_copy_client-test.cc @@ -16,9 +16,8 @@ // under the License. #include "kudu/tserver/tablet_copy_client.h" -#include <stdlib.h> - #include <cstdint> +#include <cstdlib> #include <limits> #include <memory> #include <ostream> diff --git a/src/kudu/tserver/tablet_server-test.cc b/src/kudu/tserver/tablet_server-test.cc index 6538e35..3a9e360 100644 --- a/src/kudu/tserver/tablet_server-test.cc +++ b/src/kudu/tserver/tablet_server-test.cc @@ -17,12 +17,12 @@ #include "kudu/tserver/tablet_server.h" -#include <stdlib.h> #include <unistd.h> #include <algorithm> #include <atomic> #include <cstdint> +#include <cstdlib> #include <functional> #include <initializer_list> #include <map> diff --git a/src/kudu/tserver/tablet_server_authorization-test.cc b/src/kudu/tserver/tablet_server_authorization-test.cc index 469146a..23723d4 100644 --- a/src/kudu/tserver/tablet_server_authorization-test.cc +++ b/src/kudu/tserver/tablet_server_authorization-test.cc @@ -15,10 +15,10 @@ // specific language governing permissions and limitations // under the License. -#include <stdint.h> -#include <stdlib.h> #include <algorithm> +#include <cstdint> +#include <cstdlib> #include <functional> #include <memory> #include <ostream> @@ -38,11 +38,11 @@ #include "kudu/common/common.pb.h" #include "kudu/common/encoded_key.h" #include "kudu/common/row_operations.h" +#include "kudu/common/row_operations.pb.h" #include "kudu/common/schema.h" #include "kudu/common/types.h" #include "kudu/common/wire_protocol-test-util.h" #include "kudu/common/wire_protocol.h" -#include "kudu/common/wire_protocol.pb.h" #include "kudu/gutil/map-util.h" #include "kudu/gutil/ref_counted.h" #include "kudu/gutil/strings/join.h" diff --git a/src/kudu/util/bit-util.h b/src/kudu/util/bit-util.h index 5f36887..25bf41c 100644 --- a/src/kudu/util/bit-util.h +++ b/src/kudu/util/bit-util.h @@ -17,7 +17,8 @@ #ifndef IMPALA_BIT_UTIL_H #define IMPALA_BIT_UTIL_H -#include <stdint.h> +#include <cstdint> + #include "kudu/gutil/port.h" namespace kudu { @@ -48,8 +49,6 @@ class BitUtil { if (PREDICT_FALSE(num_bits >= 64)) return 0; return v >> num_bits; } - - }; } // namespace kudu diff --git a/src/kudu/util/crc.h b/src/kudu/util/crc.h index a5db4ea..e32ddec 100644 --- a/src/kudu/util/crc.h +++ b/src/kudu/util/crc.h @@ -17,8 +17,8 @@ #ifndef KUDU_UTIL_CRC_H_ #define KUDU_UTIL_CRC_H_ -#include <stdint.h> -#include <stdlib.h> +#include <cstdint> +#include <cstdlib> #include <crcutil/interface.h> diff --git a/src/kudu/util/decimal_util.h b/src/kudu/util/decimal_util.h index a465412..9afd66a 100644 --- a/src/kudu/util/decimal_util.h +++ b/src/kudu/util/decimal_util.h @@ -17,7 +17,7 @@ #pragma once -#include <stdint.h> +#include <cstdint> #include <string> #include "kudu/util/int128.h" diff --git a/src/kudu/util/jsonwriter-test.cc b/src/kudu/util/jsonwriter-test.cc index b9a1fdb..f266ae1 100644 --- a/src/kudu/util/jsonwriter-test.cc +++ b/src/kudu/util/jsonwriter-test.cc @@ -15,8 +15,8 @@ // specific language governing permissions and limitations // under the License. +#include <cstdint> #include <ostream> -#include <stdint.h> #include <string> #include <gflags/gflags.h> diff --git a/src/kudu/util/malloc.h b/src/kudu/util/malloc.h index e8a27c5..21cc2b1 100644 --- a/src/kudu/util/malloc.h +++ b/src/kudu/util/malloc.h @@ -17,7 +17,7 @@ #ifndef KUDU_UTIL_MALLOC_H #define KUDU_UTIL_MALLOC_H -#include <stdint.h> +#include <cstdint> namespace kudu { diff --git a/src/kudu/util/safe_math-test.cc b/src/kudu/util/safe_math-test.cc index d3a81c6..09daac2 100644 --- a/src/kudu/util/safe_math-test.cc +++ b/src/kudu/util/safe_math-test.cc @@ -15,7 +15,7 @@ // specific language governing permissions and limitations // under the License. -#include <stdint.h> +#include <cstdint> // Must come before gtest.h. #include "kudu/gutil/mathlimits.h"
