lib: Fix type mismatch warnings in debug output

This commit is contained in:
Bastien Nocera 2018-05-23 19:03:25 +02:00
parent 8e6e23b8d0
commit c376c6fb02
8 changed files with 16 additions and 16 deletions

View file

@ -357,7 +357,7 @@ struct fp_img *fpi_assemble_lines(struct fpi_line_asmbl_ctx *ctx,
unsigned char *output = g_malloc0(ctx->line_width * ctx->max_height); unsigned char *output = g_malloc0(ctx->line_width * ctx->max_height);
struct fp_img *img; struct fp_img *img;
fp_dbg("%llu", g_get_real_time()); fp_dbg("%"G_GINT64_FORMAT, g_get_real_time());
row1 = lines; row1 = lines;
for (i = 0; (i < lines_len - 1) && row1; i += 2) { for (i = 0; (i < lines_len - 1) && row1; i += 2) {
@ -388,7 +388,7 @@ struct fp_img *fpi_assemble_lines(struct fpi_line_asmbl_ctx *ctx,
median_filter(offsets, (lines_len / 2) - 1, ctx->median_filter_size); median_filter(offsets, (lines_len / 2) - 1, ctx->median_filter_size);
fp_dbg("offsets_filtered: %llu", g_get_real_time()); fp_dbg("offsets_filtered: %"G_GINT64_FORMAT, g_get_real_time());
for (i = 0; i <= (lines_len / 2) - 1; i++) for (i = 0; i <= (lines_len / 2) - 1; i++)
fp_dbg("%d", offsets[i]); fp_dbg("%d", offsets[i]);
row1 = lines; row1 = lines;

View file

@ -224,7 +224,7 @@ static struct fp_print_data *fpi_print_data_from_fp2_data(unsigned char *buf,
raw_item = (struct fpi_print_data_item_fp2 *)raw_buf; raw_item = (struct fpi_print_data_item_fp2 *)raw_buf;
item_len = GUINT32_FROM_LE(raw_item->length); item_len = GUINT32_FROM_LE(raw_item->length);
fp_dbg("item len %d, total_data_len %d", item_len, total_data_len); fp_dbg("item len %d, total_data_len %d", (int) item_len, (int) total_data_len);
if (total_data_len < item_len) { if (total_data_len < item_len) {
fp_err("corrupted fingerprint data"); fp_err("corrupted fingerprint data");
break; break;

View file

@ -341,7 +341,7 @@ static void capture_read_stripe_data_cb(struct libusb_transfer *transfer)
goto out; goto out;
} }
fp_dbg("Got %d bytes of data", actual_len); fp_dbg("Got %lu bytes of data", actual_len);
do { do {
copied = min(aesdev->buffer_max - aesdev->buffer_size, actual_len); copied = min(aesdev->buffer_max - aesdev->buffer_size, actual_len);
memcpy(aesdev->buffer + aesdev->buffer_size, memcpy(aesdev->buffer + aesdev->buffer_size,
@ -350,13 +350,13 @@ static void capture_read_stripe_data_cb(struct libusb_transfer *transfer)
actual_len -= copied; actual_len -= copied;
data += copied; data += copied;
aesdev->buffer_size += copied; aesdev->buffer_size += copied;
fp_dbg("Copied %.4x bytes into internal buffer", fp_dbg("Copied %.4lx bytes into internal buffer",
copied); copied);
if (aesdev->buffer_size == aesdev->buffer_max) { if (aesdev->buffer_size == aesdev->buffer_max) {
if (aesdev->buffer_max == AESX660_HEADER_SIZE) { if (aesdev->buffer_max == AESX660_HEADER_SIZE) {
aesdev->buffer_max = aesdev->buffer[AESX660_RESPONSE_SIZE_LSB_OFFSET] + aesdev->buffer_max = aesdev->buffer[AESX660_RESPONSE_SIZE_LSB_OFFSET] +
(aesdev->buffer[AESX660_RESPONSE_SIZE_MSB_OFFSET] << 8) + AESX660_HEADER_SIZE; (aesdev->buffer[AESX660_RESPONSE_SIZE_MSB_OFFSET] << 8) + AESX660_HEADER_SIZE;
fp_dbg("Got frame, type %.2x size %.4x", fp_dbg("Got frame, type %.2x size %.4lx",
aesdev->buffer[AESX660_RESPONSE_TYPE_OFFSET], aesdev->buffer[AESX660_RESPONSE_TYPE_OFFSET],
aesdev->buffer_max); aesdev->buffer_max);
continue; continue;
@ -402,7 +402,7 @@ static void capture_run_state(struct fpi_ssm *ssm)
capture_read_stripe_data_cb); capture_read_stripe_data_cb);
break; break;
case CAPTURE_SET_IDLE: case CAPTURE_SET_IDLE:
fp_dbg("Got %d frames\n", aesdev->strips_len); fp_dbg("Got %lu frames\n", aesdev->strips_len);
aesX660_send_cmd(ssm, set_idle_cmd, sizeof(set_idle_cmd), aesX660_send_cmd(ssm, set_idle_cmd, sizeof(set_idle_cmd),
capture_set_idle_cmd_cb); capture_set_idle_cmd_cb);
break; break;

View file

@ -246,7 +246,7 @@ static void handoff_img(struct fp_img_dev *dev)
sdev->rows = g_slist_reverse(sdev->rows); sdev->rows = g_slist_reverse(sdev->rows);
fp_dbg("%d rows", sdev->num_rows); fp_dbg("%lu rows", sdev->num_rows);
img = fpi_assemble_lines(&assembling_ctx, sdev->rows, sdev->num_rows); img = fpi_assemble_lines(&assembling_ctx, sdev->rows, sdev->num_rows);
g_slist_free_full(sdev->rows, g_free); g_slist_free_full(sdev->rows, g_free);
@ -312,7 +312,7 @@ static void row_complete(struct fp_img_dev *dev)
*/ */
if (sdev->num_blank > FINGER_REMOVED_THRESHOLD) { if (sdev->num_blank > FINGER_REMOVED_THRESHOLD) {
sdev->finger_state = FINGER_REMOVED; sdev->finger_state = FINGER_REMOVED;
fp_dbg("detected finger removal. Blank rows: %d, Full rows: %d", sdev->num_blank, sdev->num_rows); fp_dbg("detected finger removal. Blank rows: %d, Full rows: %lu", sdev->num_blank, sdev->num_rows);
handoff_img(dev); handoff_img(dev);
return; return;
} }

View file

@ -462,7 +462,7 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
upekdev->sum_threshold = UPEKET_SUM_THRESHOLD; upekdev->sum_threshold = UPEKET_SUM_THRESHOLD;
break; break;
default: default:
fp_err("Device variant %d is not known\n", driver_data); fp_err("Device variant %lu is not known\n", driver_data);
g_free(upekdev); g_free(upekdev);
dev->priv = NULL; dev->priv = NULL;
return -ENODEV; return -ENODEV;

View file

@ -266,7 +266,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer)
response_size = ((data[5] & 0x0f) << 8) + data[6]; response_size = ((data[5] & 0x0f) << 8) + data[6];
response_size += 9; /* 7 bytes for header, 2 for CRC */ response_size += 9; /* 7 bytes for header, 2 for CRC */
if (response_size > transfer->actual_length) { if (response_size > transfer->actual_length) {
fp_dbg("response_size is %d, actual_length is %d\n", fp_dbg("response_size is %lu, actual_length is %d\n",
response_size, transfer->actual_length); response_size, transfer->actual_length);
fp_dbg("Waiting for rest of transfer"); fp_dbg("Waiting for rest of transfer");
BUG_ON(upekdev->response_rest); BUG_ON(upekdev->response_rest);
@ -331,7 +331,7 @@ static void capture_read_data_cb(struct libusb_transfer *transfer)
upektc_img_process_image_frame(upekdev->image_bits + upekdev->image_size, upektc_img_process_image_frame(upekdev->image_bits + upekdev->image_size,
data); data);
BUG_ON(upekdev->image_size != IMAGE_SIZE); BUG_ON(upekdev->image_size != IMAGE_SIZE);
fp_dbg("Image size is %d\n", upekdev->image_size); fp_dbg("Image size is %lu\n", upekdev->image_size);
img = fpi_img_new(IMAGE_SIZE); img = fpi_img_new(IMAGE_SIZE);
img->flags = FP_IMG_PARTIAL; img->flags = FP_IMG_PARTIAL;
memcpy(img->data, upekdev->image_bits, IMAGE_SIZE); memcpy(img->data, upekdev->image_bits, IMAGE_SIZE);

View file

@ -1011,7 +1011,7 @@ static void e_handle_resp00(struct fp_dev *dev, unsigned char *data,
int result = 0; int result = 0;
if (data_len != 14) { if (data_len != 14) {
fp_err("received 3001 poll response of %d bytes?", data_len); fp_err("received 3001 poll response of %lu bytes?", data_len);
fpi_drvcb_enroll_stage_completed(dev, -EPROTO, NULL, NULL); fpi_drvcb_enroll_stage_completed(dev, -EPROTO, NULL, NULL);
return; return;
} }
@ -1083,7 +1083,7 @@ static void e_handle_resp02(struct fp_dev *dev, unsigned char *data,
int result = -EPROTO; int result = -EPROTO;
if (data_len < sizeof(scan_comp)) { if (data_len < sizeof(scan_comp)) {
fp_err("fingerprint data too short (%d bytes)", data_len); fp_err("fingerprint data too short (%lu bytes)", data_len);
} else if (memcmp(data, scan_comp, sizeof(scan_comp)) != 0) { } else if (memcmp(data, scan_comp, sizeof(scan_comp)) != 0) {
fp_err("unrecognised data prefix %x %x %x %x %x", fp_err("unrecognised data prefix %x %x %x %x %x",
data[0], data[1], data[2], data[3], data[4]); data[0], data[1], data[2], data[3], data[4]);
@ -1288,7 +1288,7 @@ static void v_handle_resp00(struct fp_dev *dev, unsigned char *data,
int r = 0; int r = 0;
if (data_len != 14) { if (data_len != 14) {
fp_err("received 3001 poll response of %d bytes?", data_len); fp_err("received 3001 poll response of %lu bytes?", data_len);
r = -EPROTO; r = -EPROTO;
goto out; goto out;
} }

View file

@ -163,7 +163,7 @@ static int get_next_timeout_expiry(struct timeval *out,
timerclear(out); timerclear(out);
} else { } else {
timersub(&next_timeout->expiry, &tv, out); timersub(&next_timeout->expiry, &tv, out);
fp_dbg("next timeout in %d.%06ds", out->tv_sec, out->tv_usec); fp_dbg("next timeout in %ld.%06lds", out->tv_sec, out->tv_usec);
} }
return 1; return 1;