# HG changeset patch # User Matti Hamalainen # Date 1578588729 -7200 # Node ID f543475ea0ebc3be9716fd25150500865d4a9270 # Parent 5ffc48a0bebefd04bbb403823542e5c030b8c92e Rename some labels err -> out. diff -r 5ffc48a0bebe -r f543475ea0eb tools/lib64gfx.c --- a/tools/lib64gfx.c Thu Jan 09 18:51:22 2020 +0200 +++ b/tools/lib64gfx.c Thu Jan 09 18:52:09 2020 +0200 @@ -190,11 +190,11 @@ (img->bitmap = dmCalloc(img->nblocks, sizeof(DMC64MemBlock))) == NULL || (img->screen = dmCalloc(img->nblocks, sizeof(DMC64MemBlock))) == NULL || (img->charData = dmCalloc(img->nblocks, sizeof(DMC64MemBlock))) == NULL) - goto err; + goto out; return img; -err: +out: dmC64ImageFree(img); return NULL; } @@ -585,20 +585,20 @@ count = 0; if (!dmGrowBufPutU8(dst, cfg->rleMarkerW)) - goto err; + goto out; switch (cfg->flags & DM_RLE_ORDER_MASK) { case DM_RLE_ORDER_1: if (!dmGrowBufPutU16LE(dst, count) || !dmGrowBufPutU8(dst, data)) - goto err; + goto out; break; case DM_RLE_ORDER_2: if (!dmGrowBufPutU8(dst, data) || !dmGrowBufPutU16LE(dst, count)) - goto err; + goto out; break; } } @@ -610,20 +610,20 @@ count = 0; if (!dmGrowBufPutU8(dst, cfg->rleMarkerB)) - goto err; + goto out; switch (cfg->flags & DM_RLE_ORDER_MASK) { case DM_RLE_ORDER_1: if (!dmGrowBufPutU8(dst, count) || !dmGrowBufPutU8(dst, data)) - goto err; + goto out; break; case DM_RLE_ORDER_2: if (!dmGrowBufPutU8(dst, data) || !dmGrowBufPutU8(dst, count)) - goto err; + goto out; break; } } @@ -638,7 +638,7 @@ // and the lower bits contain the count: [Mask + count] [data] if (!dmGrowBufPutU8(dst, cfg->rleMarkerBits | count) || !dmGrowBufPutU8(dst, data)) - goto err; + goto out; } else copyOnly = TRUE; @@ -650,7 +650,7 @@ return DMERR_OK; -err: +out: return dmError(DMERR_MALLOC, "%s: RLE: Could not output RLE sequence %d x 0x%02x.\n", cfg->func, count, data); @@ -678,7 +678,7 @@ (((cfg->flags & DM_RLE_RUNS_MASK) == DM_RLE_BYTE_RUNS) && count >= cfg->rleMaxCountB)) { if ((res = dmEncodeGenericRLESequence(dst, prev, count, cfg)) != DMERR_OK) - goto err; + goto out; count = 1; } @@ -690,11 +690,11 @@ // If there is anything left in the output queue .. if ((res = dmEncodeGenericRLESequence(dst, prev, count, cfg)) != DMERR_OK) - goto err; + goto out; dmFinishRLEBuffers(dst, &src, cfg); -err: +out: return res; } @@ -1084,14 +1084,14 @@ dmError(res, "Could not allocate %d bytes of memory for C64 image encoding buffer.\n", fmt->size); - goto err; + goto out; } if (buf->backwards) { dmError(DMERR_INVALID_DATA, "Buffer specified for dmC64EncodeGenericBMP() is in backwards mode, which is not supported.\n"); - goto err; + goto out; } // Perform encoding @@ -1109,7 +1109,7 @@ // Check operation validity if ((res = dmC64SanityCheckEncDecOp(i, op, img)) != DMERR_OK) - goto err; + goto out; // Check flags if ((op->flags & DF_ENCODE) == 0) @@ -1123,7 +1123,7 @@ res = dmError(DMERR_MALLOC, "Could not re-allocate %d bytes of memory for C64 image encoding buffer.\n", chksize); - goto err; + goto out; } // Perform operation @@ -1152,7 +1152,7 @@ "'%s' block is NULL in " "op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", subjname, i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); - goto err; + goto out; } if (op->blkoffs + size > blk->size) { @@ -1160,7 +1160,7 @@ "'%s' size mismatch %d <> %d in " "op #%d, offs=%d ($%04x), bank=%d, offs2=%d ($%02x), size=%d ($%04x)\n", subjname, op->blkoffs + size, blk->size, i, op->offs, op->offs, op->bank, op->blkoffs, op->blkoffs, size, size); - goto err; + goto out; } memcpy(dst, blk->data + op->blkoffs, size); break; @@ -1241,7 +1241,7 @@ "Encode op custom function failed: op #%d, " "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); - goto err; + goto out; } break; } @@ -1249,7 +1249,7 @@ res = DMERR_OK; -err: +out: return res; } @@ -1631,11 +1631,11 @@ // Allocate a buffer if ((res = dmGrowBufAlloc(buf, BUF_SIZE_INITIAL, BUF_SIZE_GROW)) != DMERR_OK) - goto err; + goto out; // Add the loading address if (!dmGrowBufPutU16LE(buf, fmt->addr)) - goto err; + goto out; // Attempt to encode the image to a buffer if (fmt->encode != NULL) @@ -1644,7 +1644,7 @@ res = dmC64EncodeGenericBMP(FALSE, buf, img, fmt); if (res != DMERR_OK) - goto err; + goto out; // Finally, if the format has a set size and our buffer is smaller // than that size, we grow the buffer to match (with zeroed data). @@ -1653,12 +1653,12 @@ !dmGrowBufCheckGrow(buf, fmt->size)) { res = DMERR_MALLOC; - goto err; + goto out; } return DMERR_OK; -err: +out: // In error case, free the buffer dmGrowBufFree(buf); return res;