Bug 1061248 - Fix some bad implicit constructors in LUL; r=BenWa
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 02 Sep 2014 09:45:28 -0400
changeset 202985 f8fb5a1f20d32cf9bccea7b703c69224d11fc62a
parent 202984 f6236160bb92dd4504c71c57b82b8c9ca2c5ab1e
child 202986 3251a4a4135b40907613ff9bfce0c3359933bdb8
push id48543
push usereakhgari@mozilla.com
push dateTue, 02 Sep 2014 13:47:01 +0000
treeherdermozilla-inbound@63e2bfe378e3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersBenWa
bugs1061248
milestone34.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1061248 - Fix some bad implicit constructors in LUL; r=BenWa
tools/profiler/LulCommon.cpp
tools/profiler/LulMain.cpp
tools/profiler/LulMain.h
tools/profiler/LulMainInt.h
--- a/tools/profiler/LulCommon.cpp
+++ b/tools/profiler/LulCommon.cpp
@@ -67,17 +67,17 @@ Module::~Module() {
 }
 
 
 ////////////////////////////////////////////////////////////////
 // UniqueString
 //
 class UniqueString {
  public:
-  UniqueString(string str) { str_ = strdup(str.c_str()); }
+  explicit UniqueString(string str) { str_ = strdup(str.c_str()); }
   ~UniqueString() { free(reinterpret_cast<void*>(const_cast<char*>(str_))); }
   const char* str_;
 };
 
 class UniqueStringUniverse {
 public:
   UniqueStringUniverse() {};
   const UniqueString* FindOrCopy(string str) {
--- a/tools/profiler/LulMain.cpp
+++ b/tools/profiler/LulMain.cpp
@@ -485,17 +485,17 @@ class SegArray {
 
 
 ////////////////////////////////////////////////////////////////
 // PriMap                                                     //
 ////////////////////////////////////////////////////////////////
 
 class PriMap {
  public:
-  PriMap(void (*aLog)(const char*))
+  explicit PriMap(void (*aLog)(const char*))
     : mLog(aLog)
   {}
 
   ~PriMap() {
     for (std::vector<SecMap*>::iterator iter = mSecMaps.begin();
          iter != mSecMaps.end();
          ++iter) {
       delete *iter;
@@ -833,17 +833,17 @@ class PriMap {
 // in use, and a value of one indicates that the slot is in use but
 // there is no RuleSet available.
 #define ENTRY_NOT_IN_USE      ((RuleSet*)0)
 #define NO_RULESET_AVAILABLE  ((RuleSet*)1)
 
 class CFICache {
  public:
 
-  CFICache(PriMap* aPriMap) {
+  explicit CFICache(PriMap* aPriMap) {
     Invalidate();
     mPriMap = aPriMap;
   }
 
   void Invalidate() {
     for (int i = 0; i < N_ENTRIES; ++i) {
       mCache[i].mAVMA = 0;
       mCache[i].mRSet = ENTRY_NOT_IN_USE;
--- a/tools/profiler/LulMain.h
+++ b/tools/profiler/LulMain.h
@@ -55,17 +55,17 @@
 
 
 namespace lul {
 
 // A machine word plus validity tag.
 class TaggedUWord {
 public:
   // Construct a valid one.
-  TaggedUWord(uintptr_t w)
+  explicit TaggedUWord(uintptr_t w)
     : mValue(w)
     , mValid(true)
   {}
 
   // Construct an invalid one.
   TaggedUWord()
     : mValue(0)
     , mValid(false)
@@ -160,17 +160,17 @@ struct StackImage {
 
 class PriMap;
 class SegArray;
 class CFICache;
 
 class LUL {
 public:
   // Create; supply a logging sink.  Initialises the rw-lock.
-  LUL(void (*aLog)(const char*));
+  explicit LUL(void (*aLog)(const char*));
 
   // Destroy.  This acquires mRWlock for writing.  By doing that, waits
   // for all unwinder threads to finish any Unwind() calls they may be
   // in.  All resources are freed and all registered unwinder threads
   // are deregistered.
   ~LUL();
 
   // Notify of a new r-x mapping, and load the associated unwind info.
--- a/tools/profiler/LulMainInt.h
+++ b/tools/profiler/LulMainInt.h
@@ -218,17 +218,17 @@ public:
   //
   // mRuleSets is empty
   //    <=> mSummaryMinAddr > mSummaryMaxAddr
   //
   // This doesn't constrain mSummaryMinAddr and mSummaryMaxAddr uniquely,
   // so let's use mSummaryMinAddr == 1 and mSummaryMaxAddr == 0 to denote
   // this case.
 
-  SecMap(void(*aLog)(const char*));
+  explicit SecMap(void(*aLog)(const char*));
   ~SecMap();
 
   // Binary search mRuleSets to find one that brackets |ia|, or nullptr
   // if none is found.  It's not allowable to do this until PrepareRuleSets
   // has been called first.
   RuleSet* FindRuleSet(uintptr_t ia);
 
   // Add a RuleSet to the collection.  The rule is copied in.  Calling