diff --git a/dom/media/AudioStream.cpp b/dom/media/AudioStream.cpp index 24bd97dbaf75c..266379086a0c1 100644 --- a/dom/media/AudioStream.cpp +++ b/dom/media/AudioStream.cpp @@ -13,6 +13,7 @@ #include "mozilla/Monitor.h" #include "mozilla/Mutex.h" #include "mozilla/Sprintf.h" +#include "mozilla/Unused.h" #include #include "mozilla/Telemetry.h" #include "CubebUtils.h" @@ -277,7 +278,7 @@ OpenDumpFile(uint32_t aChannels, uint32_t aRate) SetUint16LE(header + CHANNEL_OFFSET, aChannels); SetUint32LE(header + SAMPLE_RATE_OFFSET, aRate); SetUint16LE(header + BLOCK_ALIGN_OFFSET, aChannels * 2); - fwrite(header, sizeof(header), 1, f); + Unused << fwrite(header, sizeof(header), 1, f); return f; } @@ -285,7 +286,7 @@ OpenDumpFile(uint32_t aChannels, uint32_t aRate) template typename EnableIf::value, void>::Type WriteDumpFileHelper(T* aInput, size_t aSamples, FILE* aFile) { - fwrite(aInput, sizeof(T), aSamples, aFile); + Unused << fwrite(aInput, sizeof(T), aSamples, aFile); } template @@ -297,7 +298,7 @@ WriteDumpFileHelper(T* aInput, size_t aSamples, FILE* aFile) { for (uint32_t i = 0; i < aSamples; ++i) { SetUint16LE(output + i*2, int16_t(aInput[i]*32767.0f)); } - fwrite(output, 2, aSamples, aFile); + Unused << fwrite(output, 2, aSamples, aFile); fflush(aFile); } diff --git a/dom/media/mediasource/ResourceQueue.cpp b/dom/media/mediasource/ResourceQueue.cpp index 6e2621d9e0de5..a3481745de30c 100644 --- a/dom/media/mediasource/ResourceQueue.cpp +++ b/dom/media/mediasource/ResourceQueue.cpp @@ -11,6 +11,7 @@ #include "mozilla/IntegerPrintfMacros.h" #include "mozilla/Logging.h" #include "mozilla/Sprintf.h" +#include "mozilla/Unused.h" extern mozilla::LogModule* GetSourceBufferResourceLog(); @@ -171,7 +172,7 @@ ResourceQueue::Dump(const char* aPath) if (!fp) { return; } - fwrite(item->mData->Elements(), item->mData->Length(), 1, fp); + Unused << fwrite(item->mData->Elements(), item->mData->Length(), 1, fp); fclose(fp); } } diff --git a/gfx/thebes/gfxUtils.cpp b/gfx/thebes/gfxUtils.cpp index 10d113d110a34..d346ac7ef9168 100644 --- a/gfx/thebes/gfxUtils.cpp +++ b/gfx/thebes/gfxUtils.cpp @@ -25,6 +25,7 @@ #include "mozilla/Maybe.h" #include "mozilla/RefPtr.h" #include "mozilla/UniquePtrExtensions.h" +#include "mozilla/Unused.h" #include "mozilla/Vector.h" #include "nsComponentManagerUtils.h" #include "nsIClipboardHelper.h" @@ -1048,7 +1049,7 @@ EncodeSourceSurfaceInternal(SourceSurface* aSurface, if (aBinaryOrData == gfxUtils::eBinaryEncode) { if (aFile) { - fwrite(imgData.begin(), 1, imgSize, aFile); + Unused << fwrite(imgData.begin(), 1, imgSize, aFile); } return NS_OK; } diff --git a/media/webrtc/signaling/gtest/mediaconduit_unittests.cpp b/media/webrtc/signaling/gtest/mediaconduit_unittests.cpp old mode 100644 new mode 100755 index 32e162df7d45c..6ad1b0616d353 --- a/media/webrtc/signaling/gtest/mediaconduit_unittests.cpp +++ b/media/webrtc/signaling/gtest/mediaconduit_unittests.cpp @@ -13,6 +13,7 @@ using namespace std; #include #include #include "mozilla/UniquePtr.h" +#include "mozilla/Unused.h" #include "nss.h" #include "runnable_utils.h" #include "signaling/src/common/EncodingConstraints.h" @@ -224,7 +225,7 @@ void AudioSendAndReceive::GenerateAndReadSamples() //Create input file with the music WriteWaveHeader(PLAYOUT_SAMPLE_FREQUENCY, 1, inFile); GenerateMusic(inbuf, SAMPLES); - fwrite(inbuf,1,SAMPLES*sizeof(inbuf[0])*CHANNELS,inFile); + Unused << fwrite(inbuf,1,SAMPLES*sizeof(inbuf[0])*CHANNELS,inFile); FinishWaveHeader(inFile); fclose(inFile); diff --git a/security/pkix/test/lib/pkixtestutil.cpp b/security/pkix/test/lib/pkixtestutil.cpp index ddc8cd0826304..8f365b329b2e2 100644 --- a/security/pkix/test/lib/pkixtestutil.cpp +++ b/security/pkix/test/lib/pkixtestutil.cpp @@ -34,6 +34,8 @@ #include "pkixder.h" #include "pkixutil.h" +#include "mozilla/Unused.h" + using namespace std; namespace mozilla { namespace pkix { namespace test { @@ -509,7 +511,7 @@ MaybeLogOutput(const ByteString& result, const char* suffix) ++counter; ScopedFILE file(OpenFile(logPath, filename, "wb")); if (file) { - (void) fwrite(result.data(), result.length(), 1, file.get()); + Unused << fwrite(result.data(), result.length(), 1, file.get()); } } } diff --git a/testing/gtest/gtest/src/gtest.cc b/testing/gtest/gtest/src/gtest.cc old mode 100644 new mode 100755 index d882ab2e36a12..41b10d220c9f0 --- a/testing/gtest/gtest/src/gtest.cc +++ b/testing/gtest/gtest/src/gtest.cc @@ -35,6 +35,8 @@ #include "gtest/internal/custom/gtest.h" #include "gtest/gtest-spi.h" +#include "mozilla/Unused.h" + #include #include #include @@ -3866,7 +3868,7 @@ class ScopedPrematureExitFile { // errors are ignored as there's nothing better we can do and we // don't want to fail the test because of this. FILE* pfile = posix::FOpen(premature_exit_filepath, "w"); - fwrite("0", 1, 1, pfile); + Unused << fwrite("0", 1, 1, pfile); fclose(pfile); } } diff --git a/xpcom/build/LateWriteChecks.cpp b/xpcom/build/LateWriteChecks.cpp index 1afb0135f1e4c..2d58e6b76c7fc 100755 --- a/xpcom/build/LateWriteChecks.cpp +++ b/xpcom/build/LateWriteChecks.cpp @@ -13,6 +13,7 @@ #include "mozilla/Scoped.h" #include "mozilla/StaticPtr.h" #include "mozilla/Telemetry.h" +#include "mozilla/Unused.h" #include "nsAppDirectoryServiceDefs.h" #include "nsDirectoryServiceUtils.h" #include "nsPrintfCString.h" @@ -59,7 +60,7 @@ class SHA1Stream str.AppendPrintf(aFormat, list); va_end(list); mSHA1.update(str.get(), str.Length()); - fwrite(str.get(), 1, str.Length(), mFile); + Unused << fwrite(str.get(), 1, str.Length(), mFile); } void Finish(SHA1Sum::Hash& aHash) {