1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

gnrc_tcp: abs() -> labs() for int32_t

Fixes compilation on msp430 and probably avr.
This commit is contained in:
Kaspar Schleiser 2020-02-26 14:05:09 +01:00
parent 5dd24e12bf
commit acd47f0c1f

View File

@ -455,7 +455,7 @@ int _pkt_acknowledge(gnrc_tcp_tcb_t *tcb, const uint32_t ack)
/* If this is a subsequent sample */
else {
tcb->rtt_var = (tcb->rtt_var / CONFIG_GNRC_TCP_RTO_B_DIV) * (CONFIG_GNRC_TCP_RTO_B_DIV-1);
tcb->rtt_var += abs(tcb->srtt - rtt) / CONFIG_GNRC_TCP_RTO_B_DIV;
tcb->rtt_var += labs(tcb->srtt - rtt) / CONFIG_GNRC_TCP_RTO_B_DIV;
tcb->srtt = (tcb->srtt / CONFIG_GNRC_TCP_RTO_A_DIV) * (CONFIG_GNRC_TCP_RTO_A_DIV-1);
tcb->srtt += rtt / CONFIG_GNRC_TCP_RTO_A_DIV;
}