From 57bef6b196867b04cccb81bdb269232ab504c7e4 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Wed, 16 Dec 2015 22:57:51 -0800 Subject: [PATCH] Bug 1232219 (part 3) - Fix remaining -Wunused warnings. r=glandium. --HG-- extra : rebase_source : 357474b4c7729b78a3030dfefd720aad4e1b2576 --- media/libcubeb/src/moz.build | 3 +++ media/libmkv/moz.build | 3 +++ media/libnestegg/src/moz.build | 3 +++ media/libpng/moz.build | 3 +++ media/libtremor/lib/moz.build | 2 ++ memory/build/mozjemalloc_compat.c | 2 +- memory/mozjemalloc/jemalloc.c | 5 +++-- toolkit/components/mediasniffer/mp3sniff.c | 3 +-- 8 files changed, 19 insertions(+), 5 deletions(-) diff --git a/media/libcubeb/src/moz.build b/media/libcubeb/src/moz.build index 00e66d82dffc..3b966560bc64 100644 --- a/media/libcubeb/src/moz.build +++ b/media/libcubeb/src/moz.build @@ -76,3 +76,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk': CFLAGS += CONFIG['MOZ_ALSA_CFLAGS'] CFLAGS += CONFIG['MOZ_PULSEAUDIO_CFLAGS'] + +# We allow warnings for third-party code that can be updated from upstream. +ALLOW_COMPILER_WARNINGS = True diff --git a/media/libmkv/moz.build b/media/libmkv/moz.build index e8450c923f0c..6e46804ce20b 100644 --- a/media/libmkv/moz.build +++ b/media/libmkv/moz.build @@ -22,3 +22,6 @@ SOURCES += [ ] FINAL_LIBRARY = 'gkmedias' + +# We allow warnings for third-party code that can be updated from upstream. +ALLOW_COMPILER_WARNINGS = True diff --git a/media/libnestegg/src/moz.build b/media/libnestegg/src/moz.build index 3aa82ddba1b5..1c0576384716 100644 --- a/media/libnestegg/src/moz.build +++ b/media/libnestegg/src/moz.build @@ -10,3 +10,6 @@ UNIFIED_SOURCES += [ ] FINAL_LIBRARY = 'gkmedias' + +# We allow warnings for third-party code that can be updated from upstream. +ALLOW_COMPILER_WARNINGS = True diff --git a/media/libpng/moz.build b/media/libpng/moz.build index 4e1e1ff1a504..56e15402b48b 100644 --- a/media/libpng/moz.build +++ b/media/libpng/moz.build @@ -41,3 +41,6 @@ if CONFIG['MOZ_PNG_ARM_NEON']: Library('mozpng') FINAL_LIBRARY = 'gkmedias' + +# We allow warnings for third-party code that can be updated from upstream. +ALLOW_COMPILER_WARNINGS = True diff --git a/media/libtremor/lib/moz.build b/media/libtremor/lib/moz.build index 72a9fbe41db1..a40933b78cbc 100644 --- a/media/libtremor/lib/moz.build +++ b/media/libtremor/lib/moz.build @@ -31,3 +31,5 @@ LOCAL_INCLUDES += [ '/media/libtremor/include/tremor', ] +# We allow warnings for third-party code that can be updated from upstream. +ALLOW_COMPILER_WARNINGS = True diff --git a/memory/build/mozjemalloc_compat.c b/memory/build/mozjemalloc_compat.c index fd061d264fe6..14489b70ff51 100644 --- a/memory/build/mozjemalloc_compat.c +++ b/memory/build/mozjemalloc_compat.c @@ -142,7 +142,7 @@ jemalloc_stats_impl(jemalloc_stats_t *stats) // src/ctl.c uint64_t epoch = 0; size_t esz = sizeof(epoch); - int ret = je_(mallctl)("epoch", &epoch, &esz, &epoch, esz); + je_(mallctl)("epoch", &epoch, &esz, &epoch, esz); CTL_GET("arenas.narenas", narenas); CTL_GET("arenas.page", page); diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c index ee9e28853749..d1a57feb7ab6 100644 --- a/memory/mozjemalloc/jemalloc.c +++ b/memory/mozjemalloc/jemalloc.c @@ -1703,6 +1703,9 @@ malloc_mutex_unlock(malloc_mutex_t *mutex) #endif } +#if (defined(__GNUC__)) +__attribute__((unused)) +# endif static bool malloc_spin_init(malloc_spinlock_t *lock) { @@ -6655,8 +6658,6 @@ jemalloc_stats_impl(jemalloc_stats_t *stats) for (j = 0; j < ntbins + nqbins + nsbins; j++) { arena_bin_t* bin = &arena->bins[j]; size_t bin_unused = 0; - const size_t run_header_size = sizeof(arena_run_t) + - (sizeof(unsigned) * (bin->regs_mask_nelms - 1)); rb_foreach_begin(arena_chunk_map_t, link, &bin->runs, mapelm) { run = (arena_run_t *)(mapelm->bits & ~pagesize_mask); diff --git a/toolkit/components/mediasniffer/mp3sniff.c b/toolkit/components/mediasniffer/mp3sniff.c index bb30d806721f..a515d9c583ae 100644 --- a/toolkit/components/mediasniffer/mp3sniff.c +++ b/toolkit/components/mediasniffer/mp3sniff.c @@ -118,12 +118,11 @@ static int id3_framesize(const uint8_t *p, long length) int mp3_sniff(const uint8_t *buf, long length) { mp3_header header; - const uint8_t *p, *q; + const uint8_t *p; long skip; long avail; p = buf; - q = p; avail = length; while (avail >= 4) { if (is_id3(p, avail)) {