From ba50801a606532cd98130200d881b0d6606f1321 Mon Sep 17 00:00:00 2001 From: Ben Kelly Date: Wed, 28 Jan 2015 15:11:18 -0500 Subject: [PATCH] Bug 1126985 Fix xpcom/base build with --enable-warnings-on-errors. r=froydnj --- xpcom/base/SystemMemoryReporter.cpp | 10 +++++----- xpcom/base/nsDumpUtils.cpp | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/xpcom/base/SystemMemoryReporter.cpp b/xpcom/base/SystemMemoryReporter.cpp index 166e3e3bfc2..c130bc4a5bb 100644 --- a/xpcom/base/SystemMemoryReporter.cpp +++ b/xpcom/base/SystemMemoryReporter.cpp @@ -740,10 +740,10 @@ private: uint64_t size; // Ignore the header line. - fgets(buffer, kBufferLen, iommu); + unused << fgets(buffer, kBufferLen, iommu); // Ignore the separator line. - fgets(buffer, kBufferLen, iommu); + unused << fgets(buffer, kBufferLen, iommu); const char* const kSep = "----"; const size_t kSepLen = 4; @@ -760,7 +760,7 @@ private: } // Ignore the orphaned header. - fgets(buffer, kBufferLen, iommu); + unused << fgets(buffer, kBufferLen, iommu); // Read orphaned entries. while (fgets(buffer, kBufferLen, iommu) && @@ -787,7 +787,7 @@ private: } uint64_t size = 0; - fscanf(sizeFile, "%" SCNu64, &size); + unused << fscanf(sizeFile, "%" SCNu64, &size); fclose(sizeFile); return size; @@ -1029,7 +1029,7 @@ private: // Bypass the header line. char buff[1024]; - fgets(buff, 1024, memFile); + unused << fgets(buff, 1024, memFile); while (fscanf(memFile, kScanFormat, &gpuaddr, &useraddr, &size, &id, flags, type, usage, &sglen) == kNumFields) { diff --git a/xpcom/base/nsDumpUtils.cpp b/xpcom/base/nsDumpUtils.cpp index ac3b0d55cb4..d463d705ee5 100644 --- a/xpcom/base/nsDumpUtils.cpp +++ b/xpcom/base/nsDumpUtils.cpp @@ -12,6 +12,7 @@ #include "mozilla/Services.h" #include "nsIObserverService.h" #include "mozilla/ClearOnShutdown.h" +#include "mozilla/unused.h" #ifdef XP_UNIX // { #include "mozilla/Preferences.h" @@ -59,7 +60,7 @@ DumpSignalHandler(int aSignum) if (sDumpPipeWriteFd != -1) { uint8_t signum = static_cast(aSignum); - write(sDumpPipeWriteFd, &signum, sizeof(signum)); + unused << write(sDumpPipeWriteFd, &signum, sizeof(signum)); } }