# HG changeset patch # User Matti Hamalainen # Date 1530201321 -10800 # Node ID c5a46cb4cce506a7432c209174950624cff6185a # Parent 10e82be38b8b72bb77dd678dd05eabf86e98b637 Change DMC64ImageFormat parameter of dmC64GetSubjectSize() and dmC64GetOpSubjectSize() to DMC64ImageCommonFormat. diff -r 10e82be38b8b -r c5a46cb4cce5 tools/gfxconv.c --- a/tools/gfxconv.c Thu Jun 28 18:39:26 2018 +0300 +++ b/tools/gfxconv.c Thu Jun 28 18:55:21 2018 +0300 @@ -1167,7 +1167,7 @@ if (op->type == DO_LAST) break; - size = dmC64GetOpSubjectSize(op, dstFmt); + size = dmC64GetOpSubjectSize(op, dstFmt->format); switch (op->type) { case DO_COPY: diff -r 10e82be38b8b -r c5a46cb4cce5 tools/lib64gfx.c --- a/tools/lib64gfx.c Thu Jun 28 18:39:26 2018 +0300 +++ b/tools/lib64gfx.c Thu Jun 28 18:55:21 2018 +0300 @@ -767,17 +767,17 @@ } -size_t dmC64GetSubjectSize(const int subject, const DMC64ImageFormat *fmt) +size_t dmC64GetSubjectSize(const int subject, const DMC64ImageCommonFormat *fmt) { switch (subject) { case DS_SCREEN_RAM: case DS_COLOR_RAM: - return fmt->format->chHeight * fmt->format->chWidth; + return fmt->chHeight * fmt->chWidth; break; case DS_BITMAP_RAM: - return fmt->format->chHeight * fmt->format->chWidth * 8; + return fmt->chHeight * fmt->chWidth * 8; break; case DS_CHAR_DATA: @@ -801,7 +801,7 @@ } -size_t dmC64GetOpSubjectSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt) +size_t dmC64GetOpSubjectSize(const DMC64EncDecOp *op, const DMC64ImageCommonFormat *fmt) { size_t size = dmC64GetSubjectSize(op->subject, fmt); @@ -888,7 +888,7 @@ return res; // Is the operation inside the bounds? - size = dmC64GetOpSubjectSize(op, fmt); + size = dmC64GetOpSubjectSize(op, fmt->format); if (op->type == DO_COPY && op->offs + size > buf->len + 1) { return dmError(DMERR_INVALID_DATA, @@ -1093,7 +1093,7 @@ goto err; // Do we need to reallocate some more space? - size = dmC64GetOpSubjectSize(op, fmt); + size = dmC64GetOpSubjectSize(op, fmt->format); chksize = buf->offs + op->offs + size; if (!dmGrowBufCheckGrow(buf, chksize)) { diff -r 10e82be38b8b -r c5a46cb4cce5 tools/lib64gfx.h --- a/tools/lib64gfx.h Thu Jun 28 18:39:26 2018 +0300 +++ b/tools/lib64gfx.h Thu Jun 28 18:55:21 2018 +0300 @@ -330,8 +330,8 @@ void dmC64GetOpMemBlock(const DMC64Image *img, const int subject, const int bank, const DMC64MemBlock **blk); int dmC64SanityCheckEncDecOp(const int i, const DMC64EncDecOp *op, const DMC64Image *img); -size_t dmC64GetSubjectSize(const int subject, const DMC64ImageFormat *fmt); -size_t dmC64GetOpSubjectSize(const DMC64EncDecOp *op, const DMC64ImageFormat *fmt); +size_t dmC64GetSubjectSize(const int subject, const DMC64ImageCommonFormat *fmt); +size_t dmC64GetOpSubjectSize(const DMC64EncDecOp *op, const DMC64ImageCommonFormat *fmt); int dmC64DecodeGenericBMP(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt);