Mercurial > hg > dmlib
comparison tools/lib64gfx.c @ 2114:27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 26 May 2019 02:43:08 +0300 |
parents | 3fcf1c3a3287 |
children | 51b8826bd4c1 |
comparison
equal
deleted
inserted
replaced
2113:3fcf1c3a3287 | 2114:27cf33c3a646 |
---|---|
1054 } | 1054 } |
1055 break; | 1055 break; |
1056 | 1056 |
1057 case DO_FUNC: | 1057 case DO_FUNC: |
1058 if (op->decFunction != NULL && | 1058 if (op->decFunction != NULL && |
1059 !op->decFunction(op, img, buf, fmt->format)) | 1059 (res = op->decFunction(op, img, buf, fmt->format)) != DMERR_OK) |
1060 { | 1060 { |
1061 return dmError(DMERR_INTERNAL, | 1061 return dmError(res, |
1062 "Decode op custom function failed: op #%d, " | 1062 "Decode op custom function failed: op #%d, " |
1063 "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", | 1063 "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", |
1064 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); | 1064 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); |
1065 } | 1065 } |
1066 break; | 1066 break; |
1234 } | 1234 } |
1235 break; | 1235 break; |
1236 | 1236 |
1237 case DO_FUNC: | 1237 case DO_FUNC: |
1238 if (op->encFunction != NULL && | 1238 if (op->encFunction != NULL && |
1239 !op->encFunction(op, buf, img, fmt->format)) | 1239 (res = op->encFunction(op, buf, img, fmt->format)) != DMERR_OK) |
1240 { | 1240 { |
1241 res = dmError(DMERR_INTERNAL, | 1241 dmErrorMsg( |
1242 "Encode op custom function failed: op #%d, " | 1242 "Encode op custom function failed: op #%d, " |
1243 "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", | 1243 "offs=%d ($%04x), bank=%d, size=%d ($%04x) @ %d ($%04x)\n", |
1244 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); | 1244 i, op->offs, op->offs, op->bank, size, size, buf->len, buf->len); |
1245 goto err; | 1245 goto err; |
1246 } | 1246 } |