Mercurial > hg > dmlib
changeset 1622:009a3e3c54bf
Cleanups.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 16 May 2018 13:49:40 +0300 |
parents | 9aaa8ee24626 |
children | 4c89840a5c89 |
files | tools/libgfx.c |
diffstat | 1 files changed, 8 insertions(+), 8 deletions(-) [+] |
line wrap: on
line diff
--- a/tools/libgfx.c Wed May 16 13:42:40 2018 +0300 +++ b/tools/libgfx.c Wed May 16 13:49:40 2018 +0300 @@ -299,7 +299,7 @@ int dmWriteRAWImageFILE(DMResource *fp, const DMImage *img, const DMImageConvSpec *spec) { - int xc, yc, plane, res; + int res; DMBitStreamContext bs; if ((res = dmInitBitStreamFILE(&bs, fp)) != DMERR_OK) @@ -309,11 +309,11 @@ { // Output bitplanes in planar format // (each plane of line sequentially) - for (yc = 0; yc < img->height; yc++) - for (plane = 0; plane < spec->nplanes; plane++) + for (int yc = 0; yc < img->height; yc++) + for (int plane = 0; plane < spec->nplanes; plane++) { Uint8 *sp = img->data + yc * img->pitch; - for (xc = 0; xc < img->width; xc++) + for (int xc = 0; xc < img->width; xc++) { if (!dmPutBits(&bs, (sp[xc] & (1 << plane)) ? 1 : 0, 1)) return DMERR_FWRITE; @@ -323,11 +323,11 @@ else { // Output each bitplane in sequence - for (plane = 0; plane < spec->nplanes; plane++) - for (yc = 0; yc < img->height; yc++) + for (int plane = 0; plane < spec->nplanes; plane++) + for (int yc = 0; yc < img->height; yc++) { Uint8 *sp = img->data + yc * img->pitch; - for (xc = 0; xc < img->width; xc++) + for (int xc = 0; xc < img->width; xc++) { if (!dmPutBits(&bs, (sp[xc] & (1 << plane)) ? 1 : 0, 1)) return DMERR_FWRITE; @@ -1601,7 +1601,7 @@ } -static inline Uint8 dmDecodeBit(const Uint8 *src, const int xc) +static inline Uint8 dmDecodeBit(const Uint8 *buf, const int xc) { return (buf[xc / 8] >> (7 - (xc & 7))) & 1; }