Mercurial > hg > dmlib
changeset 1656:2de258f2eb2e
Get rid of a basically redundant function in IFF reader.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 30 May 2018 13:21:14 +0300 |
parents | a05e3fcc60ec |
children | 2b6dbdd602b5 |
files | tools/libgfx.c |
diffstat | 1 files changed, 11 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/libgfx.c Wed May 30 13:20:40 2018 +0300 +++ b/tools/libgfx.c Wed May 30 13:21:14 2018 +0300 @@ -1449,7 +1449,7 @@ Uint32 id; Uint32 size; int count; - char str[6]; + char idStr[6]; } DMIFFChunk; @@ -1507,18 +1507,16 @@ "ILBM: Could not read IFF chunk header.\n"); } else + { + chunk->idStr[0] = (chunk->id >> 24) & 0xff; + chunk->idStr[1] = (chunk->id >> 16) & 0xff; + chunk->idStr[2] = (chunk->id >> 8) & 0xff; + chunk->idStr[3] = (chunk->id) & 0xff; + chunk->idStr[4] = 0; return DMERR_OK; + } } -static char * dmGetIFFChunkID(DMIFFChunk *chunk) -{ - chunk->str[0] = (chunk->id >> 24) & 0xff; - chunk->str[1] = (chunk->id >> 16) & 0xff; - chunk->str[2] = (chunk->id >> 8) & 0xff; - chunk->str[3] = (chunk->id) & 0xff; - chunk->str[4] = 0; - return chunk->str; -} static int dmSkipIFFChunkRest(DMResource *fp, const DMIFFChunk *chunk, const Uint32 used) { @@ -1539,6 +1537,7 @@ return DMERR_OK; } + static int dmCheckIFFChunk(DMIFFChunk *dest, DMIFFChunk *chunk, const BOOL multi, const Uint32 minSize) { @@ -1546,7 +1545,7 @@ { return dmError(DMERR_INVALID_DATA, "ILBM: Multiple instances of chunk %s found.\n", - dmGetIFFChunkID(chunk)); + chunk->idStr); } dest->count++; @@ -1918,7 +1917,7 @@ default: { dmMsg(4, "Unknown chunk ID '%s', size %d\n", - dmGetIFFChunkID(&chunk), chunk.size); + chunk.idStr, chunk.size); if (dmfseek(fp, chunk.size, SEEK_CUR) != 0) {