freemyipod r790 - Code Review

Jump to: navigation, search
Repository:freemyipod
Revision:r789‎ | r790 | r791 >
Date:19:35, 18 November 2011
Author:user890104
Status:new
Tags:
Comment:
emCOREFS: fix variable reusing fail, and finally make printing of ssize_t portable
Modified paths:
  • /emcore/trunk/tools/emcorefs/usb.c (modified) (history)

Diff [purge]

Index: emcore/trunk/tools/emcorefs/usb.c
@@ -62,7 +62,7 @@
6363 {
6464 libusb_device **devs, *dev;
6565 ssize_t devs_cnt;
66 - int res, i;
 66+ int res, i, j;
6767 struct libusb_device_descriptor dev_desc;
6868 uint8_t found = 0;
6969 struct libusb_config_descriptor* cfg_desc;
@@ -82,7 +82,7 @@
8383 }
8484
8585 #ifdef DEBUG
86 - fprintf(stderr, "Found %ld USB devices!\n", devs_cnt);
 86+ fprintf(stderr, "Found %Zd USB devices!\n", devs_cnt);
8787 #endif
8888 for (i = 0; i < devs_cnt; ++i)
8989 {
@@ -164,15 +164,15 @@
165165 fprintf(stderr, "Endpoints:");
166166 #endif
167167
168 - for (i = 0; i < 4; ++i)
 168+ for (j = 0; j < 4; ++j)
169169 {
170 - ep_desc = &iface_desc->endpoint[i];
 170+ ep_desc = &iface_desc->endpoint[j];
171171
172172 #ifdef DEBUG
173 - fprintf(stderr, " %d at 0x%02x", i, ep_desc->bEndpointAddress);
 173+ fprintf(stderr, " %d at 0x%02x", j, ep_desc->bEndpointAddress);
174174 #endif
175175
176 - switch (i) {
 176+ switch (j) {
177177 case 0:
178178 emcore_usb_eps_addr.cout = ep_desc->bEndpointAddress;
179179 break;