mirror of https://github.com/ARMmbed/mbed-os.git
Silence signed/unsigned comparison warnings in GCC.
Why do the wait APIs take a signed integer if they are going to be compared to unsigned quantities?pull/24/head
parent
c411823656
commit
8fe7276b98
|
@ -26,5 +26,5 @@ void wait_ms(int ms) {
|
|||
|
||||
void wait_us(int us) {
|
||||
uint32_t start = us_ticker_read();
|
||||
while ((us_ticker_read() - start) < us);
|
||||
while ((us_ticker_read() - start) < (uint32_t)us);
|
||||
}
|
||||
|
|
|
@ -697,7 +697,7 @@ int ethernet_receive() {
|
|||
if(receive_idx == -1) {
|
||||
receive_idx = LPC_EMAC->RxConsumeIndex;
|
||||
} else {
|
||||
while(!(rxstat[receive_idx].Info & RINFO_LAST_FLAG) && (receive_idx != LPC_EMAC->RxProduceIndex)) {
|
||||
while(!(rxstat[receive_idx].Info & RINFO_LAST_FLAG) && ((uint32_t)receive_idx != LPC_EMAC->RxProduceIndex)) {
|
||||
receive_idx = rinc(receive_idx, NUM_RX_FRAG);
|
||||
}
|
||||
unsigned int info = rxstat[receive_idx].Info;
|
||||
|
@ -713,7 +713,7 @@ int ethernet_receive() {
|
|||
LPC_EMAC->RxConsumeIndex = receive_idx;
|
||||
}
|
||||
|
||||
if(receive_idx == LPC_EMAC->RxProduceIndex) {
|
||||
if((uint32_t)receive_idx == LPC_EMAC->RxProduceIndex) {
|
||||
receive_idx = -1;
|
||||
return 0;
|
||||
}
|
||||
|
@ -762,7 +762,7 @@ int ethernet_read(char *data, int dlen) {
|
|||
void *pdst, *psrc;
|
||||
int doff = 0;
|
||||
|
||||
if(receive_idx == LPC_EMAC->RxProduceIndex || receive_idx == -1) {
|
||||
if((uint32_t)receive_idx == LPC_EMAC->RxProduceIndex || receive_idx == -1) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue