Bug 1365321 - remove warnings from faulty r=billm
authorrforbes <rforbes@mozilla.com>
Tue, 23 May 2017 08:54:46 -0700
changeset 360176 adb2e187d9acaa32f98fe9de08dc8ebb0b15e104
parent 360175 74d4005d165ff18bb7fa8948b740450d7c3b414f
child 360177 377891d444edbdff2e62af81b84495da377f360b
push id31871
push userryanvm@gmail.com
push dateTue, 23 May 2017 22:02:07 +0000
treeherdermozilla-central@545ffce30eac [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbillm
bugs1365321
milestone55.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 1365321 - remove warnings from faulty r=billm MozReview-Commit-ID: C0ANd5Zpmes
ipc/glue/Faulty.cpp
--- a/ipc/glue/Faulty.cpp
+++ b/ipc/glue/Faulty.cpp
@@ -101,38 +101,44 @@ void FuzzIntegralType(T* v, bool largeVa
                 "T must be an integral type");
   switch (random() % 6) {
     case 0:
       if (largeValues) {
         (*v) = RandomIntegral<T>();
         break;
       }
       // Fall through
+      MOZ_FALLTHROUGH;
+
     case 1:
       if (largeValues) {
         (*v) = RandomNumericLimit<T>();
         break;
       }
       // Fall through
+      MOZ_FALLTHROUGH;
+
     case 2:
       if (largeValues) {
         (*v) = RandomIntegerRange<T>(std::numeric_limits<T>::min(),
                                      std::numeric_limits<T>::max());
         break;
       }
       // Fall through
+      MOZ_FALLTHROUGH;
     default:
       switch(random() % 2) {
         case 0:
           // Prevent underflow
           if (*v != std::numeric_limits<T>::min()) {
             (*v)--;
             break;
           }
           // Fall through
+          MOZ_FALLTHROUGH;
         case 1:
           // Prevent overflow
           if (*v != std::numeric_limits<T>::max()) {
             (*v)++;
             break;
           }
       }
   }
@@ -149,41 +155,45 @@ void FuzzFloatingPointType(T* v, bool la
                 "T must be a floating point type");
   switch (random() % 6) {
     case 0:
       if (largeValues) {
         (*v) = RandomNumericLimit<T>();
         break;
     }
     // Fall through
+    MOZ_FALLTHROUGH;
     case 1:
       if (largeValues) {
         (*v) = RandomFloatingPointRange<T>(std::numeric_limits<T>::min(),
                                            std::numeric_limits<T>::max());
         break;
       }
     // Fall through
+    MOZ_FALLTHROUGH;
     default:
       (*v) = RandomFloatingPoint<T>();
   }
 }
 
 /**
  * FuzzStringType mutates an incercepted string type of a pickled message.
  */
 template <typename T>
 void FuzzStringType(T& v, const T& literal1, const T& literal2)
 {
   switch (random() % 5) {
     case 4:
       v = v + v;
       // Fall through
+      MOZ_FALLTHROUGH;
     case 3:
       v = v + v;
       // Fall through
+      MOZ_FALLTHROUGH;
     case 2:
       v = v + v;
       break;
     case 1:
       v += literal1;
       break;
     case 0:
       v = literal2;
@@ -517,17 +527,17 @@ Faulty::MutateUInt64(uint64_t* aValue)
 
 void
 Faulty::FuzzUInt64(uint64_t* aValue, unsigned int aProbability)
 {
   if (mIsValidProcessType) {
     if (mFuzzPickle && GetChance(aProbability)) {
       uint64_t oldValue = *aValue;
       MutateUInt64(aValue);
-      FAULTY_LOG("pickle field {UInt64} of value: %llu changed to: %llu",
+      FAULTY_LOG("pickle field {UInt64} of value: %" PRIu64 " changed to: %" PRIu64,
                  oldValue, *aValue);
     }
   }
 }
 
 void
 Faulty::MutateInt64(int64_t* aValue)
 {
@@ -536,17 +546,17 @@ Faulty::MutateInt64(int64_t* aValue)
 
 void
 Faulty::FuzzInt64(int64_t* aValue, unsigned int aProbability)
 {
   if (mIsValidProcessType) {
     if (mFuzzPickle && GetChance(aProbability)) {
       int64_t oldValue = *aValue;
       MutateInt64(aValue);
-      FAULTY_LOG("pickle field {Int64} of value: %lld changed to: %lld",
+      FAULTY_LOG("pickle field {UInt64} of value: %" PRIu64 " changed to: %" PRIu64,
                  oldValue, *aValue);
     }
   }
 }
 
 void
 Faulty::MutateDouble(double* aValue)
 {