Bug 1365321 - remove warnings from faulty draft
authorrforbes <rforbes@mozilla.com>
Tue, 23 May 2017 08:54:46 -0700
changeset 583026 b1ff1ce4f9256713ea6f4ec68098c6aab21bb627
parent 583025 6dfa56094f0cc291945dd3c24d0a4c2682d80ec7
child 629944 459b67eb46b96b094e6858228200cdd25dee0a5b
push id60272
push userrforbes@mozilla.com
push dateTue, 23 May 2017 15:55:22 +0000
bugs1365321
milestone55.0a1
Bug 1365321 - remove warnings from faulty 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)
 {