Enable -Wsign-compare and fix the warnings

This commit is contained in:
ISSOtm
2022-02-05 14:19:25 +01:00
committed by Eldred Habert
parent 72b677a8d7
commit ac59ecf3c0
7 changed files with 11 additions and 15 deletions

View File

@@ -37,15 +37,14 @@ void transpose_tiles(struct GBImage *gb, int width)
void raw_to_gb(const struct RawIndexedImage *raw_image, struct GBImage *gb)
{
int x, y, byte;
uint8_t index;
for (y = 0; y < raw_image->height; y++) {
for (x = 0; x < raw_image->width; x++) {
for (unsigned int y = 0; y < raw_image->height; y++) {
for (unsigned int x = 0; x < raw_image->width; x++) {
index = raw_image->data[y][x];
index &= (1 << depth) - 1;
byte = y * depth
unsigned int byte = y * depth
+ x / 8 * raw_image->height / 8 * 8 * depth;
gb->data[byte] |= (index & 1) << (7 - x % 8);
if (depth == 2) {

View File

@@ -142,10 +142,9 @@ void output_png_file(const struct Options *opts,
void destroy_raw_image(struct RawIndexedImage **raw_image_ptr_ptr)
{
int y;
struct RawIndexedImage *raw_image = *raw_image_ptr_ptr;
for (y = 0; y < raw_image->height; y++)
for (unsigned int y = 0; y < raw_image->height; y++)
free(raw_image->data[y]);
free(raw_image->data);