[Box Backup-commit] COMMIT r1143 - box/chris/merge/lib/common

boxbackup-dev at fluffy.co.uk boxbackup-dev at fluffy.co.uk
Mon Nov 6 20:47:15 GMT 2006


Author: chris
Date: 2006-11-06 20:47:15 +0000 (Mon, 06 Nov 2006)
New Revision: 1143

Modified:
   box/chris/merge/lib/common/DebugMemLeakFinder.cpp
Log:
Fix compile warnings (refs #3)


Modified: box/chris/merge/lib/common/DebugMemLeakFinder.cpp
===================================================================
--- box/chris/merge/lib/common/DebugMemLeakFinder.cpp	2006-11-06 20:45:32 UTC (rev 1142)
+++ box/chris/merge/lib/common/DebugMemLeakFinder.cpp	2006-11-06 20:47:15 UTC (rev 1143)
@@ -55,7 +55,7 @@
 	static std::set<void *> sNotLeaks;
 
 	void *sNotLeaksPre[1024];
-	int sNotLeaksPreNum = 0;
+	size_t sNotLeaksPreNum = 0;
 }
 
 void memleakfinder_malloc_add_block(void *b, size_t size, const char *file, int line)
@@ -161,7 +161,7 @@
 void memleakfinder_notaleak_insert_pre()
 {
 	if(!memleakfinder_global_enable) return;
-	for(int l = 0; l < sNotLeaksPreNum; l++)
+	for(size_t l = 0; l < sNotLeaksPreNum; l++)
 	{
 		sNotLeaks.insert(sNotLeaksPre[l]);
 	}
@@ -184,7 +184,7 @@
 	else
 	{
 		if ( sNotLeaksPreNum < 
-			 (unsigned)( sizeof(sNotLeaksPre)/sizeof(*sNotLeaksPre) ) )
+			 sizeof(sNotLeaksPre)/sizeof(*sNotLeaksPre) )
 			sNotLeaksPre[sNotLeaksPreNum++] = ptr;
 	}
 /*	{
@@ -255,11 +255,11 @@
 {
 	for(std::map<void *, MallocBlockInfo>::const_iterator i(sMallocBlocks.begin()); i != sMallocBlocks.end(); ++i)
 	{
-		if(is_leak(i->first)) ::fprintf(file, "Block 0x%08p size %d allocated at %s:%d\n", i->first, i->second.size, i->second.file, i->second.line);
+		if(is_leak(i->first)) ::fprintf(file, "Block 0x%p size %d allocated at %s:%d\n", i->first, i->second.size, i->second.file, i->second.line);
 	}
 	for(std::map<void *, ObjectInfo>::const_iterator i(sObjectBlocks.begin()); i != sObjectBlocks.end(); ++i)
 	{
-		if(is_leak(i->first)) ::fprintf(file, "Object%s 0x%08p size %d allocated at %s:%d\n", i->second.array?" []":"", i->first, i->second.size, i->second.file, i->second.line);
+		if(is_leak(i->first)) ::fprintf(file, "Object%s 0x%p size %d allocated at %s:%d\n", i->second.array?" []":"", i->first, i->second.size, i->second.file, i->second.line);
 	}
 }
 




More information about the Boxbackup-commit mailing list