File tree 1 file changed +4
-6
lines changed
1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,7 @@ class DoubleBufferedEPOutHandler : public EPHandler {
260
260
virtual uint32_t recv (void *_data, uint32_t len)
261
261
{
262
262
uint8_t *data = reinterpret_cast <uint8_t *>(_data);
263
+ uint32_t i = 0 ;
263
264
264
265
// R/W: current, first0/1, ready0/1, notify
265
266
// R : last0/1, data0/1
@@ -270,8 +271,7 @@ class DoubleBufferedEPOutHandler : public EPHandler {
270
271
}
271
272
}
272
273
// when ready0==true the buffer is not being filled and last0 is constant
273
- uint32_t i;
274
- for (i=0 ; i<len && first0 < last0; i++) {
274
+ for (; i<len && first0 < last0; i++) {
275
275
data[i] = data0[first0++];
276
276
}
277
277
if (first0 == last0) {
@@ -285,16 +285,14 @@ class DoubleBufferedEPOutHandler : public EPHandler {
285
285
}
286
286
}
287
287
}
288
- return i;
289
288
} else {
290
289
synchronized {
291
290
if (!ready1) {
292
291
return 0 ;
293
292
}
294
293
}
295
294
// when ready1==true the buffer is not being filled and last1 is constant
296
- uint32_t i;
297
- for (i=0 ; i<len && first1 < last1; i++) {
295
+ for (; i<len && first1 < last1; i++) {
298
296
data[i] = data1[first1++];
299
297
}
300
298
if (first1 == last1) {
@@ -308,8 +306,8 @@ class DoubleBufferedEPOutHandler : public EPHandler {
308
306
}
309
307
}
310
308
}
311
- return i;
312
309
}
310
+ return i;
313
311
}
314
312
315
313
virtual void handleEndpoint ()
You can’t perform that action at this time.
0 commit comments