[libxml2] xmlmemory: add a cast as size_t has no portable printf modifier
- From: Stefan Kost <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libxml2] xmlmemory: add a cast as size_t has no portable printf modifier
- Date: Mon, 9 May 2011 09:34:08 +0000 (UTC)
commit ecb5d5afdc8acceba608524f6e98c361fd2ce0e9
Author: Stefan Kost <ensonic users sf net>
Date: Fri May 6 17:40:10 2011 +0300
xmlmemory: add a cast as size_t has no portable printf modifier
Also use %lu as that is more appropriate for size_t.
xmlmemory.c | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/xmlmemory.c b/xmlmemory.c
index 433abb8..a0ab953 100644
--- a/xmlmemory.c
+++ b/xmlmemory.c
@@ -205,7 +205,8 @@ xmlMallocLoc(size_t size, const char * file, int line)
if (xmlMemTraceBlockAt == ret) {
xmlGenericError(xmlGenericErrorContext,
- "%p : Malloc(%ld) Ok\n", xmlMemTraceBlockAt, size);
+ "%p : Malloc(%lu) Ok\n", xmlMemTraceBlockAt,
+ (long unsigned)size);
xmlMallocBreakpoint();
}
@@ -273,7 +274,8 @@ xmlMallocAtomicLoc(size_t size, const char * file, int line)
if (xmlMemTraceBlockAt == ret) {
xmlGenericError(xmlGenericErrorContext,
- "%p : Malloc(%ld) Ok\n", xmlMemTraceBlockAt, size);
+ "%p : Malloc(%lu) Ok\n", xmlMemTraceBlockAt,
+ (long unsigned)size);
xmlMallocBreakpoint();
}
@@ -348,8 +350,9 @@ xmlReallocLoc(void *ptr,size_t size, const char * file, int line)
}
if (xmlMemTraceBlockAt == ptr) {
xmlGenericError(xmlGenericErrorContext,
- "%p : Realloced(%ld -> %ld) Ok\n",
- xmlMemTraceBlockAt, p->mh_size, size);
+ "%p : Realloced(%lu -> %lu) Ok\n",
+ xmlMemTraceBlockAt, (long unsigned)p->mh_size,
+ (long unsigned)size);
xmlMallocBreakpoint();
}
p->mh_tag = MEMTAG;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]