Merge pull request #59 from sushshring/master

Fix some compile-time issues for better production usability
This commit is contained in:
Daniel Beer 2019-08-22 11:43:05 +12:00 committed by GitHub
commit c89d949371
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -874,7 +874,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 (data->payload_len >= (int) sizeof(data->payload))
data->payload_len--;
data->payload[data->payload_len] = 0;

View file

@ -98,8 +98,8 @@ static void perspective_map(const double *c,
double x = (c[0]*u + c[1]*v + c[2]) / den;
double y = (c[3]*u + c[4]*v + c[5]) / den;
ret->x = rint(x);
ret->y = rint(y);
ret->x = (int) rint(x);
ret->y = (int) rint(y);
}
static void perspective_unmap(const double *c,
@ -851,8 +851,8 @@ static void rotate_capstone(struct quirc_capstone *cap,
{
struct quirc_point copy[4];
int j;
int best;
int best_score;
int best = 0;
int best_score = INT32_MAX;
for (j = 0; j < 4; j++) {
struct quirc_point *p = &cap->corners[j];