Bug 1098134 - Fix or suppress warnings in gmp-api, gmp-clearkey, and gmp-plugin and mark as FAIL_ON_WARNINGS. r=cpearce
authorChris Peterson <cpeterson@mozilla.com>
Fri, 14 Nov 2014 00:36:20 -0800
changeset 240256 3f85d8942e3eb2904067cb39ea9833c8c82f96b6
parent 240210 c786bdac4406ca9920a83fa50e558750be6d5f60
child 240257 2a3399e38768a6ce69fcb49a1fa95285dbc0deaf
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscpearce
bugs1098134
milestone36.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 1098134 - Fix or suppress warnings in gmp-api, gmp-clearkey, and gmp-plugin and mark as FAIL_ON_WARNINGS. r=cpearce
dom/media/gmp-plugin/moz.build
dom/media/gmp/gmp-api/gmp-decryption.h
media/gmp-clearkey/0.1/moz.build
--- a/dom/media/gmp-plugin/moz.build
+++ b/dom/media/gmp-plugin/moz.build
@@ -17,8 +17,10 @@ if CONFIG['OS_ARCH'] == 'WINNT':
     OS_LIBS += [
         'ole32',
     ]
 
 USE_STATIC_LIBS = True
 NO_VISIBILITY_FLAGS = True
 # Don't use STL wrappers; this isn't Gecko code
 DISABLE_STL_WRAPPING = True
+
+FAIL_ON_WARNINGS = True
--- a/dom/media/gmp/gmp-api/gmp-decryption.h
+++ b/dom/media/gmp/gmp-api/gmp-decryption.h
@@ -34,16 +34,18 @@ public:
   virtual uint32_t IVSize() const = 0;
 
   // Number of entries returned by ClearBytes() and CipherBytes().
   virtual uint32_t NumSubsamples() const = 0;
 
   virtual const uint16_t* ClearBytes() const = 0;
 
   virtual const uint32_t* CipherBytes() const = 0;
+
+  virtual ~GMPEncryptedBufferMetadata() {}
 };
 
 class GMPBuffer {
 public:
   virtual uint32_t Id() const = 0;
   virtual uint8_t* Data() = 0;
   virtual uint32_t Size() const = 0;
   virtual void Resize(uint32_t aSize) = 0;
@@ -172,26 +174,30 @@ public:
   // function and report whether it can decrypt and/or decode. Without
   // this, Gecko does not know how to use the CDM and will not send
   // samples to the CDM to decrypt or decrypt-and-decode mode. Note a
   // CDM cannot change modes once playback has begun.
   virtual void SetCapabilities(uint64_t aCaps) = 0;
 
   // Returns decrypted buffer to Gecko, or reports failure.
   virtual void Decrypted(GMPBuffer* aBuffer, GMPErr aResult) = 0;
+
+  virtual ~GMPDecryptorCallback() {}
 };
 
 // Host interface, passed to GetAPIFunc(), with "decrypt".
 class GMPDecryptorHost {
 public:
   virtual void GetSandboxVoucher(const uint8_t** aVoucher,
                                  uint32_t* aVoucherLength) = 0;
 
   virtual void GetPluginVoucher(const uint8_t** aVoucher,
                                 uint32_t* aVoucherLength) = 0;
+
+  virtual ~GMPDecryptorHost() {}
 };
 
 enum GMPSessionType {
   kGMPTemporySession = 0,
   kGMPPersistentSession = 1,
   kGMPSessionInvalid = 2 // Must always be last.
 };
 
@@ -260,11 +266,12 @@ public:
   // memory will leak!
   virtual void Decrypt(GMPBuffer* aBuffer,
                        GMPEncryptedBufferMetadata* aMetadata) = 0;
 
   // Called when the decryption operations are complete.
   // Do not call the GMPDecryptorCallback's functions after this is called.
   virtual void DecryptingComplete() = 0;
 
+  virtual ~GMPDecryptor() {}
 };
 
 #endif // GMP_DECRYPTION_h_
--- a/media/gmp-clearkey/0.1/moz.build
+++ b/media/gmp-clearkey/0.1/moz.build
@@ -20,8 +20,25 @@ UNIFIED_SOURCES += [
 LOCAL_INCLUDES += [
     '/dom/media/gmp',
 ]
 
 USE_STATIC_LIBS = True
 
 DISABLE_STL_WRAPPING = True
 DEFINES['MOZ_NO_MOZALLOC'] = True
+
+# Suppress warnings in third-party code.
+if CONFIG['GNU_CXX']:
+    CFLAGS += [
+        '-Wno-missing-braces',
+        '-Wno-pointer-to-int-cast',
+        '-Wno-sign-compare',
+        '-include stdio.h',         # for sprintf() prototype
+        '-include unistd.h',        # for getpid() prototype
+    ]
+elif CONFIG['_MSC_VER']:
+    CFLAGS += [
+        '-FI stdio.h',              # for sprintf() prototype
+        '-wd4090',                  # '=' : different 'const' qualifiers
+    ]
+
+FAIL_ON_WARNINGS = True