The branch, master has been updated
via 5432fb9b91bbf55af39c4c128772ad00852e62ec (commit)
via e30da501892deee3ebb2d1c86c7dcb3a58e2c828 (commit)
via bf35baa04ec3e21b679ca10d90d2a65ec2a1270a (commit)
from 603b0de5ffed2d87151512993221d722d6e3a8e6 (commit)
- Log -----------------------------------------------------------------
commit 5432fb9b91bbf55af39c4c128772ad00852e62ec
Author: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
Date: Tue Mar 17 20:30:53 2009 +0100
Added PC-Lint 9.00 settings file
commit e30da501892deee3ebb2d1c86c7dcb3a58e2c828
Author: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
Date: Tue Mar 17 20:30:29 2009 +0100
Handle return value of some functions
commit bf35baa04ec3e21b679ca10d90d2a65ec2a1270a
Author: Thomas Jarosch <thomas.jarosch@xxxxxxxxxxxxx>
Date: Tue Mar 17 20:23:58 2009 +0100
Fix some theoretical signed/unsigned issues
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 1 +
libftdi.lnt | 10 ++++++++++
src/ftdi.c | 19 +++++++++++--------
3 files changed, 22 insertions(+), 8 deletions(-)
create mode 100644 libftdi.lnt
diff --git a/ChangeLog b/ChangeLog
index 6c2b9da..ea692de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
New in 0.16 - 2009-XX-XX
------------------------
+* Code cleanup in various places (Intra2net)
* Fixed ftdi_read_chipid in some cases (Matthias Richter)
* eeprom decode function and small cleanups (Marius Kintel)
* cmake system improvements (Marius Kintel and Intra2net)
diff --git a/libftdi.lnt b/libftdi.lnt
new file mode 100644
index 0000000..68008bc
--- /dev/null
+++ b/libftdi.lnt
@@ -0,0 +1,10 @@
+// PC-Lint 9.00 settings
+
+-emacro(527, ftdi_error_return) // ignore "unreachable code"
+-emacro(717, ftdi_error_return)
+
+-epu // Pointer to unsigned/signed of the same type is ok
+
++fie // Allow enum to int conversion
+
+-dLIBFTDI_LINUX_ASYNC_MODE=1 // also lint async code
diff --git a/src/ftdi.c b/src/ftdi.c
index 16f8f1f..b67f950 100644
--- a/src/ftdi.c
+++ b/src/ftdi.c
@@ -63,7 +63,7 @@
*/
int ftdi_init(struct ftdi_context *ftdi)
{
- int i;
+ unsigned int i;
ftdi->usb_dev = NULL;
ftdi->usb_read_timeout = 5000;
@@ -960,7 +960,7 @@ static int _usb_get_async_urbs_pending(struct ftdi_context
*ftdi)
{
struct usbdevfs_urb *urb;
int pending=0;
- int i;
+ unsigned int i;
for (i=0; i < ftdi->async_usb_buffer_size; i++)
{
@@ -1053,8 +1053,8 @@ static int _usb_bulk_write_async(struct ftdi_context
*ftdi, int ep, char *bytes,
{
struct usbdevfs_urb *urb;
int bytesdone = 0, requested;
- int ret, i;
- int cleanup_count;
+ int ret, cleanup_count;
+ unsigned int i;
do
{
@@ -2183,12 +2183,15 @@ int ftdi_read_eeprom_getsize(struct ftdi_context *ftdi,
unsigned char *eeprom, i
int ftdi_write_eeprom(struct ftdi_context *ftdi, unsigned char *eeprom)
{
unsigned short usb_val, status;
- int i;
+ int i, ret;
/* These commands were traced while running MProg */
- ftdi_usb_reset(ftdi);
- ftdi_poll_modem_status(ftdi, &status);
- ftdi_set_latency_timer(ftdi, 0x77);
+ if ((ret = ftdi_usb_reset(ftdi)) != 0)
+ return ret;
+ if ((ret = ftdi_poll_modem_status(ftdi, &status)) != 0)
+ return ret;
+ if ((ret = ftdi_set_latency_timer(ftdi, 0x77)) != 0)
+ return ret;
for (i = 0; i < ftdi->eeprom_size/2; i++)
{
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
|