Zach Welch <zw@superlucidity.net> fix ft2232/presto warnings
authoroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 20 Apr 2009 06:40:45 +0000 (06:40 +0000)
committeroharboe <oharboe@b42882b7-edfa-0310-969c-e2dbd0fdcd60>
Mon, 20 Apr 2009 06:40:45 +0000 (06:40 +0000)
git-svn-id: svn://svn.berlios.de/openocd/trunk@1476 b42882b7-edfa-0310-969c-e2dbd0fdcd60

src/jtag/bitq.c
src/jtag/ft2232.c
src/jtag/presto.c

index feed2180ccf3d0fe8a585d926eadf54182520f8c..5f9227eedcdaadf0cae0c6c0036f38e080f587df 100644 (file)
@@ -39,7 +39,7 @@ bitq_interface_t* bitq_interface;       /* low level bit queue interface */
 bitq_state_t      bitq_in_state;        /* state of input queue */
 
 u8* bitq_in_buffer;                     /* buffer dynamically reallocated as needed */
-unsigned long     bitq_in_bufsize = 32; /* min. buffer size */
+int     bitq_in_bufsize = 32; /* min. buffer size */
 
 /*
  * input queue processing does not use jtag_read_buffer() to avoid unnecessary overhead
index d26b8e1c77eb990b82218bdf848b820418d010fa..f4c3e4b5a53cb2214add3ad5830fa505e77e6acc 100644 (file)
@@ -158,7 +158,7 @@ ft2232_layout_t            ft2232_layouts[] =
        { "stm32stick",           stm32stick_init,           stm32stick_reset,   NULL                    },
        { "axm0432_jtag",         axm0432_jtag_init,         axm0432_jtag_reset, NULL                    },
        {"sheevaplug",            sheevaplug_init,           sheevaplug_reset,   NULL                    },
-       { NULL,                   NULL,                      NULL },
+       { NULL,                   NULL,                      NULL,               NULL                    },
 };
 
 static u8                  nTRST, nTRSTnOE, nSRST, nSRSTnOE;
@@ -233,7 +233,7 @@ int ft2232_write(u8* buf, int size, u32* bytes_written)
 }
 
 
-int ft2232_read(u8* buf, int size, u32* bytes_read)
+int ft2232_read(u8* buf, u32 size, u32* bytes_read)
 {
 #if BUILD_FT2232_FTD2XX == 1
        DWORD     dw_bytes_read;
@@ -1607,7 +1607,7 @@ static int ft2232_init_ftd2xx(u16 vid, u16 pid, int more, int* try_more)
                if (status == FT_OK)
                {
                        char** desc_array = malloc( sizeof(char*) * (num_devices + 1) );
-                       int    i;
+                       u32 i;
 
                        for (i = 0; i < num_devices; i++)
                                desc_array[i] = malloc(64);
index 0e532817fc4453f7704b761ac09ae312182b9cf9..8ad4369259a1d118b0f84faf8a8e657c9cc0309c 100644 (file)
@@ -138,7 +138,7 @@ u8 presto_init_seq[] =
        0x80, 0xA0, 0xA8, 0xB0, 0xC0, 0xE0
 };
 
-int presto_write(u8 *buf, int size)
+int presto_write(u8 *buf, u32 size)
 {
 #if BUILD_PRESTO_FTD2XX == 1
        DWORD ftbytes;
@@ -160,14 +160,14 @@ int presto_write(u8 *buf, int size)
 
        if (ftbytes != size)
        {
-               LOG_ERROR("couldn't write the requested number of bytes to PRESTO (%i < %i)", ftbytes, size);
+               LOG_ERROR("couldn't write the requested number of bytes to PRESTO (%u < %u)", (u32)ftbytes, size);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
        return ERROR_OK;
 }
 
-int presto_read(u8* buf, int size)
+int presto_read(u8* buf, u32 size)
 {
 #if BUILD_PRESTO_FTD2XX == 1
        DWORD ftbytes;
@@ -202,7 +202,7 @@ int presto_read(u8* buf, int size)
        if (ftbytes != size)
        {
                /* this is just a warning, there might have been timeout when detecting PRESTO, which is not fatal */
-               LOG_WARNING("couldn't read the requested number of bytes from PRESTO (%i < %i)", ftbytes, size);
+               LOG_WARNING("couldn't read the requested number of bytes from PRESTO (%u < %u)", (u32)ftbytes, size);
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
@@ -212,7 +212,7 @@ int presto_read(u8* buf, int size)
 #if BUILD_PRESTO_FTD2XX == 1
 int presto_open_ftd2xx(char *req_serial)
 {
-       int i;
+       u32 i;
        DWORD numdevs;
        DWORD vidpid;
        char devname[FT_DEVICE_NAME_LEN];
@@ -238,7 +238,7 @@ int presto_open_ftd2xx(char *req_serial)
                return ERROR_JTAG_DEVICE_ERROR;
        }
 
-       LOG_DEBUG("FTDI devices available: %i", numdevs);
+       LOG_DEBUG("FTDI devices available: %lu", numdevs);
        for (i = 0; i < numdevs; i++)
        {
                if ((presto->status = FT_Open(i, &(presto->handle))) != FT_OK)
@@ -257,7 +257,7 @@ int presto_open_ftd2xx(char *req_serial)
                                break;
                }
                else
-                       LOG_DEBUG("FT_GetDeviceInfo failed: %i", presto->status);
+                       LOG_DEBUG("FT_GetDeviceInfo failed: %lu", presto->status);
 
                LOG_DEBUG("FTDI device %i does not match, closing", i);
                FT_Close(presto->handle);