libansilove

Library for converting ANSI, ASCII, and other formats to PNG
Log | Files | Refs | README | LICENSE

commit b7fa0f5eeeed8e6276f96a90d60fa63f3ec0e04a
parent a6fdbe78f65b14c6e12654fbeec642c9717a5dfa
Author: Frederic Cambus <fred@statdns.com>
Date:   Wed, 23 Sep 2020 11:10:09 +0200

Remove a few useless parentheses.

Diffstat:
Msrc/loaders/artworx.c | 8++++----
Msrc/loaders/binary.c | 4++--
Msrc/loaders/pcboard.c | 2+-
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c @@ -42,7 +42,7 @@ ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options) gdImagePtr canvas; /* create ADF instance */ - canvas = gdImageCreate(640, (((ctx->length - ADF_HEADER_LENGTH) / 2) / 80) * 16); + canvas = gdImageCreate(640, (ctx->length - ADF_HEADER_LENGTH) / 2 / 80 * 16); if (!canvas) { ctx->error = ANSILOVE_GD_ERROR; return -1; @@ -53,9 +53,9 @@ ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options) /* process ADF palette */ for (loop = 0; loop < 16; loop++) { index = (adf_colors[loop] * 3) + 1; - gdImageColorAllocate(canvas, (ctx->buffer[index] << 2 | ctx->buffer[index] >> 4), - (ctx->buffer[index + 1] << 2 | ctx->buffer[index + 1] >> 4), - (ctx->buffer[index + 2] << 2 | ctx->buffer[index + 2] >> 4)); + gdImageColorAllocate(canvas, ctx->buffer[index] << 2 | ctx->buffer[index] >> 4, + ctx->buffer[index + 1] << 2 | ctx->buffer[index + 1] >> 4, + ctx->buffer[index + 2] << 2 | ctx->buffer[index + 2] >> 4); } /* process ADF */ diff --git a/src/loaders/binary.c b/src/loaders/binary.c @@ -47,7 +47,7 @@ ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options) /* allocate buffer image memory */ canvas = gdImageCreate(options->columns * options->bits, - ((ctx->length / 2) / options->columns * fontData.height)); + (ctx->length / 2) / options->columns * fontData.height); if (!canvas) { ctx->error = ANSILOVE_GD_ERROR; @@ -85,7 +85,7 @@ ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options) attribute = *cursor; background = (attribute & 240) >> 4; - foreground = (attribute & 15); + foreground = attribute & 15; if (background > 8 && !options->icecolors) background -= 8; diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -159,7 +159,7 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) rowMax++; /* allocate buffer image memory */ - canvas = gdImageCreate(columns * options->bits, (rowMax)*fontData.height); + canvas = gdImageCreate(columns * options->bits, rowMax*fontData.height); if (!canvas) { ctx->error = ANSILOVE_GD_ERROR;