# HG changeset patch # User Matti Hamalainen # Date 1569226479 -10800 # Node ID ae938889eafbef6fc8e144025808284a48d05d7f # Parent 8f4cfe59b2bba9b767a4ce6a6774cb7a9853b78b Make dmC64ConvertGenericBMP2Image() and dmC64ConvertGenericImage2BMP() static. diff -r 8f4cfe59b2bb -r ae938889eafb tools/lib64gfx.c --- a/tools/lib64gfx.c Mon Sep 23 11:11:33 2019 +0300 +++ b/tools/lib64gfx.c Mon Sep 23 11:14:39 2019 +0300 @@ -1398,7 +1398,7 @@ // Convert a C64 format bitmap in DMC64Image struct to // a indexed/paletted bitmap image. -int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageConvSpec *spec) +static int dmC64ConvertGenericBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageConvSpec *spec) { DMC64GetPixelFunc getPixel; @@ -1448,17 +1448,19 @@ } -int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageConvSpec *spec) +int dmC64ConvertBMP2Image(DMImage **pdst, const DMC64Image *src, const DMC64ImageConvSpec *pspec) { - DMImage *dst; + DMC64ImageConvSpec spec; BOOL mixed; int res; - if (pdst == NULL || src == NULL || spec == NULL) + if (pdst == NULL || src == NULL || pspec == NULL) return DMERR_NULLPTR; + memcpy(&spec, pspec, sizeof(spec)); + // Allocate image structure - if ((*pdst = dst = dmImageAlloc( + if ((*pdst = dmImageAlloc( src->fmt->width, src->fmt->height, DM_PIXFMT_PALETTE, -1)) == NULL) return DMERR_MALLOC; @@ -1466,14 +1468,14 @@ mixed = (src->extraInfo[D64_EI_MODE] & D64_FMT_ILACE) && src->extraInfo[D64_EI_ILACE_TYPE] == D64_ILACE_COLOR; - if ((res = dmC64SetImagePalette(dst, spec, mixed)) != DMERR_OK) + if ((res = dmC64SetImagePalette(*pdst, &spec, mixed)) != DMERR_OK) return res; // Convert if (src->fmt->convertFrom != NULL) - res = src->fmt->convertFrom(dst, src, spec); + res = src->fmt->convertFrom(*pdst, src, &spec); else - res = dmC64ConvertGenericBMP2Image(dst, src, spec); + res = dmC64ConvertGenericBMP2Image(*pdst, src, &spec); return res; } @@ -1545,7 +1547,7 @@ // Convert a generic bitmap image to DMC64Image -int dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, +static int dmC64ConvertGenericImage2BMP(DMC64Image *dst, const DMImage *src, const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) { if (dst == NULL || src == NULL || fmt == NULL || spec == NULL)