diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2022-05-29 20:37:26 -0400 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2022-06-03 15:52:56 -0400 |
commit | c3ad9cf5b11772fbc9ff4dd793f0a7e897b5df5a (patch) | |
tree | d3bc8ae95c777e712e25b0e8c823f2d8c93d24ca /src/xftinit.c | |
parent | a9ce40d7f51dd20533d25e2a252afb1d09194d3f (diff) | |
download | xorg-lib-libXft-c3ad9cf5b11772fbc9ff4dd793f0a7e897b5df5a.tar.gz |
change the internal memory-allocator to use size_t
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
Diffstat (limited to 'src/xftinit.c')
-rw-r--r-- | src/xftinit.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/xftinit.c b/src/xftinit.c index 46196ab..0a52536 100644 --- a/src/xftinit.c +++ b/src/xftinit.c @@ -44,9 +44,9 @@ XftGetVersion (void) static struct { const char *name; int alloc_count; - int alloc_mem; + size_t alloc_mem; int free_count; - int free_mem; + size_t free_mem; } XftInUse[XFT_MEM_NUM] = { { "XftDraw", 0, 0, 0, 0 }, { "XftFont", 0, 0, 0, 0 }, @@ -54,12 +54,15 @@ static struct { { "XftGlyph", 0, 0, 0, 0 }, }; -static int XftAllocCount, XftAllocMem; -static int XftFreeCount, XftFreeMem; +static int XftAllocCount; +static size_t XftAllocMem; -static const int XftMemNotice = 1*1024*1024; +static int XftFreeCount; +static size_t XftFreeMem; -static int XftAllocNotify, XftFreeNotify; +static const size_t XftMemNotice = 1*1024*1024; + +static size_t XftAllocNotify, XftFreeNotify; _X_HIDDEN void XftMemReport (void) @@ -69,20 +72,20 @@ XftMemReport (void) printf ("\t Which Alloc Free\n"); printf ("\t count bytes count bytes\n"); for (i = 0; i < XFT_MEM_NUM; i++) - printf ("\t%8.8s%8d%8d%8d%8d\n", + printf ("\t%8.8s%8d%8lu%8d%8lu\n", XftInUse[i].name, - XftInUse[i].alloc_count, XftInUse[i].alloc_mem, - XftInUse[i].free_count, XftInUse[i].free_mem); - printf ("\t%8.8s%8d%8d%8d%8d\n", + XftInUse[i].alloc_count, (unsigned long) XftInUse[i].alloc_mem, + XftInUse[i].free_count, (unsigned long) XftInUse[i].free_mem); + printf ("\t%8.8s%8d%8lu%8d%8lu\n", "Total", - XftAllocCount, XftAllocMem, - XftFreeCount, XftFreeMem); + XftAllocCount, (unsigned long) XftAllocMem, + XftFreeCount, (unsigned long) XftFreeMem); XftAllocNotify = 0; XftFreeNotify = 0; } _X_HIDDEN void -XftMemAlloc (int kind, int size) +XftMemAlloc (int kind, size_t size) { if (XftDebug() & XFT_DBG_MEMORY) { @@ -97,7 +100,7 @@ XftMemAlloc (int kind, int size) } _X_HIDDEN void -XftMemFree (int kind, int size) +XftMemFree (int kind, size_t size) { if (XftDebug() & XFT_DBG_MEMORY) { |