libansilove

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

commit fef4d2cd186740936d83aeb2fb43fa458b0c7720
parent 121e2fec77984f2d0309e77661f6a77abeede402
Author: Frederic Cambus <fred@statdns.com>
Date:   Fri, 19 Jun 2020 22:38:19 +0200

Use size_t type for variables used to loop over arrays.

Diffstat:
Msrc/loaders/ansi.c | 3+--
Msrc/loaders/artworx.c | 3+--
Msrc/loaders/binary.c | 2+-
Msrc/loaders/icedraw.c | 3+--
Msrc/loaders/tundra.c | 2+-
Msrc/loaders/xbin.c | 3+--
6 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c @@ -85,8 +85,7 @@ ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options) gdImagePtr canvas; /* ANSi processing loops */ - size_t loop = 0; - uint32_t ansi_sequence_loop; + size_t loop = 0, ansi_sequence_loop; /* character definitions */ uint8_t current_character, character; diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c @@ -47,8 +47,7 @@ ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options) /* ADF color palette array */ uint32_t adf_colors[16] = { 0, 1, 2, 3, 4, 5, 20, 7, 56, 57, 58, 59, 60, 61, 62, 63 }; - uint32_t loop; - uint32_t index; + size_t index, loop; /* process ADF palette */ for (loop = 0; loop < 16; loop++) { diff --git a/src/loaders/binary.c b/src/loaders/binary.c @@ -61,7 +61,7 @@ ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options) /* process binary */ uint32_t character, attribute, background, foreground; - uint32_t loop = 0; + size_t loop = 0; int32_t column = 0, row = 0; while (loop < ctx->length) { diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c @@ -42,8 +42,7 @@ ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options) /* libgd image pointers */ gdImagePtr canvas; - uint32_t loop = IDF_HEADER_LENGTH; - uint32_t index; + size_t index, loop = IDF_HEADER_LENGTH; uint32_t colors[16]; /* process IDF */ diff --git a/src/loaders/tundra.c b/src/loaders/tundra.c @@ -68,7 +68,7 @@ ansilove_tundra(struct ansilove_ctx *ctx, struct ansilove_options *options) /* read tundra file a first time to find the image size */ uint32_t cursor, character, background = 0, foreground = 0; - uint32_t loop = TUNDRA_HEADER_LENGTH; + size_t loop = TUNDRA_HEADER_LENGTH; int32_t column = 0, row = 1; while (loop < ctx->length) { diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c @@ -74,8 +74,7 @@ ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options) /* palette */ if ((xbin_flags & 1) == 1) { - uint32_t loop; - uint32_t index; + size_t index, loop; if (offset + XBIN_PALETTE_LENGTH > ctx->length) { ctx->error = ANSILOVE_FORMAT_ERROR;