Add missing 'explicit's on single-argument constructors.
Change-Id: I1494df6e74ec16238971fb4346ba184eb61c37ab
diff --git a/src/assembler_arm.h b/src/assembler_arm.h
index bd5ed0b..f6be2b9 100644
--- a/src/assembler_arm.h
+++ b/src/assembler_arm.h
@@ -630,7 +630,7 @@
// Slowpath entered when Thread::Current()->_exception is non-null
class ArmExceptionSlowPath : public SlowPath {
public:
- ArmExceptionSlowPath(ArmManagedRegister scratch) : scratch_(scratch) {}
+ explicit ArmExceptionSlowPath(ArmManagedRegister scratch) : scratch_(scratch) {}
virtual void Emit(Assembler *sp_asm);
private:
const ArmManagedRegister scratch_;
diff --git a/src/class_linker.h b/src/class_linker.h
index 2a3e74d..3a44310 100644
--- a/src/class_linker.h
+++ b/src/class_linker.h
@@ -230,7 +230,7 @@
ObjectArray<Method>* methods, ObjectArray<ObjectArray<Class> >* throws);
private:
- ClassLinker(InternTable*);
+ explicit ClassLinker(InternTable*);
// Initialize class linker by bootstraping from dex files
void Init(const std::string& boot_class_path);
diff --git a/src/compiled_method.h b/src/compiled_method.h
index e228ca8..1a5c34d 100644
--- a/src/compiled_method.h
+++ b/src/compiled_method.h
@@ -70,7 +70,7 @@
class CompiledInvokeStub {
public:
- CompiledInvokeStub(std::vector<uint8_t>& code);
+ explicit CompiledInvokeStub(std::vector<uint8_t>& code);
~CompiledInvokeStub();
const std::vector<uint8_t>& GetCode() const;
private:
diff --git a/src/dex_file.cc b/src/dex_file.cc
index f3f2e28..d5c5e86 100644
--- a/src/dex_file.cc
+++ b/src/dex_file.cc
@@ -148,14 +148,14 @@
}
private:
- LockedFd(int fd) : fd_(fd) {}
+ explicit LockedFd(int fd) : fd_(fd) {}
int fd_;
};
class TmpFile {
public:
- TmpFile(const std::string name) : name_(name) {}
+ explicit TmpFile(const std::string& name) : name_(name) {}
~TmpFile() {
unlink(name_.c_str());
}
diff --git a/src/dex_file.h b/src/dex_file.h
index 7d3fb74..453b7c2 100644
--- a/src/dex_file.h
+++ b/src/dex_file.h
@@ -233,7 +233,7 @@
catch_all_ = false;
}
- CatchHandlerIterator(const byte* handler_data) {
+ explicit CatchHandlerIterator(const byte* handler_data) {
current_data_ = handler_data;
remaining_count_ = DecodeSignedLeb128(¤t_data_);
diff --git a/src/dex_instruction.h b/src/dex_instruction.h
index e08a1f7..2c1a397 100644
--- a/src/dex_instruction.h
+++ b/src/dex_instruction.h
@@ -99,7 +99,7 @@
uint32_t arg_[5]; /* vC/D/E/F/G in invoke or filled-new-array */
Code opcode_;
- DecodedInstruction(const Instruction* inst) {
+ explicit DecodedInstruction(const Instruction* inst) {
inst->Decode(vA_, vB_, vB_wide_, vC_, arg_);
opcode_ = inst->Opcode();
}
diff --git a/src/dex_verifier.h b/src/dex_verifier.h
index 96349a3..6012231 100644
--- a/src/dex_verifier.h
+++ b/src/dex_verifier.h
@@ -309,7 +309,7 @@
int num_entries_;
UniquePtr<UninitInstanceMapEntry[]> map_;
- UninitInstanceMap(int num_entries)
+ explicit UninitInstanceMap(int num_entries)
: num_entries_(num_entries),
map_(new UninitInstanceMapEntry[num_entries]()) {
}
diff --git a/src/jni_internal.h b/src/jni_internal.h
index 6f9b755..329a5af 100644
--- a/src/jni_internal.h
+++ b/src/jni_internal.h
@@ -172,7 +172,7 @@
// compiler
class ScopedJniEnvLocalRefState {
public:
- ScopedJniEnvLocalRefState(JNIEnvExt* env) : env_(env) {
+ explicit ScopedJniEnvLocalRefState(JNIEnvExt* env) : env_(env) {
saved_local_ref_cookie_ = env->local_ref_cookie;
env->local_ref_cookie = env->locals.GetSegmentState();
}
diff --git a/src/managed_register.h b/src/managed_register.h
index 5aa96e4..14f8b6c 100644
--- a/src/managed_register.h
+++ b/src/managed_register.h
@@ -44,7 +44,7 @@
static const int kNoRegister = -1;
ManagedRegister() : id_(kNoRegister) { }
- ManagedRegister(int reg_id) : id_(reg_id) { }
+ explicit ManagedRegister(int reg_id) : id_(reg_id) { }
int id_;
};
diff --git a/src/managed_register_arm.h b/src/managed_register_arm.h
index f25b2f4..1ec6198 100644
--- a/src/managed_register_arm.h
+++ b/src/managed_register_arm.h
@@ -236,7 +236,7 @@
friend class ManagedRegister;
- ArmManagedRegister(int reg_id) : ManagedRegister(reg_id) {}
+ explicit ArmManagedRegister(int reg_id) : ManagedRegister(reg_id) {}
static ArmManagedRegister FromRegId(int reg_id) {
ArmManagedRegister reg(reg_id);
diff --git a/src/managed_register_x86.h b/src/managed_register_x86.h
index 7c1f916..2640321 100644
--- a/src/managed_register_x86.h
+++ b/src/managed_register_x86.h
@@ -174,7 +174,7 @@
friend class ManagedRegister;
- X86ManagedRegister(int reg_id) : ManagedRegister(reg_id) {}
+ explicit X86ManagedRegister(int reg_id) : ManagedRegister(reg_id) {}
static X86ManagedRegister FromRegId(int reg_id) {
X86ManagedRegister reg(reg_id);
diff --git a/src/monitor.h b/src/monitor.h
index 1316532..459cb04 100644
--- a/src/monitor.h
+++ b/src/monitor.h
@@ -79,7 +79,7 @@
Object* GetObject();
private:
- Monitor(Object* obj);
+ explicit Monitor(Object* obj);
void AppendToWaitSet(Thread* thread);
void RemoveFromWaitSet(Thread* thread);
diff --git a/src/mutex.h b/src/mutex.h
index eb90565..a276b5d 100644
--- a/src/mutex.h
+++ b/src/mutex.h
@@ -81,7 +81,7 @@
class ConditionVariable {
public:
- ConditionVariable(const std::string& name);
+ explicit ConditionVariable(const std::string& name);
~ConditionVariable();
void Broadcast();
diff --git a/src/oat_file.h b/src/oat_file.h
index 1d3367c..e83b294 100644
--- a/src/oat_file.h
+++ b/src/oat_file.h
@@ -126,7 +126,7 @@
}
private:
- OatFile(const std::string& filename);
+ explicit OatFile(const std::string& filename);
bool Read(const std::string& filename, byte* requested_base);
const byte* GetBase() const;
diff --git a/src/oat_writer.h b/src/oat_writer.h
index a33ffc7..858a208 100644
--- a/src/oat_writer.h
+++ b/src/oat_writer.h
@@ -96,7 +96,7 @@
class OatDexFile {
public:
- OatDexFile(const DexFile& dex_file);
+ explicit OatDexFile(const DexFile& dex_file);
size_t SizeOf() const;
void UpdateChecksum(OatHeader& oat_header) const;
bool Write(File* file) const;
@@ -113,7 +113,7 @@
class OatClasses {
public:
- OatClasses(const DexFile& dex_file);
+ explicit OatClasses(const DexFile& dex_file);
size_t SizeOf() const;
void UpdateChecksum(OatHeader& oat_header) const;
bool Write(File* file) const;
@@ -127,7 +127,7 @@
class OatMethods {
public:
- OatMethods(uint32_t methods_count);
+ explicit OatMethods(uint32_t methods_count);
size_t SizeOf() const;
void UpdateChecksum(OatHeader& oat_header) const;
bool Write(File* file) const;
diff --git a/src/space.h b/src/space.h
index e354aab..d312365 100644
--- a/src/space.h
+++ b/src/space.h
@@ -92,7 +92,7 @@
// create a Space from an existing memory mapping, taking ownership of the address space.
static Space* Create(MemMap* mem_map);
- Space(const std::string& name)
+ explicit Space(const std::string& name)
: name_(name), mspace_(NULL), maximum_size_(0), image_header_(NULL), base_(0), limit_(0) {
}
diff --git a/src/thread_list.h b/src/thread_list.h
index f5e1a3a..f650174 100644
--- a/src/thread_list.h
+++ b/src/thread_list.h
@@ -28,7 +28,7 @@
static const uint32_t kInvalidId = 0;
static const uint32_t kMainId = 1;
- ThreadList(bool verbose);
+ explicit ThreadList(bool verbose);
~ThreadList();
void Dump(std::ostream& os);
@@ -83,7 +83,7 @@
class ThreadListLock {
public:
- ThreadListLock(Thread* self = NULL) {
+ explicit ThreadListLock(Thread* self = NULL) {
if (self == NULL) {
// Try to get it from TLS.
self = Thread::Current();
diff --git a/src/timing_logger.h b/src/timing_logger.h
index f91b830..b60c60a 100644
--- a/src/timing_logger.h
+++ b/src/timing_logger.h
@@ -29,7 +29,7 @@
class TimingLogger {
public:
- TimingLogger(const char* name) : name_(name) {
+ explicit TimingLogger(const char* name) : name_(name) {
AddSplit("");
}
diff --git a/src/zip_archive.h b/src/zip_archive.h
index 13a22cc..acf18b0 100644
--- a/src/zip_archive.h
+++ b/src/zip_archive.h
@@ -113,7 +113,7 @@
}
private:
- ZipArchive(int fd) : fd_(fd), num_entries_(0), dir_offset_(0) {}
+ explicit ZipArchive(int fd) : fd_(fd), num_entries_(0), dir_offset_(0) {}
bool MapCentralDirectory();
bool Parse();