If get_next_timeout_expiry() fails, and libusb_get_next_timeout()
has no timeouts or failed, fprint_timeout will not be set, and
we cannot compare it to libusb_timeout.
Exit early if both failed or have empty queues.
libfprint/drivers/elan.c:351:12: warning: format specifies type 'unsigned short' but the argument has type 'unsigned char' [-Wformat]
dbg_buf(elandev->last_read, transfer->actual_length);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libfprint/drivers/elan.c:46:21: note: expanded from macro 'dbg_buf'
fp_dbg("%02hx", buf[0]); \
~~~~~~~~~~~~~~~~^~~~~~~
include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug'
__VA_ARGS__)
^~~~~~~~~~~
libfprint/drivers/elan.c:351:12: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
dbg_buf(elandev->last_read, transfer->actual_length);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libfprint/drivers/elan.c:48:21: note: expanded from macro 'dbg_buf'
fp_dbg("%04hx", buf[0] << 8 | buf[1]); \
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug'
__VA_ARGS__)
^~~~~~~~~~~
libfprint/drivers/elan.c:351:12: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
dbg_buf(elandev->last_read, transfer->actual_length);
~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libfprint/drivers/elan.c:50:35: note: expanded from macro 'dbg_buf'
fp_dbg("%04hx... (%d bytes)", buf[0] << 8 | buf[1], len)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug'
__VA_ARGS__)
^~~~~~~~~~~
libfprint/drivers/elan.c:413:10: warning: format specifies type 'unsigned short' but the argument has type 'unsigned char' [-Wformat]
dbg_buf(cmd->cmd, 2);
~~~~~~~~^~~~~~~~~~~~
libfprint/drivers/elan.c:46:21: note: expanded from macro 'dbg_buf'
fp_dbg("%02hx", buf[0]); \
~~~~~~~~~~~~~~~~^~~~~~~
include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug'
__VA_ARGS__)
^~~~~~~~~~~
libfprint/drivers/elan.c:413:10: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
dbg_buf(cmd->cmd, 2);
~~~~~~~~^~~~~~~~~~~~
libfprint/drivers/elan.c:48:21: note: expanded from macro 'dbg_buf'
fp_dbg("%04hx", buf[0] << 8 | buf[1]); \
~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~
include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug'
__VA_ARGS__)
^~~~~~~~~~~
libfprint/drivers/elan.c:413:10: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
dbg_buf(cmd->cmd, 2);
~~~~~~~~^~~~~~~~~~~~
libfprint/drivers/elan.c:50:35: note: expanded from macro 'dbg_buf'
fp_dbg("%04hx... (%d bytes)", buf[0] << 8 | buf[1], len)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
include/glib-2.0/glib/gmessages.h:345:32: note: expanded from macro 'g_debug'
__VA_ARGS__)
^~~~~~~~~~~
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
libfprint/fpi-dev-img.c:255:6: warning: variable 'print' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (imgdev->action != IMG_ACTION_CAPTURE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libfprint/fpi-dev-img.c:271:25: note: uninitialized use occurs here
imgdev->acquire_data = print;
^~~~~
libfprint/fpi-dev-img.c:255:2: note: remove the 'if' if its condition is always true
if (imgdev->action != IMG_ACTION_CAPTURE) {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libfprint/fpi-dev-img.c:232:29: note: initialize the variable 'print' to silence this warning
struct fp_print_data *print;
^
= NULL
This reverts commit 700c5791f8.
We don't need a poll setup to be able to call sync functions, which then
use async functions for implementation internally.
Closes: #124
Conflicts:
libfprint/fpi-async.c
struct xyt_struct uses a fixed-sized array to fit MAX_BOZORTH_MINUTIAE (200)
minutiae. MAX_FILE_MINUTIAE is 1000. So if we detected more than
MAX_BOZORTH_MINUTIAE, we would crash copying the data from the capture
to the structure.
We might want to use dynamically allocated arrays in the future (or
bigger ones) so that we don't lose minutiae.
Closes: #116
The checks weren't:
- checking whether the width or height were negative
- whether img->width * img->height would overflow, or
was bigger than G_MAXINT
- whether img->width * img->height was bigger than the total
length of the buffer
The last one looks like a thinko, it checked for:
(img->length * img->height) < img->length
which is equivalent to:
img->height < 1
which we already check for earlier.
Closes: #85
Add fp_minutia_get_coords() so that debugging applications can show the
detected minutiae along with the captured image.
This will also help fix the positively ancient fprint_demo.
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=907470
Group global variables, structure definitions, and functions, and
group functions by which C source they're defined in.
This also removes the FP_IMGDRV_SUPPORTS_UNCONDITIONAL_CAPTURE
definition that's already available in the drivers API-accessible
fpi-core.h