libansilove

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

commit 0da23ea28d322b0267a3885ae398cb55960cb74c
parent 71b7e325f0fdd79194397760dc7bbc996c3286ef
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 25 Sep 2020 21:11:21 +0200

Remove useless braces in color palettes allocations.

Diffstat:
Msrc/loaders/binary.c | 3+--
Msrc/loaders/pcboard.c | 3+--
Msrc/loaders/xbin.c | 3+--
3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/loaders/binary.c b/src/loaders/binary.c @@ -57,10 +57,9 @@ ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options) /* allocate color palette */ uint32_t colors[16]; - for (size_t i = 0; i < 16; i++) { + for (size_t i = 0; i < 16; i++) colors[i] = gdImageColorAllocate(canvas, vga_palette_red[i], vga_palette_green[i], vga_palette_blue[i]); - } /* process binary */ uint8_t character, attribute, *cursor, state = STATE_CHARACTER; diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -169,10 +169,9 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) /* allocate color palette */ uint32_t colors[16]; - for (size_t i = 0; i < 16; i++) { + for (size_t i = 0; i < 16; i++) colors[i] = gdImageColorAllocate(canvas, ansi_palette_red[i], ansi_palette_green[i], ansi_palette_blue[i]); - } /* render PCB */ for (loop = 0; loop < structIndex; loop++) { diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -92,11 +92,10 @@ ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) offset += XBIN_PALETTE_LENGTH; } else { - for (size_t i = 0; i < 16; i++) { + for (size_t i = 0; i < 16; i++) colors[i] = gdImageColorAllocate(canvas, vga_palette_red[i], vga_palette_green[i], vga_palette_blue[i]); - } } /* font */