mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
vfs101: Fix warning about value truncation
libfprint/drivers/vfs101.c:854:6: warning: absolute value function 'abs' given an argument of type 'long' but has parameter of type 'int' which may cause truncation of value [-Wabsolute-value]
if (abs(count - VFS_IMG_BEST_CONTRAST) < abs(vdev->best_clevel - VFS_IMG_BEST_CONTRAST))
^
libfprint/drivers/vfs101.c:854:6: note: use function 'labs' instead
if (abs(count - VFS_IMG_BEST_CONTRAST) < abs(vdev->best_clevel - VFS_IMG_BEST_CONTRAST))
^~~
labs
This commit is contained in:
@@ -851,7 +851,7 @@ static void vfs_check_contrast(struct vfs101_dev *vdev)
|
|||||||
|
|
||||||
fp_dbg("contrast = %d, level = %ld", vdev->contrast, count);
|
fp_dbg("contrast = %d, level = %ld", vdev->contrast, count);
|
||||||
|
|
||||||
if (abs(count - VFS_IMG_BEST_CONTRAST) < abs(vdev->best_clevel - VFS_IMG_BEST_CONTRAST))
|
if (labs(count - VFS_IMG_BEST_CONTRAST) < abs(vdev->best_clevel - VFS_IMG_BEST_CONTRAST))
|
||||||
{
|
{
|
||||||
/* Better contrast found, use it */
|
/* Better contrast found, use it */
|
||||||
vdev->best_contrast = vdev->contrast;
|
vdev->best_contrast = vdev->contrast;
|
||||||
|
|||||||
Reference in New Issue
Block a user