return SR_ERR;
}
- sr_spew("Wrote %d/%d bytes.", ret, count);
+ sr_spew("Wrote %zd/%zu bytes.", ret, count);
return ret;
}
}
if (ret > 0)
- sr_spew("Read %d/%d bytes.", ret, count);
+ sr_spew("Read %zd/%zu bytes.", ret, count);
return ret;
}
{
uint64_t start, time, byte_delay_us;
size_t ibuf, i, maxlen;
- int len;
+ ssize_t len;
maxlen = *buflen;
if ((ibuf - i) >= packet_size) {
/* We have at least a packet's worth of data. */
if (is_valid(&buf[i])) {
- sr_spew("Found valid %d-byte packet after "
+ sr_spew("Found valid %zu-byte packet after "
"%" PRIu64 "ms.", (ibuf - i), time);
*buflen = ibuf;
return SR_OK;
} else {
- sr_spew("Got %d bytes, but not a valid "
+ sr_spew("Got %zu bytes, but not a valid "
"packet.", (ibuf - i));
}
/* Not a valid packet. Continue searching. */
}
if (time >= timeout_ms) {
/* Timeout */
- sr_dbg("Detection timed out after %dms.", time);
+ sr_dbg("Detection timed out after %" PRIu64 "ms.", time);
break;
}
if (len < 1)
*buflen = ibuf;
- sr_err("Didn't find a valid packet (read %d bytes).", *buflen);
+ sr_err("Didn't find a valid packet (read %zu bytes).", *buflen);
return SR_ERR;
}