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:
parent
4dcbc6a3aa
commit
e5f4021a4f
1 changed files with 1 additions and 1 deletions
|
@ -851,7 +851,7 @@ static void vfs_check_contrast(struct vfs101_dev *vdev)
|
|||
|
||||
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 */
|
||||
vdev->best_contrast = vdev->contrast;
|
||||
|
|
Loading…
Reference in a new issue