summaryrefslogtreecommitdiffstats
path: root/libutils/RefBase.cpp
diff options
context:
space:
mode:
authorMark Salyzyn <salyzyn@google.com>2014-04-30 11:10:46 -0700
committerMark Salyzyn <salyzyn@google.com>2014-06-02 15:57:50 -0700
commit5bed8036644f552210a7cfcbed2d6d20cf2981b0 (patch)
tree37f784e181086e99b17e00d46b6da30529751539 /libutils/RefBase.cpp
parentbf0f25905b12581f05b65b1ebe95211c727ae483 (diff)
downloadsystem_core-5bed8036644f552210a7cfcbed2d6d20cf2981b0.zip
system_core-5bed8036644f552210a7cfcbed2d6d20cf2981b0.tar.gz
system_core-5bed8036644f552210a7cfcbed2d6d20cf2981b0.tar.bz2
libutils: turn on -Werror
- Deal with some -Wunused issues - Override PRI macros (windows) - Revert use of PRI macros on off64_t (linux) - Deal with a gnu++11 complaince issue Change-Id: Ie66751293bd84477a5a6dfd8a57e700a16e36964
Diffstat (limited to 'libutils/RefBase.cpp')
-rw-r--r--libutils/RefBase.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/libutils/RefBase.cpp b/libutils/RefBase.cpp
index 385c226..02907ad 100644
--- a/libutils/RefBase.cpp
+++ b/libutils/RefBase.cpp
@@ -17,6 +17,14 @@
#define LOG_TAG "RefBase"
// #define LOG_NDEBUG 0
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <typeinfo>
+#include <unistd.h>
+
#include <utils/RefBase.h>
#include <utils/Atomic.h>
@@ -24,13 +32,9 @@
#include <utils/Log.h>
#include <utils/threads.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <typeinfo>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <unistd.h>
+#ifndef __unused
+#define __unused __attribute__((__unused__))
+#endif
// compile with refcounting debugging enabled
#define DEBUG_REFS 0
@@ -388,7 +392,7 @@ void RefBase::weakref_type::incWeak(const void* id)
{
weakref_impl* const impl = static_cast<weakref_impl*>(this);
impl->addWeakRef(id);
- const int32_t c = android_atomic_inc(&impl->mWeak);
+ const int32_t c __unused = android_atomic_inc(&impl->mWeak);
ALOG_ASSERT(c >= 0, "incWeak called on %p after last weak ref", this);
}
@@ -615,7 +619,7 @@ void RefBase::onLastStrongRef(const void* /*id*/)
{
}
-bool RefBase::onIncStrongAttempted(uint32_t flags, const void* id)
+bool RefBase::onIncStrongAttempted(uint32_t flags, const void* /*id*/)
{
return (flags&FIRST_INC_STRONG) ? true : false;
}
@@ -626,13 +630,15 @@ void RefBase::onLastWeakRef(const void* /*id*/)
// ---------------------------------------------------------------------------
-void RefBase::renameRefs(size_t n, const ReferenceRenamer& renamer) {
#if DEBUG_REFS
+void RefBase::renameRefs(size_t n, const ReferenceRenamer& renamer) {
for (size_t i=0 ; i<n ; i++) {
renamer(i);
}
-#endif
}
+#else
+void RefBase::renameRefs(size_t /*n*/, const ReferenceRenamer& /*renamer*/) { }
+#endif
void RefBase::renameRefId(weakref_type* ref,
const void* old_id, const void* new_id) {