# HG changeset patch # User Matti Hamalainen # Date 1353338681 -7200 # Node ID e2a76bb59888b2bd722459123902853287151d38 # Parent 6f141f760c5450cfeedc5c6a74f0206e951284fe Return better error values, using DMERR_* enums. diff -r 6f141f760c54 -r e2a76bb59888 lib64gfx.c --- a/lib64gfx.c Mon Nov 19 17:24:08 2012 +0200 +++ b/lib64gfx.c Mon Nov 19 17:24:41 2012 +0200 @@ -70,12 +70,12 @@ Uint8 *dp; if (img == NULL) - return -1; - if (xoffs < 0 || yoffs < 0) - return -2; - if (xoffs > img->width - widthpx || + return DMERR_NULLPTR; + + if (xoffs < 0 || yoffs < 0 || + xoffs > img->width - widthpx || yoffs > img->height - height) - return -3; + return DMERR_INVALID_ARGS; dp = img->data + (yoffs * img->pitch) + xoffs; @@ -121,7 +121,7 @@ } } - return 0; + return DMERR_OK; } @@ -634,7 +634,7 @@ return dmC64ConvertLaceMultiColorBMP(dst, src); default: - return -1; + return DMERR_NOT_SUPPORTED; } }