Skip to content

Commit

Permalink
clang-tidy: modernize-use-using (envoyproxy#7355)
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Argueta <dereka@pinterest.com>
  • Loading branch information
derekargueta authored and mattklein123 committed Jun 21, 2019
1 parent 4b76a2f commit cad2e18
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Checks: 'clang-diagnostic-*,clang-analyzer-*,abseil-*,bugprone-*,modernize-*,performance-*,readability-redundant-*,readability-braces-around-statements,readability-container-size-empty'

#TODO(lizan): grow this list, fix possible warnings and make more checks as error
WarningsAsErrors: 'bugprone-assert-side-effect,modernize-make-shared,modernize-make-unique,readability-redundant-smartptr-get,readability-braces-around-statements,readability-redundant-string-cstr,bugprone-use-after-move,readability-container-size-empty,performance-faster-string-find,performance-for-range-copy'
WarningsAsErrors: 'bugprone-assert-side-effect,bugprone-use-after-move,modernize-make-shared,modernize-make-unique,modernize-use-using,performance-faster-string-find,performance-for-range-copy,readability-braces-around-statements,readability-container-size-empty,readability-redundant-smartptr-get,readability-redundant-string-cstr'

CheckOptions:
- key: bugprone-assert-side-effect.AssertMacros
Expand Down
2 changes: 1 addition & 1 deletion source/common/http/header_map_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class HeaderMapImpl : public HeaderMap, NonCopyable {
const LowerCaseString* key_;
};

typedef StaticLookupResponse (*EntryCb)(HeaderMapImpl&);
using EntryCb = StaticLookupResponse (*)(HeaderMapImpl&);

/**
* This is the static lookup table that is used to determine whether a header is one of the O(1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RegionProvider {
virtual absl::optional<std::string> getRegion() PURE;
};

typedef std::shared_ptr<RegionProvider> RegionProviderSharedPtr;
using RegionProviderSharedPtr = std::shared_ptr<RegionProvider>;

} // namespace Aws
} // namespace Common
Expand Down
8 changes: 4 additions & 4 deletions source/extensions/filters/http/tap/tap_config_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ class HttpPerRequestTapperImpl : public HttpPerRequestTapper, Logger::Loggable<L
bool onDestroyLog() override;

private:
typedef envoy::data::tap::v2alpha::Body* (
envoy::data::tap::v2alpha::HttpStreamedTraceSegment::*MutableBodyChunk)();
typedef envoy::data::tap::v2alpha::HttpBufferedTrace::Message* (
envoy::data::tap::v2alpha::HttpBufferedTrace::*MutableMessage)();
using MutableBodyChunk =
envoy::data::tap::v2alpha::Body* (envoy::data::tap::v2alpha::HttpStreamedTraceSegment::*)();
using MutableMessage = envoy::data::tap::v2alpha::HttpBufferedTrace::Message* (
envoy::data::tap::v2alpha::HttpBufferedTrace::*)();

void onBody(const Buffer::Instance& data,
Extensions::Common::Tap::TraceWrapperPtr& buffered_streamed_body,
Expand Down
8 changes: 4 additions & 4 deletions test/common/http/http2/metadata_encoder_decoder_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,18 @@ namespace {
static const uint64_t STREAM_ID = 1;

// The buffer stores data sent by encoder and received by decoder.
typedef struct {
struct TestBuffer {
uint8_t buf[1024 * 1024] = {0};
size_t length = 0;
} TestBuffer;
};

// The application data structure passes to nghttp2 session.
typedef struct {
struct UserData {
MetadataEncoder* encoder;
MetadataDecoder* decoder;
// Stores data sent by encoder and received by the decoder.
TestBuffer* output_buffer;
} UserData;
};

// Nghttp2 callback function for sending extension frame.
static ssize_t pack_extension_callback(nghttp2_session* session, uint8_t* buf, size_t len,
Expand Down
2 changes: 1 addition & 1 deletion test/test_common/utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ class TestUtility {

return true;
}
typedef std::list<std::unique_ptr<const Protobuf::Message>> ProtoList;
using ProtoList = std::list<std::unique_ptr<const Protobuf::Message>>;
// Iterate through using protoEqual as ignore_ordering is true, and fields
// in the sub-protos may also be out of order.
ProtoList lhs_list =
Expand Down

0 comments on commit cad2e18

Please sign in to comment.