Bug 1235237 - Annotate intentional switch fallthrough to suppress -Wimplicit-fallthrough warning in storage/. r=mak
authorChris Peterson <cpeterson@mozilla.com>
Sun, 22 Nov 2015 22:09:23 -0800
changeset 279118 cc04ff0cdededd04de5ccefc35c98565ddf94f90
parent 279117 2ee573ab8547d536bd79d2b6e43e2e5efe2f2015
child 279119 96ce3bd0b8067bac7186c4425a8f7e27b6c1fd03
push id29871
push userphilringnalda@gmail.com
push dateSat, 09 Jan 2016 19:40:57 +0000
treeherdermozilla-central@9afb89dd315f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1235237
milestone46.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 1235237 - Annotate intentional switch fallthrough to suppress -Wimplicit-fallthrough warning in storage/. r=mak storage/mozStoragePrivateHelpers.cpp:234:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
storage/mozStoragePrivateHelpers.cpp
--- a/storage/mozStoragePrivateHelpers.cpp
+++ b/storage/mozStoragePrivateHelpers.cpp
@@ -225,31 +225,31 @@ convertVariantToStorageVariant(nsIVarian
       // Note this copies the array data.
       rv = aVariant->GetAsArray(&type, &iid, &len, &rawArray);
       NS_ENSURE_SUCCESS(rv, nullptr);
       if (type == nsIDataType::VTYPE_UINT8) {
         std::pair<uint8_t *, int> v(static_cast<uint8_t *>(rawArray), len);
         // Take ownership of the data avoiding a further copy.
         return new AdoptedBlobVariant(v);
       }
+      MOZ_FALLTHROUGH;
     }
     case nsIDataType::VTYPE_EMPTY:
     case nsIDataType::VTYPE_EMPTY_ARRAY:
     case nsIDataType::VTYPE_VOID:
       return new NullVariant();
     case nsIDataType::VTYPE_ID:
     case nsIDataType::VTYPE_INTERFACE:
     case nsIDataType::VTYPE_INTERFACE_IS:
     default:
       NS_WARNING("Unsupported variant type");
       return nullptr;
   }
 
   return nullptr;
-
 }
 
 namespace {
 class CallbackEvent : public nsRunnable
 {
 public:
   explicit CallbackEvent(mozIStorageCompletionCallback *aCallback)
   : mCallback(aCallback)
@@ -268,12 +268,10 @@ private:
 already_AddRefed<nsIRunnable>
 newCompletionEvent(mozIStorageCompletionCallback *aCallback)
 {
   NS_ASSERTION(aCallback, "Passing a null callback is a no-no!");
   nsCOMPtr<nsIRunnable> event = new CallbackEvent(aCallback);
   return event.forget();
 }
 
-
-
 } // namespace storage
 } // namespace mozilla