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 261607 7a715b603ac0ab04990ac464d5a78551b3c513ee
parent 261606 4805fa9a89fe1165829e60140f3050ff09c2d656
child 261608 6e4fc82f286ba247a31c7e9160aa73668e4efa36
push id64783
push usernnethercote@mozilla.com
push dateThu, 10 Sep 2015 00:03:46 +0000
treeherdermozilla-inbound@7a715b603ac0 [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);
 }