Add -Wextra-semi.
The headers fail to compile when included
in libhidl, because libhidl has -Wextra-semi.
I decided to clean them up and add -Wextra-semi
for all files for libvintf.
Test: builds
Change-Id: Ida1ed6d3855e582a5c09bc60128dd8c4cfd4210a
diff --git a/Android.bp b/Android.bp
index 3caf684..fdf71ee 100644
--- a/Android.bp
+++ b/Android.bp
@@ -21,6 +21,7 @@
cflags: [
"-Wall",
"-Werror",
+ "-Wextra-semi",
],
target: {
diff --git a/include/vintf/CompatibilityMatrix.h b/include/vintf/CompatibilityMatrix.h
index 5c1d496..512d278 100644
--- a/include/vintf/CompatibilityMatrix.h
+++ b/include/vintf/CompatibilityMatrix.h
@@ -43,7 +43,7 @@
// Compatibility matrix defines what hardware does the framework requires.
struct CompatibilityMatrix : public HalGroup<MatrixHal>, public XmlFileGroup<MatrixXmlFile> {
// Create a framework compatibility matrix.
- CompatibilityMatrix() : mType(SchemaType::FRAMEWORK) {};
+ CompatibilityMatrix() : mType(SchemaType::FRAMEWORK) {}
SchemaType type() const;
Level level() const;
diff --git a/include/vintf/FileSystem.h b/include/vintf/FileSystem.h
index 6fd375b..5a98a6e 100644
--- a/include/vintf/FileSystem.h
+++ b/include/vintf/FileSystem.h
@@ -34,7 +34,7 @@
// This class can be used to create a mock for overriding.
class FileSystem {
public:
- virtual ~FileSystem(){};
+ virtual ~FileSystem() {}
// Return NAME_NOT_FOUND if file is not found,
// OK if file is retrieved and written to "fetched".
virtual status_t fetch(const std::string& path, std::string* fetched,
diff --git a/include/vintf/MapValueIterator.h b/include/vintf/MapValueIterator.h
index 355a879..b44c661 100644
--- a/include/vintf/MapValueIterator.h
+++ b/include/vintf/MapValueIterator.h
@@ -52,7 +52,7 @@
inline IteratorImpl &operator++() {
mIter++;
return *this;
- };
+ }
inline IteratorImpl operator++(int) {
IteratorImpl i = *this;
mIter++;
diff --git a/include/vintf/VersionRange.h b/include/vintf/VersionRange.h
index 6c5690b..570d163 100644
--- a/include/vintf/VersionRange.h
+++ b/include/vintf/VersionRange.h
@@ -30,14 +30,13 @@
// A version range with the same major version, e.g. 2.3-7
struct VersionRange {
- VersionRange() : VersionRange(0u, 0u, 0u) {};
- VersionRange(size_t mjV, size_t miV)
- : VersionRange(mjV, miV, miV) {};
+ VersionRange() : VersionRange(0u, 0u, 0u) {}
+ VersionRange(size_t mjV, size_t miV) : VersionRange(mjV, miV, miV) {}
VersionRange(size_t mjV, size_t miM, size_t mxM)
: majorVer(mjV), minMinor(miM), maxMinor(mxM) {}
inline Version minVer() const { return Version(majorVer, minMinor); }
inline Version maxVer() const { return Version(majorVer, maxMinor); }
- inline bool isSingleVersion() const { return minMinor == maxMinor; };
+ inline bool isSingleVersion() const { return minMinor == maxMinor; }
inline bool operator==(const VersionRange &other) const {
return majorVer == other.majorVer
diff --git a/include/vintf/Vndk.h b/include/vintf/Vndk.h
index 05fcac9..53998f4 100644
--- a/include/vintf/Vndk.h
+++ b/include/vintf/Vndk.h
@@ -33,7 +33,7 @@
VndkVersionRange(size_t s, size_t v, size_t pi, size_t pa)
: sdk(s), vndk(v), patchMin(pi), patchMax(pa) {}
- inline bool isSingleVersion() const { return patchMin == patchMax; };
+ inline bool isSingleVersion() const { return patchMin == patchMax; }
size_t sdk;
size_t vndk;
diff --git a/parse_xml.cpp b/parse_xml.cpp
index 8ccf9b1..fbac04e 100644
--- a/parse_xml.cpp
+++ b/parse_xml.cpp
@@ -393,8 +393,9 @@
virtual bool buildObject(Object* object, NodeType* root, std::string* error) const override {
return this->parseText(root, object, error);
}
- virtual std::string elementName() const { return mElementName; };
-private:
+ virtual std::string elementName() const { return mElementName; }
+
+ private:
std::string mElementName;
};