mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-04 07:11:10 +08:00
cleaning up typecasts
This commit is contained in:
parent
08bf63c748
commit
ee0409d8d0
1 changed files with 5 additions and 4 deletions
|
@ -222,13 +222,14 @@ bool uart_send(const serial_port sp, const byte_t* pbtTx, const size_t szTxLen)
|
||||||
size_t szPos = 0;
|
size_t szPos = 0;
|
||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
|
const serial_port_unix* spu = (serial_port_unix*)sp;
|
||||||
|
|
||||||
while (szPos < szTxLen) {
|
while (szPos < szTxLen) {
|
||||||
// Reset file descriptor
|
// Reset file descriptor
|
||||||
FD_ZERO(&rfds);
|
FD_ZERO(&rfds);
|
||||||
FD_SET(((serial_port_unix*)sp)->fd, &rfds);
|
FD_SET((spu->fd, &rfds);
|
||||||
tv = timeout;
|
tv = timeout;
|
||||||
res = select(((serial_port_unix*)sp)->fd+1, NULL, &rfds, NULL, &tv);
|
res = select((spu->fd+1, NULL, &rfds, NULL, &tv);
|
||||||
|
|
||||||
// Write error
|
// Write error
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
|
@ -243,7 +244,7 @@ bool uart_send(const serial_port sp, const byte_t* pbtTx, const size_t szTxLen)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send away the bytes
|
// Send away the bytes
|
||||||
res = write(((serial_port_unix*)sp)->fd, pbtTx + szPos, szTxLen-szPos);
|
res = write(spu->fd, pbtTx + szPos, szTxLen-szPos);
|
||||||
|
|
||||||
// Stop if the OS has some troubles sending the data
|
// Stop if the OS has some troubles sending the data
|
||||||
if (res <= 0) {
|
if (res <= 0) {
|
||||||
|
|
Loading…
Reference in a new issue