From 098ef26c87b27ddac5eb41f1317fe552fe16e3a7 Mon Sep 17 00:00:00 2001 From: laforge Date: Sun, 11 Sep 2005 19:59:58 +0000 Subject: use 64bit timeout values throughout the code, since some timeouts exceeds 4.8 billion microseconds (seconds). git-svn-id: https://svn.gnumonks.org/trunk/librfid@1426 e0336214-984f-0b4b-a45f-81c69e1f0ede --- rfid_layer2_iso14443b.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'rfid_layer2_iso14443b.c') diff --git a/rfid_layer2_iso14443b.c b/rfid_layer2_iso14443b.c index d36b5da..1988827 100644 --- a/rfid_layer2_iso14443b.c +++ b/rfid_layer2_iso14443b.c @@ -36,7 +36,7 @@ static inline int fwi_to_fwt(struct rfid_layer2_handle *h, unsigned int *fwt, unsigned int fwi) { - unsigned int multiplier; + unsigned int multiplier, tmp; /* 15 is RFU */ if (fwi > 14) @@ -52,7 +52,9 @@ fwi_to_fwt(struct rfid_layer2_handle *h, unsigned int *fwt, unsigned int fwi) multiplier = 1 << fwi; /* 2 to the power of fwi */ - return (1000000 * 256 * 16 / h->rh->ah->asic->fc) * multiplier + tmp = (unsigned int) 1000000 * 256 * 16; + + return (tmp / h->rh->ah->asic->fc) * multiplier; } static int @@ -124,7 +126,7 @@ send_reqb(struct rfid_layer2_handle *h, unsigned char afi, /* FIXME: send N-1 slot marker frames */ if (atqb_len != sizeof(atqb)) { - DEBUGP("error: atqb_len = %u instead of %u\n", + DEBUGP("error: atqb_len = %u instead of %Zu\n", atqb_len, sizeof(atqb)); continue; } @@ -263,7 +265,7 @@ iso14443b_anticol(struct rfid_layer2_handle *handle) { unsigned char afi = 0; /* FIXME */ int ret; - char buf[255]; + unsigned char buf[255]; unsigned int buf_len = sizeof(buf); ret = send_reqb(handle, afi, 0, 0); @@ -317,7 +319,7 @@ static int iso14443b_transcieve(struct rfid_layer2_handle *handle, const unsigned char *tx_buf, unsigned int tx_len, unsigned char *rx_buf, unsigned int *rx_len, - unsigned int timeout, unsigned int flags) + u_int64_t timeout, unsigned int flags) { return handle->rh->reader->transcieve(handle->rh, tx_buf, tx_len, rx_buf, rx_len, timeout, flags); -- cgit v1.2.3