# HG changeset patch # User Matti Hamalainen # Date 1353334447 -7200 # Node ID c9b9f912acfbff18aebe9f1cf3cead74c7fd8ac1 # Parent 486067f39bc16ed7ba8ea26a6ea78bcb8da9d8b1 Cleanups. diff -r 486067f39bc1 -r c9b9f912acfb lib64gfx.c --- a/lib64gfx.c Mon Nov 19 16:10:37 2012 +0200 +++ b/lib64gfx.c Mon Nov 19 16:14:07 2012 +0200 @@ -8,6 +8,9 @@ */ #include "lib64gfx.h" +#define BUF_SIZE_INITIAL (16*1024) +#define BUF_SIZE_GROW (4*1024) + const char *dmC64ImageTypeNames[DM_C64IFMT_LAST_TYPE] = { @@ -53,6 +56,12 @@ +static BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr) +{ + return (buf[offs] == (addr & 0xff)) && (buf[offs + 1] == ((addr >> 8) & 0xff)); +} + + int dmC64ConvertCSData(DMImage *img, int xoffs, int yoffs, const Uint8 *buf, int width, int height, BOOL multicolor, int *colors) @@ -116,12 +125,6 @@ } -static BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr) -{ - return (buf[offs] == (addr & 0xff)) && (buf[offs + 1] == ((addr >> 8) & 0xff)); -} - - static int fmtProbeDrazPaint20Packed(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) { const char *ident = (const char *) buf + 2; @@ -636,8 +639,6 @@ } -#define BUF_SIZE_INITIAL (16*1024) -#define BUF_SIZE_GROW (8*1024) int dmReadDataFile(FILE *inFile, const char *filename, Uint8 **pbuf, size_t *pbufSize) {