Bug 1083101 - Yet another static analysis fix in a CLOSED TREE.
☠☠ backed out by fd0134809e69 ☠ ☠
authorNicolas Silva <nsilva@mozilla.com>
Tue, 01 Sep 2015 14:34:37 +0200
changeset 260321 0a6cc12c33d7377f38dd169f6a2c7fcddb51affa
parent 260320 b82291c07e0e21cf1110820bba6b299ac7adb71d
child 260322 4f33bf3be1d07b080197cd8231c6365673c25fd7
push id29307
push userryanvm@gmail.com
push dateWed, 02 Sep 2015 01:01:53 +0000
treeherdermozilla-central@e2eb0442ece9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1083101
milestone43.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 1083101 - Yet another static analysis fix in a CLOSED TREE.
gfx/tests/gtest/TestArena.cpp
gfx/tests/gtest/TestTaskScheduler.cpp
--- a/gfx/tests/gtest/TestArena.cpp
+++ b/gfx/tests/gtest/TestArena.cpp
@@ -35,37 +35,37 @@ public:
 
 static int sDtorItemA = 0;
 static int sDtorItemB = 0;
 
 class A : public Base {
 public:
   virtual A* AsA() override { return this; }
 
-  A(uint64_t val) : mVal(val) {}
+  explicit A(uint64_t val) : mVal(val) {}
   ~A() { ++sDtorItemA; }
 
   uint64_t mVal;
 };
 
 class B : public Base {
 public:
   virtual B* AsB() override { return this; }
 
-  B(const string& str) : mVal(str) {}
+  explicit B(const string& str) : mVal(str) {}
   ~B() { ++sDtorItemB; }
 
   std::string mVal;
 };
 
 struct BigStruct {
   uint64_t mVal;
   uint8_t data[120];
 
-  BigStruct(uint64_t val) : mVal(val) {}
+  explicit BigStruct(uint64_t val) : mVal(val) {}
 };
 
 void TestArenaAlloc(IterableArena::ArenaType aType)
 {
   sDtorItemA = 0;
   sDtorItemB = 0;
   IterableArena arena(aType, 256);
 
--- a/gfx/tests/gtest/TestTaskScheduler.cpp
+++ b/gfx/tests/gtest/TestTaskScheduler.cpp
@@ -32,17 +32,17 @@ void MaybeYieldThread()
 #endif
 }
 
 /// Used by the TestCommand to check that tasks are processed in the right order.
 struct SanityChecker {
   std::vector<uint64_t> mAdvancements;
   mozilla::gfx::CriticalSection mSection;
 
-  SanityChecker(uint64_t aNumCmdBuffers)
+  explicit SanityChecker(uint64_t aNumCmdBuffers)
   {
     for (uint32_t i = 0; i < aNumCmdBuffers; ++i) {
       mAdvancements.push_back(0);
     }
   }
 
   virtual void Check(uint64_t aTaskId, uint64_t aCmdId)
   {
@@ -52,17 +52,17 @@ struct SanityChecker {
     mAdvancements[aTaskId] = aCmdId;
   }
 };
 
 /// Run checks that are specific to TestSchulerJoin.
 struct JoinTestSanityCheck : public SanityChecker {
   bool mSpecialTaskHasRun;
 
-  JoinTestSanityCheck(uint64_t aNumCmdBuffers)
+  explicit JoinTestSanityCheck(uint64_t aNumCmdBuffers)
   : SanityChecker(aNumCmdBuffers)
   , mSpecialTaskHasRun(false)
   {}
 
   virtual void Check(uint64_t aTaskId, uint64_t aCmdId) override
   {
     // Task 0 is the special task executed when everything is joined after task 5
     if (aCmdId == 0) {