Index: compiler-rt/trunk/lib/scudo/standalone/fuchsia.cpp =================================================================== --- compiler-rt/trunk/lib/scudo/standalone/fuchsia.cpp +++ compiler-rt/trunk/lib/scudo/standalone/fuchsia.cpp @@ -170,7 +170,7 @@ u32 getNumberOfCPUs() { return _zx_system_get_num_cpus(); } -bool getRandom(void *Buffer, uptr Length, bool Blocking) { +bool getRandom(void *Buffer, uptr Length, UNUSED bool Blocking) { COMPILER_CHECK(MaxRandomLength <= ZX_CPRNG_DRAW_MAX_LEN); if (UNLIKELY(!Buffer || !Length || Length > MaxRandomLength)) return false; Index: compiler-rt/trunk/lib/scudo/standalone/internal_defs.h =================================================================== --- compiler-rt/trunk/lib/scudo/standalone/internal_defs.h +++ compiler-rt/trunk/lib/scudo/standalone/internal_defs.h @@ -55,11 +55,11 @@ namespace scudo { typedef unsigned long uptr; -typedef signed long sptr; typedef unsigned char u8; typedef unsigned short u16; typedef unsigned int u32; typedef unsigned long long u64; +typedef signed long sptr; typedef signed char s8; typedef signed short s16; typedef signed int s32; @@ -128,8 +128,6 @@ #define COMPILER_CHECK(Pred) static_assert(Pred, "") -enum LinkerInitialized { LINKER_INITIALIZED = 0 }; - } // namespace scudo #endif // SCUDO_INTERNAL_DEFS_H_ Index: compiler-rt/trunk/lib/scudo/standalone/linux.cpp =================================================================== --- compiler-rt/trunk/lib/scudo/standalone/linux.cpp +++ compiler-rt/trunk/lib/scudo/standalone/linux.cpp @@ -43,7 +43,7 @@ void *map(void *Addr, uptr Size, UNUSED const char *Name, uptr Flags, UNUSED MapPlatformData *Data) { - int MmapFlags = MAP_PRIVATE | MAP_ANON; + int MmapFlags = MAP_PRIVATE | MAP_ANONYMOUS; int MmapProt; if (Flags & MAP_NOACCESS) { MmapFlags |= MAP_NORESERVE; Index: compiler-rt/trunk/lib/scudo/standalone/list.h =================================================================== --- compiler-rt/trunk/lib/scudo/standalone/list.h +++ compiler-rt/trunk/lib/scudo/standalone/list.h @@ -106,17 +106,17 @@ void checkConsistency() { if (Size == 0) { - CHECK_EQ(First, 0); - CHECK_EQ(Last, 0); + CHECK_EQ(First, nullptr); + CHECK_EQ(Last, nullptr); } else { - uptr count = 0; + uptr Count = 0; for (Item *I = First;; I = I->Next) { - count++; + Count++; if (I == Last) break; } - CHECK_EQ(size(), count); - CHECK_EQ(Last->Next, 0); + CHECK_EQ(size(), Count); + CHECK_EQ(Last->Next, nullptr); } } Index: compiler-rt/trunk/lib/scudo/standalone/quarantine.h =================================================================== --- compiler-rt/trunk/lib/scudo/standalone/quarantine.h +++ compiler-rt/trunk/lib/scudo/standalone/quarantine.h @@ -152,8 +152,8 @@ (TotalQuarantinedBytes == 0) ? 0 : TotalOverheadBytes * 100 / TotalQuarantinedBytes; - Printf("Global quarantine stats: batches: %zd; bytes: %zd (user: %zd); " - "chunks: %zd (capacity: %zd); %zd%% chunks used; %zd%% memory " + Printf("Global quarantine stats: batches: %zu; bytes: %zu (user: %zu); " + "chunks: %zu (capacity: %zu); %zu%% chunks used; %zu%% memory " "overhead\n", BatchCount, TotalBytes, TotalQuarantinedBytes, TotalQuarantineChunks, QuarantineChunksCapacity, ChunksUsagePercent, MemoryOverheadPercent); @@ -220,7 +220,7 @@ void printStats() const { // It assumes that the world is stopped, just as the allocator's printStats. - Printf("Quarantine limits: global: %zdM; thread local: %zdK\n", + Printf("Quarantine limits: global: %zuM; thread local: %zuK\n", getMaxSize() >> 20, getCacheSize() >> 10); Cache.printStats(); } Index: compiler-rt/trunk/lib/scudo/standalone/secondary.cpp =================================================================== --- compiler-rt/trunk/lib/scudo/standalone/secondary.cpp +++ compiler-rt/trunk/lib/scudo/standalone/secondary.cpp @@ -124,8 +124,8 @@ } void MapAllocator::printStats() const { - Printf("Stats: MapAllocator: allocated %zd times (%zdK), freed %zd times " - "(%zdK), remains %zd (%zdK) max %zdM\n", + Printf("Stats: MapAllocator: allocated %zu times (%zuK), freed %zu times " + "(%zuK), remains %zu (%zuK) max %zuM\n", NumberOfAllocs, AllocatedBytes >> 10, NumberOfFrees, FreedBytes >> 10, NumberOfAllocs - NumberOfFrees, (AllocatedBytes - FreedBytes) >> 10, LargestSize >> 20);