Merge "Fix/suppress androidfw google-explicit-constructor warnings"

This commit is contained in:
Treehugger Robot
2019-01-14 20:21:49 +00:00
committed by Gerrit Code Review
10 changed files with 14 additions and 14 deletions

View File

@@ -51,7 +51,7 @@ class XmlAttributeFinder
class BagAttributeFinder
: public BackTrackingAttributeFinder<BagAttributeFinder, const ResolvedBag::Entry*> {
public:
BagAttributeFinder(const ResolvedBag* bag)
explicit BagAttributeFinder(const ResolvedBag* bag)
: BackTrackingAttributeFinder(bag != nullptr ? bag->entries : nullptr,
bag != nullptr ? bag->entries + bag->entry_count : nullptr) {
}

View File

@@ -37,7 +37,7 @@ using namespace android;
// TODO: This can go away once the only remaining usage in aapt goes away.
class FileReader : public zip_archive::Reader {
public:
FileReader(FILE* fp) : Reader(), mFp(fp), mCurrentOffset(0) {
explicit FileReader(FILE* fp) : Reader(), mFp(fp), mCurrentOffset(0) {
}
bool ReadAtOffset(uint8_t* buf, size_t len, uint32_t offset) const {

View File

@@ -78,7 +78,7 @@ private:
class FileInfo {
public:
FileInfo(void) {}
FileInfo(const String8& path) // useful for e.g. svect.indexOf
explicit FileInfo(const String8& path) // useful for e.g. svect.indexOf
: mFileName(path), mFileType(kFileTypeUnknown)
{}
~FileInfo(void) {}

View File

@@ -67,7 +67,7 @@ struct FileRec {
class BackupDataWriter
{
public:
BackupDataWriter(int fd);
explicit BackupDataWriter(int fd);
// does not close fd
~BackupDataWriter();
@@ -104,7 +104,7 @@ private:
class BackupDataReader
{
public:
BackupDataReader(int fd);
explicit BackupDataReader(int fd);
// does not close fd
~BackupDataReader();

View File

@@ -82,7 +82,7 @@ struct ConfigDescription : public ResTable_config {
static void ApplyVersionForCompatibility(ConfigDescription* config);
ConfigDescription();
ConfigDescription(const android::ResTable_config& o); // NOLINT(implicit)
ConfigDescription(const android::ResTable_config& o); // NOLINT(google-explicit-constructor)
ConfigDescription(const ConfigDescription& o);
ConfigDescription(ConfigDescription&& o) noexcept;

View File

@@ -22,7 +22,7 @@ namespace android {
class DisplayEventDispatcher : public LooperCallback {
public:
DisplayEventDispatcher(const sp<Looper>& looper,
explicit DisplayEventDispatcher(const sp<Looper>& looper,
ISurfaceComposer::VsyncSource vsyncSource = ISurfaceComposer::eVsyncSourceApp);
status_t initialize();

View File

@@ -691,7 +691,7 @@ class ResXMLTree;
class ResXMLParser
{
public:
ResXMLParser(const ResXMLTree& tree);
explicit ResXMLParser(const ResXMLTree& tree);
enum event_code_t {
BAD_DOCUMENT = -1,
@@ -804,7 +804,7 @@ public:
* The tree stores a clone of the specified DynamicRefTable, so any changes to the original
* DynamicRefTable will not affect this tree after instantiation.
**/
ResXMLTree(const DynamicRefTable* dynamicRefTable);
explicit ResXMLTree(const DynamicRefTable* dynamicRefTable);
ResXMLTree();
~ResXMLTree();
@@ -1803,7 +1803,7 @@ public:
class Theme {
public:
Theme(const ResTable& table);
explicit Theme(const ResTable& table);
~Theme();
inline const ResTable& getResTable() const { return mTable; }

View File

@@ -44,8 +44,8 @@ class BasicStringPiece {
BasicStringPiece();
BasicStringPiece(const BasicStringPiece<TChar>& str);
BasicStringPiece(const std::basic_string<TChar>& str); // NOLINT(implicit)
BasicStringPiece(const TChar* str); // NOLINT(implicit)
BasicStringPiece(const std::basic_string<TChar>& str); // NOLINT(google-explicit-constructor)
BasicStringPiece(const TChar* str); // NOLINT(google-explicit-constructor)
BasicStringPiece(const TChar* str, size_t len);
BasicStringPiece<TChar>& operator=(const BasicStringPiece<TChar>& rhs);

View File

@@ -23,7 +23,7 @@
namespace android {
struct TypeVariant {
TypeVariant(const ResTable_type* data);
explicit TypeVariant(const ResTable_type* data);
class iterator {
public:

View File

@@ -46,7 +46,7 @@ class unique_cptr {
using pointer = typename std::add_pointer<T>::type;
constexpr unique_cptr() : ptr_(nullptr) {}
constexpr unique_cptr(std::nullptr_t) : ptr_(nullptr) {}
constexpr explicit unique_cptr(std::nullptr_t) : ptr_(nullptr) {}
explicit unique_cptr(pointer ptr) : ptr_(ptr) {}
unique_cptr(unique_cptr&& o) noexcept : ptr_(o.ptr_) { o.ptr_ = nullptr; }