backout c7e523e3d339 (bug 1083373 part 2) for Android debug build warning, treated as error
authorDaniel Holbert <dholbert@cs.stanford.edu>
Mon, 27 Oct 2014 19:15:15 -0700
changeset 212585 c5b93a000dfba4239004f5928c22896514b62cdf
parent 212584 2abc300df08c66f5541553437baa35d63bfa1cfe
child 212586 98d0bbc3081747a830296780a30439dd47f855ee
push id27721
push usercbook@mozilla.com
push dateTue, 28 Oct 2014 14:55:05 +0000
treeherdermozilla-central@c0ddb1b098ec [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1083373
milestone36.0a1
backs outc7e523e3d339410de77475c74a87c12ab53be880
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
backout c7e523e3d339 (bug 1083373 part 2) for Android debug build warning, treated as error
media/gmp-clearkey/0.1/ClearKeyUtils.cpp
--- a/media/gmp-clearkey/0.1/ClearKeyUtils.cpp
+++ b/media/gmp-clearkey/0.1/ClearKeyUtils.cpp
@@ -5,18 +5,16 @@
 #include <algorithm>
 #include <assert.h>
 #include <ctype.h>
 #include <stdarg.h>
 #include <stdint.h>
 #include <vector>
 
 #include "ClearKeyUtils.h"
-#include "mozilla/ArrayUtils.h"
-#include "mozilla/Assertions.h"
 #include "mozilla/Endian.h"
 #include "mozilla/NullPtr.h"
 #include "openaes/oaes_lib.h"
 
 using namespace std;
 
 #define FOURCC(a,b,c,d) ((a << 24) + (b << 16) + (c << 8) + d)
 
@@ -103,22 +101,17 @@ EncodeBase64Web(vector<uint8_t> aBinary,
       data++;
     } else {
       out[i] = 0;
     }
 
     out[i] += (*data >> (shift + 2)) & sMask;
     shift = (shift + 2) % 8;
 
-    auto idx = out[i];
-    MOZ_ASSERT(idx >= 0 &&
-               static_cast<size_t>(idx) < MOZ_ARRAY_LENGTH(sAlphabet),
-               "out of bounds index for 'sAlphabet'");
-    // Cast idx to size_t to pacify clang 'Wchar-subscripts' warning:
-    out[i] = sAlphabet[static_cast<size_t>(idx)];
+    out[i] = sAlphabet[out[i]];
   }
 
   return true;
 }
 
 /* static */ void
 ClearKeyUtils::ParseInitData(const uint8_t* aInitData, uint32_t aInitDataSize,
                              vector<KeyId>& aOutKeys)