From 0e99daec552ec1e1a08562ecad53d660a8e53b17 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 22 Apr 2022 01:25:08 +0000 Subject: [PATCH] Bug 1765474 - Fix unused-but-set-variable warning in TestBaseProfiler.cpp. r=gerald mozglue/tests/TestBaseProfiler.cpp:2188:12: error: variable 'chunk1ReuseCount' set but not used [-Werror,-Wunused-but-set-variable] unsigned chunk1ReuseCount = 0; ^ Differential Revision: https://phabricator.services.mozilla.com/D144146 --- mozglue/tests/TestBaseProfiler.cpp | 8 -------- 1 file changed, 8 deletions(-) diff --git a/mozglue/tests/TestBaseProfiler.cpp b/mozglue/tests/TestBaseProfiler.cpp index 7e5ab5c728e9..5454354f04f0 100644 --- a/mozglue/tests/TestBaseProfiler.cpp +++ b/mozglue/tests/TestBaseProfiler.cpp @@ -2157,8 +2157,6 @@ static void TestControlledChunkManagerWithLocalLimit() { MOZ_RELEASE_ASSERT(!!chunk, "First chunk immediate request should always work"); const auto chunkActualBufferBytes = chunk->BufferBytes(); - // Keep address, for later checks. - const uintptr_t chunk1Address = reinterpret_cast(chunk.get()); MOZ_RELEASE_ASSERT(updateCount == 1, "GetChunk should have triggered an update"); MOZ_RELEASE_ASSERT( @@ -2185,8 +2183,6 @@ static void TestControlledChunkManagerWithLocalLimit() { ProfileBufferChunk::Length previousReleasedBytes = 0; TimeStamp previousOldestDoneTimeStamp; - unsigned chunk1ReuseCount = 0; - // We will do enough loops to go through the maximum size a number of times. const unsigned Rollovers = 3; const unsigned Loops = Rollovers * MaxTotalBytes / chunkActualBufferBytes; @@ -2268,10 +2264,6 @@ static void TestControlledChunkManagerWithLocalLimit() { // And cycle to the new chunk. chunk = std::move(newChunk); - - if (reinterpret_cast(chunk.get()) == chunk1Address) { - ++chunk1ReuseCount; - } } // Enough testing! Clean-up.