Commit 8599e70d authored by Daniel Veillard's avatar Daniel Veillard

debugging on IA64, fixed serious troubles due to size_t vs. int mismatch

* xmlmemory.c include/libxml/xmlmemory.h: debugging on IA64,
  fixed serious troubles due to size_t vs. int mismatch
Daniel
parent 8fcc494e
Tue Jul 17 17:36:46 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* xmlmemory.c include/libxml/xmlmemory.h: debugging on IA64,
fixed serious troubles due to size_t vs. int mismatch
Tue Jul 17 16:04:36 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr> Tue Jul 17 16:04:36 EDT 2001 Daniel Veillard <Daniel.Veillard@imag.fr>
* SAX.c xmlIO.c: cleaned up some warning on the Alpha * SAX.c xmlIO.c: cleaned up some warning on the Alpha
......
...@@ -51,8 +51,8 @@ extern "C" { ...@@ -51,8 +51,8 @@ extern "C" {
* The XML memory wrapper support 4 basic overloadable functions * The XML memory wrapper support 4 basic overloadable functions
*/ */
typedef void (*xmlFreeFunc)(void *); typedef void (*xmlFreeFunc)(void *);
typedef void *(*xmlMallocFunc)(int); typedef void *(*xmlMallocFunc)(size_t);
typedef void *(*xmlReallocFunc)(void *, int); typedef void *(*xmlReallocFunc)(void *, size_t);
typedef char *(*xmlStrdupFunc)(const char *); typedef char *(*xmlStrdupFunc)(const char *);
/* /*
...@@ -94,8 +94,8 @@ int xmlInitMemory (void); ...@@ -94,8 +94,8 @@ int xmlInitMemory (void);
#define xmlRealloc(p, x) xmlReallocLoc((p), (x), __FILE__, __LINE__) #define xmlRealloc(p, x) xmlReallocLoc((p), (x), __FILE__, __LINE__)
#define xmlMemStrdup(x) xmlMemStrdupLoc((x), __FILE__, __LINE__) #define xmlMemStrdup(x) xmlMemStrdupLoc((x), __FILE__, __LINE__)
void * xmlMallocLoc(int size, const char *file, int line); void * xmlMallocLoc(size_t size, const char *file, int line);
void * xmlReallocLoc(void *ptr,int size, const char *file, int line); void * xmlReallocLoc(void *ptr,size_t size, const char *file, int line);
char * xmlMemStrdupLoc(const char *str, const char *file, int line); char * xmlMemStrdupLoc(const char *str, const char *file, int line);
#endif /* DEBUG_MEMORY_LOCATION */ #endif /* DEBUG_MEMORY_LOCATION */
......
...@@ -29,9 +29,9 @@ ...@@ -29,9 +29,9 @@
#include <libxml/xmlerror.h> #include <libxml/xmlerror.h>
void xmlMallocBreakpoint(void); void xmlMallocBreakpoint(void);
void * xmlMemMalloc(int size); void * xmlMemMalloc(size_t size);
void * xmlMallocLoc(int size, const char * file, int line); void * xmlMallocLoc(size_t size, const char * file, int line);
void * xmlMemRealloc(void *ptr,int size); void * xmlMemRealloc(void *ptr,size_t size);
void xmlMemFree(void *ptr); void xmlMemFree(void *ptr);
char * xmlMemoryStrdup(const char *str); char * xmlMemoryStrdup(const char *str);
...@@ -137,7 +137,7 @@ xmlMallocBreakpoint(void) { ...@@ -137,7 +137,7 @@ xmlMallocBreakpoint(void) {
*/ */
void * void *
xmlMallocLoc(int size, const char * file, int line) xmlMallocLoc(size_t size, const char * file, int line)
{ {
MEMHDR *p; MEMHDR *p;
...@@ -191,7 +191,7 @@ xmlMallocLoc(int size, const char * file, int line) ...@@ -191,7 +191,7 @@ xmlMallocLoc(int size, const char * file, int line)
*/ */
void * void *
xmlMemMalloc(int size) xmlMemMalloc(size_t size)
{ {
return(xmlMallocLoc(size, "none", 0)); return(xmlMallocLoc(size, "none", 0));
} }
...@@ -209,7 +209,7 @@ xmlMemMalloc(int size) ...@@ -209,7 +209,7 @@ xmlMemMalloc(int size)
*/ */
void * void *
xmlReallocLoc(void *ptr,int size, const char * file, int line) xmlReallocLoc(void *ptr,size_t size, const char * file, int line)
{ {
MEMHDR *p; MEMHDR *p;
unsigned long number; unsigned long number;
...@@ -264,7 +264,7 @@ error: ...@@ -264,7 +264,7 @@ error:
*/ */
void * void *
xmlMemRealloc(void *ptr,int size) { xmlMemRealloc(void *ptr,size_t size) {
return(xmlReallocLoc(ptr, size, "none", 0)); return(xmlReallocLoc(ptr, size, "none", 0));
} }
...@@ -304,7 +304,7 @@ xmlMemFree(void *ptr) ...@@ -304,7 +304,7 @@ xmlMemFree(void *ptr)
error: error:
xmlGenericError(xmlGenericErrorContext, xmlGenericError(xmlGenericErrorContext,
"xmlFree(%X) error\n", (unsigned int) ptr); "xmlFree(%lX) error\n", (unsigned long) ptr);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment