File signed-compare.patch of Package jdslabs-xmos-dfu
diff --git a/xmos_dfu/xmosdfu.cpp b/xmos_dfu/xmosdfu.cpp
index ad32901..6c32232 100644
--- a/xmos_dfu/xmosdfu.cpp
+++ b/xmos_dfu/xmosdfu.cpp
@@ -43,6 +43,7 @@ DEALINGS WITH THE SOFTWARE OR DOCUMENTATION.
#include <stdlib.h>
#include <string.h>
#include <time.h>
+#include <unistd.h>
/* libusb 1.0.0-dev must be installed. Please see README */
#ifdef __linux
@@ -111,7 +112,7 @@ static int find_xmos_device(unsigned int id, unsigned int list)
libusb_device *dev;
libusb_device **devs;
int i = 0;
- int found = 0;
+ unsigned int found = 0;
libusb_get_device_list(NULL, &devs);
@@ -123,7 +124,7 @@ static int find_xmos_device(unsigned int id, unsigned int list)
if(desc.idVendor == XMOS_VID || desc.idVendor == THESYCON_VID)
{
- for(int j = 0; j < sizeof(pidList)/sizeof(unsigned short); j++)
+ for(size_t j = 0; j < sizeof(pidList)/sizeof(unsigned short); j++)
{
if(desc.idProduct == pidList[j] && !list)
{
@@ -318,7 +319,7 @@ int write_dfu_image(char *file) {
const int progress_width = 50;
int last_percent = -1;
- for (i = 0; i < num_blocks; i++) {
+ for (i = 0; i < (int)num_blocks; i++) {
memset(block_data, 0x0, block_size);
fread(block_data, 1, block_size, inFile);
dfu_download(0, dfuBlockCount, block_size, block_data);
@@ -509,7 +510,8 @@ int main(int argc, char **argv) {
printf("Waiting for XMOS device to restart and enter DFU mode...\n");
// Wait for device to enter dfu mode and restart
- system("sleep 3");
+ // system("sleep 3");
+ sleep(3);
// NOW IN DFU APPLICATION MODE
@@ -558,7 +560,8 @@ int main(int argc, char **argv) {
printf("... Reverting DAC to factory image\n");
xmos_dfu_revertfactory();
// Give device time to revert firmware
- system("sleep 2");
+ // system("sleep 2");
+ sleep(2);
xmos_dfu_resetfromdfu(XMOS_DFU_IF);
}
else{