Bug 1202965 (part 2) - Use MOZ_UNUSED in FdPrintf.c. r=glandium.
authorNicholas Nethercote <nnethercote@mozilla.com>
Wed, 09 Sep 2015 17:01:32 -0700
changeset 294291 7a715b603ac0ab04990ac464d5a78551b3c513ee
parent 294290 4805fa9a89fe1165829e60140f3050ff09c2d656
child 294292 6e4fc82f286ba247a31c7e9160aa73668e4efa36
push id5245
push userraliiev@mozilla.com
push dateThu, 29 Oct 2015 11:30:51 +0000
treeherdermozilla-beta@dac831dc1bd0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1202965
milestone43.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 1202965 (part 2) - Use MOZ_UNUSED in FdPrintf.c. r=glandium.
memory/replace/logalloc/FdPrintf.cpp
--- a/memory/replace/logalloc/FdPrintf.cpp
+++ b/memory/replace/logalloc/FdPrintf.cpp
@@ -8,16 +8,17 @@
 
 #ifdef _WIN32
 #include <windows.h>
 #else
 #include <unistd.h>
 #endif
 #include <cstring>
 #include "mozilla/Assertions.h"
+#include "mozilla/unused.h"
 
 /* Template class allowing a limited number of increments on a value */
 template <typename T>
 class CheckedIncrement
 {
 public:
   CheckedIncrement(T aValue, size_t aMaxIncrement)
     : mValue(aValue), mMaxIncrement(aMaxIncrement)
@@ -120,14 +121,12 @@ FdPrintf(intptr_t aFd, const char* aForm
     f++;
   }
 out:
 #ifdef _WIN32
   // See comment in FdPrintf.h as to why WriteFile is used.
   DWORD written;
   WriteFile(reinterpret_cast<HANDLE>(aFd), buf, b - buf, &written, nullptr);
 #else
-  // Using mozilla::unused is tricky in logalloc, so just use (void) instead.
-  int unused = write(aFd, buf, b - buf);
-  (void) unused;
+  MOZ_UNUSED(write(aFd, buf, b - buf));
 #endif
   va_end(ap);
 }