From cb49d7fc61dbafc548bc31cf22c7ea1801188155 Mon Sep 17 00:00:00 2001 From: Chris Peterson Date: Fri, 14 Nov 2014 00:36:20 -0800 Subject: [PATCH] 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 | 2 ++ dom/media/gmp/gmp-api/gmp-decryption.h | 7 +++++++ media/gmp-clearkey/0.1/moz.build | 17 +++++++++++++++++ 3 files changed, 26 insertions(+) diff --git a/dom/media/gmp-plugin/moz.build b/dom/media/gmp-plugin/moz.build index 4f854df7d7d..c26ed12fcf6 100644 --- a/dom/media/gmp-plugin/moz.build +++ b/dom/media/gmp-plugin/moz.build @@ -22,3 +22,5 @@ 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 diff --git a/dom/media/gmp/gmp-api/gmp-decryption.h b/dom/media/gmp/gmp-api/gmp-decryption.h index 94b203fbb36..4ec3ec62592 100644 --- a/dom/media/gmp/gmp-api/gmp-decryption.h +++ b/dom/media/gmp/gmp-api/gmp-decryption.h @@ -39,6 +39,8 @@ public: virtual const uint16_t* ClearBytes() const = 0; virtual const uint32_t* CipherBytes() const = 0; + + virtual ~GMPEncryptedBufferMetadata() {} }; class GMPBuffer { @@ -177,6 +179,8 @@ public: // 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". @@ -187,6 +191,8 @@ public: virtual void GetPluginVoucher(const uint8_t** aVoucher, uint32_t* aVoucherLength) = 0; + + virtual ~GMPDecryptorHost() {} }; enum GMPSessionType { @@ -265,6 +271,7 @@ public: // Do not call the GMPDecryptorCallback's functions after this is called. virtual void DecryptingComplete() = 0; + virtual ~GMPDecryptor() {} }; #endif // GMP_DECRYPTION_h_ diff --git a/media/gmp-clearkey/0.1/moz.build b/media/gmp-clearkey/0.1/moz.build index ebe9aaf7ebb..4eac10e33c5 100644 --- a/media/gmp-clearkey/0.1/moz.build +++ b/media/gmp-clearkey/0.1/moz.build @@ -25,3 +25,20 @@ 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