vfs5011: Cast gpointer data values to proper type to do math operations

This commit is contained in:
Marco Trevisan (Treviño) 2019-12-04 14:09:09 +01:00
parent 0c655be159
commit 5ab4d6c454

View file

@ -210,8 +210,8 @@ vfs5011_get_deviation2 (struct fpi_line_asmbl_ctx *ctx, GSList *row1, GSList *ro
int res = 0, mean = 0, i; int res = 0, mean = 0, i;
const int size = 64; const int size = 64;
buf1 = row1->data + 56; buf1 = (unsigned char *) row1->data + 56;
buf2 = row2->data + 168; buf2 = (unsigned char *) row2->data + 168;
for (i = 0; i < size; i++) for (i = 0; i < size; i++)
mean += (int) buf1[i] + (int) buf2[i]; mean += (int) buf1[i] + (int) buf2[i];
@ -232,7 +232,7 @@ vfs5011_get_pixel (struct fpi_line_asmbl_ctx *ctx,
GSList *row, GSList *row,
unsigned x) unsigned x)
{ {
unsigned char *data = row->data + 8; unsigned char *data = (unsigned char *) row->data + 8;
return data[x]; return data[x];
} }