[scudo] Fix static and unused function type annotations

Differential Revision: https://reviews.llvm.org/D121855
This commit is contained in:
Dominic Chen 2022-03-16 13:46:23 -07:00
parent 26a5f9bd03
commit 58a583c229
3 changed files with 7 additions and 7 deletions

View File

@ -345,7 +345,7 @@ template <typename SCMap> inline void printMap() {
Buffer.output(); Buffer.output();
} }
template <typename SCMap> static void validateMap() { template <typename SCMap> static UNUSED void validateMap() {
for (uptr C = 0; C < SCMap::NumClasses; C++) { for (uptr C = 0; C < SCMap::NumClasses; C++) {
if (C == SCMap::BatchClassId) if (C == SCMap::BatchClassId)
continue; continue;

View File

@ -12,7 +12,7 @@
#include <string.h> #include <string.h>
scudo::u16 computeSoftwareChecksum(scudo::u32 Seed, scudo::uptr *Array, static scudo::u16 computeSoftwareChecksum(scudo::u32 Seed, scudo::uptr *Array,
scudo::uptr ArraySize) { scudo::uptr ArraySize) {
scudo::u16 Checksum = static_cast<scudo::u16>(Seed & 0xffff); scudo::u16 Checksum = static_cast<scudo::u16>(Seed & 0xffff);
for (scudo::uptr I = 0; I < ArraySize; I++) for (scudo::uptr I = 0; I < ArraySize; I++)
@ -20,7 +20,7 @@ scudo::u16 computeSoftwareChecksum(scudo::u32 Seed, scudo::uptr *Array,
return Checksum; return Checksum;
} }
scudo::u16 computeHardwareChecksum(scudo::u32 Seed, scudo::uptr *Array, static scudo::u16 computeHardwareChecksum(scudo::u32 Seed, scudo::uptr *Array,
scudo::uptr ArraySize) { scudo::uptr ArraySize) {
scudo::u32 Crc = Seed; scudo::u32 Crc = Seed;
for (scudo::uptr I = 0; I < ArraySize; I++) for (scudo::uptr I = 0; I < ArraySize; I++)
@ -32,7 +32,7 @@ typedef scudo::u16 (*ComputeChecksum)(scudo::u32, scudo::uptr *, scudo::uptr);
// This verifies that flipping bits in the data being checksummed produces a // This verifies that flipping bits in the data being checksummed produces a
// different checksum. We do not use random data to avoid flakyness. // different checksum. We do not use random data to avoid flakyness.
template <ComputeChecksum F> void verifyChecksumFunctionBitFlip() { template <ComputeChecksum F> static void verifyChecksumFunctionBitFlip() {
scudo::uptr Array[sizeof(scudo::u64) / sizeof(scudo::uptr)]; scudo::uptr Array[sizeof(scudo::u64) / sizeof(scudo::uptr)];
const scudo::uptr ArraySize = ARRAY_SIZE(Array); const scudo::uptr ArraySize = ARRAY_SIZE(Array);
memset(Array, 0xaa, sizeof(Array)); memset(Array, 0xaa, sizeof(Array));

View File

@ -87,7 +87,7 @@ template <class Allocator> struct TSDRegistryExT {
Mutex.unlock(); Mutex.unlock();
} }
bool setOption(Option O, UNUSED sptr Value) { bool setOption(Option O, sptr Value) {
if (O == Option::ThreadDisableMemInit) if (O == Option::ThreadDisableMemInit)
State.DisableMemInit = Value; State.DisableMemInit = Value;
if (O == Option::MaxTSDsCount) if (O == Option::MaxTSDsCount)