# HG changeset patch # User Matti Hamalainen # Date 1509239329 -7200 # Node ID fe17380576accd2f7290a3656361ff640f8760c8 # Parent 77d6e13fb95e37cd7a6cac7c672d6a6cbdd5987c Remove unused function from the lib. diff -r 77d6e13fb95e -r fe17380576ac libmaputils.c --- a/libmaputils.c Sun Oct 29 03:08:25 2017 +0200 +++ b/libmaputils.c Sun Oct 29 03:08:49 2017 +0200 @@ -819,39 +819,3 @@ fputc(0xff, fh); } } - - -int mapBlockGetEntropy(const MapBlock *map, const unsigned char *exclude, const int nexclude) -{ - unsigned char *list; - int num, i; - - // Allocate memory for entropy array - if ((list = th_malloc0(256)) == NULL) - return -1; - - // Collect sums into entropy array - for (int y = 0; y < map->height; y++) - { - unsigned char *c = map->data + (y * map->scansize); - for (int x = 0; x < map->width; x++) - { - list[*c]++; - c++; - } - } - - // Handle exclusions - if (exclude != NULL && nexclude > 0) - { - for (i = 0; i < nexclude; i++) - list[(int) exclude[i]] = 0; - } - - // Calculate simple entropy - for (num = 0, i = 0; i < 256; i++) - if (list[i]) num++; - - th_free(list); - return num; -} diff -r 77d6e13fb95e -r fe17380576ac libmaputils.h --- a/libmaputils.h Sun Oct 29 03:08:25 2017 +0200 +++ b/libmaputils.h Sun Oct 29 03:08:49 2017 +0200 @@ -124,7 +124,6 @@ int mapBlockPut(MapBlock **pmap, const MapBlock *src, const int ox, const int oy); void mapBlockClean(MapBlock *block, const char *symbols); void mapBlockPrintRaw(FILE *fh, const MapBlock *block); -int mapBlockGetEntropy(const MapBlock *map, const unsigned char *exclude, const int nexclude); #endif