The branch, master has been updated
via 32e2d8b00c3168dd46c34080aa4d83abaf05a685 (commit)
from f45f42373318c5504e7d42168991808fb017ca0c (commit)
- Log -----------------------------------------------------------------
commit 32e2d8b00c3168dd46c34080aa4d83abaf05a685
Author: Andrei Errapart <a.errapart@xxxxxxxxxxxxxxxxxxx>
Date: Fri May 16 17:05:06 2014 +0200
Minor fixes for MSVC++
1. Variables must be defined at the beginning of a block; GCC enforces
this only when in -pedantic mode.
2. The callback functions were lacking LIBUSB_CALL qualifier.
-----------------------------------------------------------------------
Summary of changes:
src/ftdi.c | 6 +++---
src/ftdi_stream.c | 2 +-
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/ftdi.c b/src/ftdi.c
index 03a10be..b6caf6c 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -1018,8 +1018,8 @@ static int ftdi_to_clkbits_AM(int baudrate, unsigned long
*encoded_divisor)
static const char am_adjust_up[8] = {0, 0, 0, 1, 0, 3, 2, 1};
static const char am_adjust_dn[8] = {0, 0, 0, 1, 0, 1, 2, 3};
int divisor, best_divisor, best_baud, best_baud_diff;
- divisor = 24000000 / baudrate;
int i;
+ divisor = 24000000 / baudrate;
// Round down to supported fraction (AM only)
divisor -= am_adjust_dn[divisor & 7];
@@ -1393,7 +1393,7 @@ int ftdi_write_data(struct ftdi_context *ftdi, const
unsigned char *buf, int siz
return offset;
}
-static void ftdi_read_data_cb(struct libusb_transfer *transfer)
+static void LIBUSB_CALL ftdi_read_data_cb(struct libusb_transfer *transfer)
{
struct ftdi_transfer_control *tc = (struct ftdi_transfer_control *)
transfer->user_data;
struct ftdi_context *ftdi = tc->ftdi;
@@ -1475,7 +1475,7 @@ static void ftdi_read_data_cb(struct libusb_transfer
*transfer)
}
-static void ftdi_write_data_cb(struct libusb_transfer *transfer)
+static void LIBUSB_CALL ftdi_write_data_cb(struct libusb_transfer *transfer)
{
struct ftdi_transfer_control *tc = (struct ftdi_transfer_control *)
transfer->user_data;
struct ftdi_context *ftdi = tc->ftdi;
diff --git a/src/ftdi_stream.c b/src/ftdi_stream.c
index 2180672..d295a02 100644
--- a/src/ftdi_stream.c
+++ b/src/ftdi_stream.c
@@ -61,7 +61,7 @@ typedef struct
*
* state->result is only set when some error happens
*/
-static void
+static void LIBUSB_CALL
ftdi_readstream_cb(struct libusb_transfer *transfer)
{
FTDIStreamState *state = transfer->user_data;
hooks/post-receive
--
A library to talk to FTDI chips
--
libftdi-git - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi-git+unsubscribe@xxxxxxxxxxxxxxxxxxxxxxx
|