commit 3b35c5e424b083d44f4fd88a3323a696d5e2941d
parent 34d087fd0b38c9454c61850030038fae5d57baf7
Author: Frederic Cambus <fred@statdns.com>
Date: Mon, 22 Oct 2018 22:14:36 +0200
Store characters as unsigned char in the ansiChar and pcbChar structures
Diffstat:
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/loaders/ansi.c b/src/loaders/ansi.c
@@ -21,7 +21,7 @@ struct ansiChar {
int32_t row;
uint32_t background;
uint32_t foreground;
- uint32_t current_character;
+ unsigned char character;
};
int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
@@ -71,7 +71,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
uint32_t ansi_sequence_loop;
// character definitions
- uint32_t current_character, next_character, character;
+ unsigned char current_character, next_character, character;
unsigned char ansi_sequence_character;
// default color values
@@ -408,7 +408,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
ansi_buffer[structIndex].background = background;
ansi_buffer[structIndex].foreground = foreground;
}
- ansi_buffer[structIndex].current_character = current_character;
+ ansi_buffer[structIndex].character = current_character;
ansi_buffer[structIndex].column = column;
ansi_buffer[structIndex].row = row;
@@ -475,7 +475,7 @@ int ansilove_ansi(struct ansilove_ctx *ctx, struct ansilove_options *options)
// grab ANSi char from our structure array
background = ansi_buffer[loop].background;
foreground = ansi_buffer[loop].foreground;
- character = ansi_buffer[loop].current_character;
+ character = ansi_buffer[loop].character;
column = ansi_buffer[loop].column;
row = ansi_buffer[loop].row;
diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c
@@ -17,7 +17,7 @@ struct pcbChar {
uint32_t row;
uint32_t background;
uint32_t foreground;
- uint32_t current_character;
+ unsigned char character;
};
int ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options)
@@ -40,7 +40,7 @@ int ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options)
gdImagePtr canvas;
// process PCBoard
- uint32_t character, current_character, next_character;
+ unsigned char character, current_character, next_character;
uint32_t background = 0, foreground = 7;
uint32_t column = 0, row = 0, columnMax = 0, rowMax = 0;
@@ -131,7 +131,7 @@ int ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options)
pcboard_buffer[structIndex].row = row;
pcboard_buffer[structIndex].background = pcb_colors[background];
pcboard_buffer[structIndex].foreground = pcb_colors[foreground];
- pcboard_buffer[structIndex].current_character = current_character;
+ pcboard_buffer[structIndex].character = current_character;
column++;
structIndex++;
@@ -172,7 +172,7 @@ int ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options)
row = pcboard_buffer[loop].row;
background = pcboard_buffer[loop].background;
foreground = pcboard_buffer[loop].foreground;
- character = pcboard_buffer[loop].current_character;
+ character = pcboard_buffer[loop].character;
drawchar(canvas, fontData.font_data, options->bits, fontData.height,
column, row, colors[background], colors[foreground], character);