# HG changeset patch # User Matti Hamalainen # Date 1353325810 -7200 # Node ID 1ed5025c253897f8de8fec22524cc56117402a83 # Parent 272e64259fdea2d06b6367f8dcfeff0a0a9402b9 Return DMLIB error values instead of arbitrary 0/negatives. diff -r 272e64259fde -r 1ed5025c2538 lib64gfx.c --- a/lib64gfx.c Mon Nov 19 13:49:44 2012 +0200 +++ b/lib64gfx.c Mon Nov 19 13:50:10 2012 +0200 @@ -441,14 +441,14 @@ { dmError("Invalid bank %d definition in generic decode operator %d @ #%d.\n", op->bank, op->type, i); - return -1; + return DMERR_INTERNAL; } if (op->type < 0 || op->type >= DT_LAST) { dmError("Invalid decode operator type %d @ #%d.\n", op->type, i); - return -1; + return DMERR_INTERNAL; } size = (op->size == 0) ? dmC64DefaultSizes[op->type] : op->size; @@ -457,7 +457,7 @@ { dmError("Decode out of bounds, op #%d type=%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x\n", i, op->type, op->offs, op->offs, op->bank, size, size, len, len); - return -2; + return DMERR_INVALID_DATA; } src = buf + op->offs; @@ -474,19 +474,19 @@ { dmError("Decode op is a function, but function ptr is NULL: op #%d, offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x\n", i, op->offs, op->offs, op->bank, size, size, len, len); - return -6; + return DMERR_INTERNAL; } if (!op->function(img, op, buf, len)) { dmError("Decode 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, len, len); - return -5; + return DMERR_INTERNAL; } break; } } - return 0; + return DMERR_OK; } @@ -522,7 +522,7 @@ dp += screen->pitch; } - return 0; + return DMERR_OK; } @@ -562,7 +562,7 @@ dp += screen->pitch; } - return 0; + return DMERR_OK; } @@ -612,7 +612,7 @@ dp += screen->pitch; } - return 0; + return DMERR_OK; }