From c4fbbe06a53de3951c258978ffce1b1f185f8828 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Fri, 22 Apr 2011 11:13:35 -0700 Subject: [PATCH] libutils: Fix an improper const-cast in RefBase MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Under Fedora 15 Beta, gcc 4.6.0 warns: frameworks/base/libs/utils/RefBase.cpp: In member function ‘void android::RefBase::weakref_type::trackMe(bool, bool)’: frameworks/base/libs/utils/RefBase.cpp:483:67: error: passing ‘const android::RefBase::weakref_impl’ as ‘this’ argument of ‘void android::RefBase::weakref_impl::trackMe(bool, bool)’ discards qualifiers [-fpermissive] trackMe is not a const function, so don't use const in the static_cast to a weakref_impl pointer. Change-Id: I3c9ba73eb127985f5f54197ffecf2939c50f632c --- libs/utils/RefBase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp index 0bd1af4ebf18..d28b751a47f3 100644 --- a/libs/utils/RefBase.cpp +++ b/libs/utils/RefBase.cpp @@ -480,7 +480,7 @@ void RefBase::weakref_type::printRefs() const void RefBase::weakref_type::trackMe(bool enable, bool retain) { - static_cast(this)->trackMe(enable, retain); + static_cast(this)->trackMe(enable, retain); } RefBase::weakref_type* RefBase::createWeak(const void* id) const -- 2.11.0