svn commit: r223854 - head/lib/libstand
Tai-hwa Liang
avatar at FreeBSD.org
Fri Jul 8 01:35:34 UTC 2011
Author: avatar
Date: Fri Jul 8 01:35:33 2011
New Revision: 223854
URL: http://svn.freebsd.org/changeset/base/223854
Log:
Fixing building bustage on 32 bits platforms when WARNS >= 2. Note that
this fix only applies to zalloc.c, the other part of libstand such like
qdivrem.c still gives compilation warnings on sparc64 tinderbox builds;
therefore, WARNS level isn't changed for now.
Submitted by: Garrett Cooper <yanegomi at gmail.com>
Reviewed by: bde
Modified:
head/lib/libstand/zalloc.c
head/lib/libstand/zalloc_defs.h
Modified: head/lib/libstand/zalloc.c
==============================================================================
--- head/lib/libstand/zalloc.c Fri Jul 8 01:32:04 2011 (r223853)
+++ head/lib/libstand/zalloc.c Fri Jul 8 01:35:33 2011 (r223854)
@@ -154,7 +154,7 @@ zfree(MemPool *mp, void *ptr, iaddr_t by
if ((char *)ptr < (char *)mp->mp_Base ||
(char *)ptr + bytes > (char *)mp->mp_End ||
((iaddr_t)ptr & MEMNODE_SIZE_MASK) != 0)
- panic("zfree(%p,%ju): wild pointer", ptr, bytes);
+ panic("zfree(%p,%ju): wild pointer", ptr, (uintmax_t)bytes);
/*
* free the segment
@@ -177,8 +177,10 @@ zfree(MemPool *mp, void *ptr, iaddr_t by
/*
* range check
*/
- if ((char *)ptr + bytes > (char *)mn)
- panic("zfree(%p,%ju): corrupt memlist1",ptr, bytes);
+ if ((char *)ptr + bytes > (char *)mn) {
+ panic("zfree(%p,%ju): corrupt memlist1", ptr,
+ (uintmax_t)bytes);
+ }
/*
* merge against next area or create independant area
@@ -208,8 +210,10 @@ zfree(MemPool *mp, void *ptr, iaddr_t by
return;
/* NOT REACHED */
}
- if ((char *)ptr < (char *)mn + mn->mr_Bytes)
- panic("zfree(%p,%ju): corrupt memlist2", ptr, bytes);
+ if ((char *)ptr < (char *)mn + mn->mr_Bytes) {
+ panic("zfree(%p,%ju): corrupt memlist2", ptr,
+ (uintmax_t)bytes);
+ }
}
/*
* We are beyond the last MemNode, append new MemNode. Merge against
Modified: head/lib/libstand/zalloc_defs.h
==============================================================================
--- head/lib/libstand/zalloc_defs.h Fri Jul 8 01:32:04 2011 (r223853)
+++ head/lib/libstand/zalloc_defs.h Fri Jul 8 01:35:33 2011 (r223854)
@@ -39,6 +39,7 @@
#define ZALLOCDEBUG
#include <string.h>
+#include <sys/stdint.h>
#include "stand.h"
typedef uintptr_t iaddr_t; /* unsigned int same size as pointer */
More information about the svn-src-head
mailing list