diff --git a/source/quirc/decode.c b/source/quirc/decode.c index 93520c4..3219167 100644 --- a/source/quirc/decode.c +++ b/source/quirc/decode.c @@ -117,7 +117,7 @@ static const uint8_t gf256_log[256] = { 0x74, 0xd6, 0xf4, 0xea, 0xa8, 0x50, 0x58, 0xaf }; -const static struct galois_field gf256 = { +static const struct galois_field gf256 = { .p = 255, .log = gf256_log, .exp = gf256_exp @@ -873,7 +873,7 @@ static quirc_decode_error_t decode_payload(struct quirc_data *data, done: /* Add nul terminator to all payloads */ - if (data->payload_len >= sizeof(data->payload)) + if ((unsigned int)data->payload_len >= sizeof(data->payload)) data->payload_len--; data->payload[data->payload_len] = 0; diff --git a/source/quirc/identify.c b/source/quirc/identify.c index 8646989..122535a 100644 --- a/source/quirc/identify.c +++ b/source/quirc/identify.c @@ -348,6 +348,7 @@ static void threshold(struct quirc *q) static void area_count(void *user_data, int y, int left, int right) { + (void)y; ((struct quirc_region *)user_data)->count += right - left + 1; } diff --git a/source/quirc/quirc.c b/source/quirc/quirc.c index 62bc285..c9be289 100644 --- a/source/quirc/quirc.c +++ b/source/quirc/quirc.c @@ -84,7 +84,8 @@ static const char *const error_table[] = { const char *quirc_strerror(quirc_decode_error_t err) { - if (err >= 0 && err < sizeof(error_table) / sizeof(error_table[0])) + // note from Anemone3DS dev - L88 used to compare err >= 0, but err is always positive + if (err < sizeof(error_table) / sizeof(error_table[0])) return error_table[err]; return "Unknown error";