diff options
author | Yi Kong <yikong@google.com> | 2019-04-01 09:39:03 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2019-04-01 09:39:03 -0700 |
commit | abc414c0dd4f2d98c2737865cfcb3e608b89196e (patch) | |
tree | 362ff2e49a4a7e8fb057658c96a9d8bac00f2645 | |
parent | 8123a1d0010fd57467fb33541055ec0325090b18 (diff) | |
parent | ef9d233b4886bc9d677b5f3296b3dd9b0acc35e7 (diff) | |
download | aidl-abc414c0dd4f2d98c2737865cfcb3e608b89196e.tar.gz |
Modernise code to use override specifier am: de138911c8
am: ef9d233b48
Change-Id: Ifdb51337efe2535486bc3cf6a42374dd5696caec
-rw-r--r-- | code_writer.cpp | 2 | ||||
-rw-r--r-- | generate_java_binder.cpp | 4 | ||||
-rw-r--r-- | line_reader.cpp | 4 | ||||
-rw-r--r-- | tests/end_to_end_tests.cpp | 2 | ||||
-rw-r--r-- | tests/fake_io_delegate.cpp | 2 | ||||
-rw-r--r-- | type_cpp.cpp | 28 |
6 files changed, 21 insertions, 21 deletions
diff --git a/code_writer.cpp b/code_writer.cpp index 1fe5e835..6d54d405 100644 --- a/code_writer.cpp +++ b/code_writer.cpp @@ -117,7 +117,7 @@ CodeWriterPtr CodeWriter::ForString(std::string* buf) { public: StringCodeWriter(std::string* buf) : CodeWriter(std::unique_ptr<std::ostream>(new std::stringstream())), buf_(buf) {} - ~StringCodeWriter() { Close(); } + ~StringCodeWriter() override { Close(); } bool Close() override { // extract whats written to the stringstream to the external buffer. // we are sure that ostream_ is indeed stringstream. diff --git a/generate_java_binder.cpp b/generate_java_binder.cpp index b50d500a..d9764bed 100644 --- a/generate_java_binder.cpp +++ b/generate_java_binder.cpp @@ -72,7 +72,7 @@ class StubClass : public Class { public: StubClass(const Type* type, const InterfaceType* interfaceType, JavaTypeNamespace* types, const Options& options); - virtual ~StubClass() = default; + ~StubClass() override = default; Variable* transact_code; Variable* transact_data; @@ -307,7 +307,7 @@ class ProxyClass : public Class { public: ProxyClass(const JavaTypeNamespace* types, const Type* type, const InterfaceType* interfaceType, const Options& options); - virtual ~ProxyClass(); + ~ProxyClass() override; Variable* mRemote; }; diff --git a/line_reader.cpp b/line_reader.cpp index 0bcaa1db..5e076d8e 100644 --- a/line_reader.cpp +++ b/line_reader.cpp @@ -30,7 +30,7 @@ namespace aidl { class FileLineReader : public LineReader { public: FileLineReader() = default; - virtual ~FileLineReader() { + ~FileLineReader() override { input_stream_.close(); } @@ -57,7 +57,7 @@ class FileLineReader : public LineReader { class MemoryLineReader : public LineReader { public: explicit MemoryLineReader(const string& contents) : input_stream_(contents) {} - virtual ~MemoryLineReader() = default; + ~MemoryLineReader() override = default; bool ReadLine(string* line) override { if (!input_stream_.good()) { diff --git a/tests/end_to_end_tests.cpp b/tests/end_to_end_tests.cpp index d3dc27c9..7602a868 100644 --- a/tests/end_to_end_tests.cpp +++ b/tests/end_to_end_tests.cpp @@ -38,7 +38,7 @@ namespace aidl { class EndToEndTest : public ::testing::Test { protected: - virtual void SetUp() { + void SetUp() override { } void AddStubAidls(const char** parcelables, const char** interfaces, diff --git a/tests/fake_io_delegate.cpp b/tests/fake_io_delegate.cpp index 9456bb88..b63e1e3f 100644 --- a/tests/fake_io_delegate.cpp +++ b/tests/fake_io_delegate.cpp @@ -37,7 +37,7 @@ namespace test { class BrokenCodeWriter : public CodeWriter { bool Write(const char* /* format */, ...) override { return true; } bool Close() override { return false; } - virtual ~BrokenCodeWriter() = default; + ~BrokenCodeWriter() override = default; }; // class BrokenCodeWriter unique_ptr<string> FakeIoDelegate::GetFileContents( diff --git a/type_cpp.cpp b/type_cpp.cpp index 58cc119a..c3cab98e 100644 --- a/type_cpp.cpp +++ b/type_cpp.cpp @@ -47,7 +47,7 @@ class VoidType : public Type { public: VoidType() : Type(ValidatableType::KIND_BUILT_IN, kNoPackage, "void", {}, "void", kNoValidMethod, kNoValidMethod) {} - virtual ~VoidType() = default; + ~VoidType() override = default; bool CanWriteToParcel() const override { return false; } }; // class VoidType @@ -117,7 +117,7 @@ class PrimitiveType : public Type { read_array_method, write_array_method, false)) {} - virtual ~PrimitiveType() = default; + ~PrimitiveType() override = default; bool IsCppPrimitive() const override { return true; } private: @@ -137,7 +137,7 @@ class ByteType : public Type { "readByteVector", "writeByteVector", false)) {} - virtual ~ByteType() = default; + ~ByteType() override = default; bool IsCppPrimitive() const override { return true; } private: @@ -157,7 +157,7 @@ class BinderType : public Type { new BinderType(interface, src_file_name, kNoNullableType, "readNullableStrongBinder"), "readStrongBinder") {} - virtual ~BinderType() = default; + ~BinderType() override = default; string WriteCast(const string& val) const override { return write_cast_ + "(" + val + ")"; @@ -198,7 +198,7 @@ class NullableParcelableType : public Type { : Type(ValidatableType::KIND_PARCELABLE, parcelable.GetPackage(), parcelable.GetName(), {cpp_header}, GetCppName(parcelable), "readParcelable", "writeNullableParcelable", kNoArrayType, kNoNullableType, src_file_name) {} - virtual ~NullableParcelableType() = default; + ~NullableParcelableType() override = default; private: static string GetCppName(const AidlParcelable& parcelable) { @@ -218,7 +218,7 @@ class ParcelableType : public Type { GetCppName(parcelable), "readParcelableVector", "writeParcelableVector", false, src_file_name), new NullableParcelableType(parcelable, cpp_header, src_file_name), src_file_name) {} - virtual ~ParcelableType() = default; + ~ParcelableType() override = default; private: static string GetCppName(const AidlParcelable& parcelable) { @@ -235,7 +235,7 @@ class NullableMap : public Type { {"binder/Map.h", "binder/Value.h"}, "::std::unique_ptr<::android::binder::Map>", "readNullableMap", "writeNullableMap") {} - virtual ~NullableMap() = default; + ~NullableMap() override = default; }; @@ -249,7 +249,7 @@ class MapType : public Type { "readMap", "writeMap", kNoArrayType, new NullableMap() ) {} - virtual ~MapType() = default; + ~MapType() override = default; private: DISALLOW_COPY_AND_ASSIGN(MapType); @@ -263,7 +263,7 @@ class NullableStringListType : public Type { {"utils/String16.h", "memory", "vector"}, "::std::unique_ptr<::std::vector<std::unique_ptr<::android::String16>>>", "readString16Vector", "writeString16Vector") {} - virtual ~NullableStringListType() = default; + ~NullableStringListType() override = default; private: DISALLOW_COPY_AND_ASSIGN(NullableStringListType); @@ -278,7 +278,7 @@ class StringListType : public Type { "::std::vector<::android::String16>", "readString16Vector", "writeString16Vector", kNoArrayType, new NullableStringListType()) {} - virtual ~StringListType() = default; + ~StringListType() override = default; private: DISALLOW_COPY_AND_ASSIGN(StringListType); @@ -292,7 +292,7 @@ class NullableUtf8InCppStringListType : public Type { {"memory", "string", "vector"}, "::std::unique_ptr<::std::vector<std::unique_ptr<::std::string>>>", "readUtf8VectorFromUtf16Vector", "writeUtf8VectorAsUtf16Vector") {} - virtual ~NullableUtf8InCppStringListType() = default; + ~NullableUtf8InCppStringListType() override = default; private: DISALLOW_COPY_AND_ASSIGN(NullableUtf8InCppStringListType); @@ -307,7 +307,7 @@ class Utf8InCppStringListType : public Type { "::std::vector<::std::string>", "readUtf8VectorFromUtf16Vector", "writeUtf8VectorAsUtf16Vector", kNoArrayType, new NullableUtf8InCppStringListType()) {} - virtual ~Utf8InCppStringListType() = default; + ~Utf8InCppStringListType() override = default; private: DISALLOW_COPY_AND_ASSIGN(Utf8InCppStringListType); @@ -320,7 +320,7 @@ class NullableBinderListType : public Type { "List<android.os.IBinder>", {"binder/IBinder.h", "vector"}, "::std::unique_ptr<::std::vector<::android::sp<::android::IBinder>>>", "readStrongBinderVector", "writeStrongBinderVector") {} - virtual ~NullableBinderListType() = default; + ~NullableBinderListType() override = default; private: DISALLOW_COPY_AND_ASSIGN(NullableBinderListType); @@ -334,7 +334,7 @@ class BinderListType : public Type { "::std::vector<::android::sp<::android::IBinder>>", "readStrongBinderVector", "writeStrongBinderVector", kNoArrayType, new NullableBinderListType()) {} - virtual ~BinderListType() = default; + ~BinderListType() override = default; private: DISALLOW_COPY_AND_ASSIGN(BinderListType); |