projects
/
yaz-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
NMEM: Update API to use size_t for sizes
[yaz-moved-to-github.git]
/
src
/
nmem.c
diff --git
a/src/nmem.c
b/src/nmem.c
index
93988b5
..
4b6d0a4
100644
(file)
--- a/
src/nmem.c
+++ b/
src/nmem.c
@@
-10,8
+10,6
@@
* This is a simple and fairly wasteful little module for nibble memory
* allocation. Evemtually we'll put in something better.
*
* This is a simple and fairly wasteful little module for nibble memory
* allocation. Evemtually we'll put in something better.
*
- * FIXME - it also has some semaphore stuff, and stuff to handle errno.
- * These should be moved to some other place!
*/
#if HAVE_CONFIG_H
#include <config.h>
*/
#if HAVE_CONFIG_H
#include <config.h>
@@
-38,7
+36,7
@@
struct nmem_block
struct nmem_control
{
struct nmem_control
{
- int total;
+ size_t total;
struct nmem_block *blocks;
struct nmem_control *next;
};
struct nmem_block *blocks;
struct nmem_control *next;
};
@@
-111,7
+109,7
@@
void nmem_reset(NMEM n)
n->total = 0;
}
n->total = 0;
}
-void *nmem_malloc(NMEM n, int size)
+void *nmem_malloc(NMEM n, size_t size)
{
struct nmem_block *p;
char *r;
{
struct nmem_block *p;
char *r;
@@
-135,7
+133,7
@@
void *nmem_malloc(NMEM n, int size)
return r;
}
return r;
}
-int nmem_total(NMEM n)
+size_t nmem_total(NMEM n)
{
return n->total;
}
{
return n->total;
}