libfprint/SOURCES/0081-vfs5011-Cast-gpointer-data-values-to-proper-type-to-.patch

38 lines
1.2 KiB
Diff
Raw Normal View History

2020-04-23 23:55:43 +00:00
From ce64d4db86ee179783571eadbdaa9288eeead72b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= <mail@3v1n0.net>
Date: Wed, 4 Dec 2019 14:09:09 +0100
Subject: [PATCH 081/181] vfs5011: Cast gpointer data values to proper type to
do math operations
---
libfprint/drivers/vfs5011.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/libfprint/drivers/vfs5011.c b/libfprint/drivers/vfs5011.c
index ef318f2..265495a 100644
--- a/libfprint/drivers/vfs5011.c
+++ b/libfprint/drivers/vfs5011.c
@@ -210,8 +210,8 @@ vfs5011_get_deviation2 (struct fpi_line_asmbl_ctx *ctx, GSList *row1, GSList *ro
int res = 0, mean = 0, i;
const int size = 64;
- buf1 = row1->data + 56;
- buf2 = row2->data + 168;
+ buf1 = (unsigned char *) row1->data + 56;
+ buf2 = (unsigned char *) row2->data + 168;
for (i = 0; i < size; i++)
mean += (int) buf1[i] + (int) buf2[i];
@@ -232,7 +232,7 @@ vfs5011_get_pixel (struct fpi_line_asmbl_ctx *ctx,
GSList *row,
unsigned x)
{
- unsigned char *data = row->data + 8;
+ unsigned char *data = (unsigned char *) row->data + 8;
return data[x];
}
--
2.24.1