libansilove

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

commit e9a2c60909ff80d6f6cf02d25ee341f1ddf72223
parent 297ad18b698e4fc72a04e5ece6be96e765baf571
Author: Frederic Cambus <fred@statdns.com>
Date:   Sat,  6 Jun 2020 07:44:27 +0200

Use size_t in for loops setting color palettes.

Diffstat:
Msrc/loaders/ansi.c | 4++--
Msrc/loaders/binary.c | 2+-
Msrc/loaders/pcboard.c | 2+-
Msrc/loaders/xbin.c | 2+-
4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -491,14 +491,14 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) } else if (workbench) { gdImageFill(canvas, 0, 0, 0); - for (int i = 0; i < 16; i++) + for (size_t i = 0; i < 16; i++) colors[i] = gdImageColorAllocate(canvas, workbench_palette[i*3], workbench_palette[i*3+1], workbench_palette[i*3+2]); } else { /* Allocate standard ANSi color palette */ - for (int i = 0; i < 16; i++) + for (size_t i = 0; i < 16; i++) colors[i] = gdImageColorAllocate(canvas, ansi_palette[i*3], ansi_palette[i*3+1], ansi_palette[i*3+2]); diff --git a/src/loaders/binary.c b/src/loaders/binary.c @@ -54,7 +54,7 @@ ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options) /* allocate color palette */ uint32_t colors[16]; - for (int i = 0; i < 16; i++) { + for (size_t i = 0; i < 16; i++) { colors[i] = gdImageColorAllocate(canvas, vga_palette[i*3], vga_palette[i*3+1], vga_palette[i*3+2]); } diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c @@ -164,7 +164,7 @@ ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options) /* allocate color palette */ uint32_t colors[16]; - for (int i = 0; i < 16; i++) { + for (size_t i = 0; i < 16; i++) { colors[i] = gdImageColorAllocate(canvas, ansi_palette[i*3], ansi_palette[i*3+1], ansi_palette[i*3+2]); diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -93,7 +93,7 @@ ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) offset += XBIN_PALETTE_LENGTH; } else { - for (int i = 0; i < 16; i++) { + for (size_t i = 0; i < 16; i++) { colors[i] = gdImageColorAllocate(canvas, vga_palette[i*3], vga_palette[i*3+1], vga_palette[i*3+2]);