Index: apps/plugins/pdbox/dbestfit-3.3/bysize.c =================================================================== --- apps/plugins/pdbox/dbestfit-3.3/bysize.c (revision 21081) +++ apps/plugins/pdbox/dbestfit-3.3/bysize.c (working copy) @@ -366,6 +366,7 @@ return x; } +#ifdef DEBUG int printtree(Tree * t, int d, char output) { int distance=0; @@ -395,6 +396,7 @@ distance += printtree(t->smaller, d+1, output); return distance; } +#endif /* DEBUG */ /* Here follow the look-alike interface so that the tree-function names are the same as the list-ones to enable easy interchange */ @@ -416,9 +418,11 @@ return (char *)receive; } +#ifdef DEBUG void print_sizes(void) { printtree(chunkHead, 0, 1); } +#endif /* DEBUG */ #endif Index: apps/plugins/pdbox/dbestfit-3.3/bmalloc.c =================================================================== --- apps/plugins/pdbox/dbestfit-3.3/bmalloc.c (revision 21081) +++ apps/plugins/pdbox/dbestfit-3.3/bmalloc.c (working copy) @@ -236,6 +236,7 @@ #define bmalloc_failed(x) #endif +#ifdef DEBUG void print_lists() { struct BlockInfo *block = blockHead; @@ -252,6 +253,7 @@ #endif print_sizes(); } +#endif /* DEBUG */ void *bmalloc(size_t size) { Index: apps/plugins/pdbox/dbestfit-3.3/dmalloc.c =================================================================== --- apps/plugins/pdbox/dbestfit-3.3/dmalloc.c (revision 21081) +++ apps/plugins/pdbox/dbestfit-3.3/dmalloc.c (working copy) @@ -23,8 +23,13 @@ * *****************************************************************************/ +#ifdef ROCKBOX +#include "plugin.h" +#define memset rb->memset +#else /* ROCKBOX */ #include #include +#endif /* ROCKBOX */ #ifdef DEBUG #include @@ -156,15 +161,23 @@ happy with us. */ -#if BIGBLOCKS==4060 /* previously */ +#if defined(BIGBLOCKS) && BIGBLOCKS==4060 /* previously */ +#ifdef ROCKBOX +unsigned +#endif /* ROCKBOX */ short qinfo[]= { 20, 28, 52, 116, 312, 580, 812, 2028 }; #else +#ifdef ROCKBOX +unsigned +#endif /* ROCKBOX */ short qinfo[]= { 20, 28, 52, 116, 312, 580, 1016, 2032}; /* 52 and 312 only make use of 4056 bytes, but without them there are too wide gaps */ #endif +#ifndef ROCKBOX #define MIN(x,y) ((x)<(y)?(x):(y)) +#endif /* ROCKBOX */ /* ---------------------------------------------------------------------- */ /* Globals */ @@ -335,6 +348,9 @@ **************************************************************************/ static void initialize(void) { +#ifdef ROCKBOX + unsigned +#endif /* ROCKBOX */ int i; /* Setup the nmax and fragsize fields of the top structs */ for(i=0; i< sizeof(qinfo)/sizeof(qinfo[0]); i++) { @@ -421,7 +437,11 @@ struct MemTop *memtop=NULL; /* SAFE */ /* Determine which queue to use */ +#ifdef ROCKBOX + unsigned +#endif /* ROCKBOX */ int queue; + for(queue=0; size > qinfo[queue]; queue++) ; do { @@ -622,7 +642,7 @@ * ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */ void *mem=NULL; /* SAFE */ - size_t prevsize; + size_t prevsize = 0; /* NOTE that this is only valid if BLOCK_BIT isn't set: */ struct MemBlock *block; Index: apps/plugins/pdbox/dbestfit-3.3/bmalloc.h =================================================================== --- apps/plugins/pdbox/dbestfit-3.3/bmalloc.h (revision 21081) +++ apps/plugins/pdbox/dbestfit-3.3/bmalloc.h (working copy) @@ -1,5 +1,5 @@ int add_pool(void *start, size_t size); -void print_lists(); +void print_lists(void); void *bmalloc(size_t size); void bfree(void *ptr); Index: apps/plugins/pdbox/dbestfit-3.3/dmalloc.h =================================================================== --- apps/plugins/pdbox/dbestfit-3.3/dmalloc.h (revision 21081) +++ apps/plugins/pdbox/dbestfit-3.3/dmalloc.h (working copy) @@ -5,3 +5,8 @@ #define malloc(x) dmalloc(x) #define free(x) dfree(x) #define realloc(x,y) drealloc(x,y) + +#ifdef ROCKBOX +void *dcalloc(size_t, size_t); +#define calloc(x,y) dcalloc(x,y) +#endif