Commit 49d89ca0 authored by Jeff Muizelaar's avatar Jeff Muizelaar

2005-05-01 Jeff Muizelaar <jeff@infidigm.net>

	* goo/gmem.c: (gmalloc), (grealloc), (gfree):
	* goo/gmem.h: make memory functions use size_t instead of int.

	Patch from Takashi Iwai through Albert Astals Cid.
parent 14d618be
2005-05-01 Jeff Muizelaar <jeff@infidigm.net>
* goo/gmem.c: (gmalloc), (grealloc), (gfree):
* goo/gmem.h: make memory functions use size_t instead of int.
Patch from Takashi Iwai through Albert Astals Cid.
2005-04-30 Jeff Muizelaar <jeff@infidigm.net>
* qt/poppler-document.cc (Document::unlock) :
......
......@@ -53,9 +53,9 @@ static int gMemAlloc = 0;
#endif /* DEBUG_MEM */
void *gmalloc(int size) {
void *gmalloc(size_t size) {
#ifdef DEBUG_MEM
int size1;
size_t size1;
char *mem;
GMemHdr *hdr;
void *data;
......@@ -94,11 +94,11 @@ void *gmalloc(int size) {
#endif
}
void *grealloc(void *p, int size) {
void *grealloc(void *p, size_t size) {
#ifdef DEBUG_MEM
GMemHdr *hdr;
void *q;
int oldSize;
size_t oldSize;
if (size == 0) {
if (p)
......@@ -137,7 +137,7 @@ void *grealloc(void *p, int size) {
void gfree(void *p) {
#ifdef DEBUG_MEM
int size;
size_t size;
GMemHdr *hdr;
GMemHdr *prevHdr, *q;
int lst;
......
......@@ -19,13 +19,13 @@ extern "C" {
* Same as malloc, but prints error message and exits if malloc()
* returns NULL.
*/
extern void *gmalloc(int size);
extern void *gmalloc(size_t size);
/*
* Same as realloc, but prints error message and exits if realloc()
* returns NULL. If <p> is NULL, calls malloc instead of realloc().
*/
extern void *grealloc(void *p, int size);
extern void *grealloc(void *p, size_t size);
/*
* Same as free, but checks for and ignores NULL pointers.
......
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