mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Remove last use of the MIN
macro.
We use functions for this instead.
This commit is contained in:
parent
503d9f7e22
commit
5d15b5930d
|
@ -245,18 +245,14 @@ void toxav_iterate(ToxAV *av)
|
|||
ac_iterate(i->audio.second);
|
||||
vc_iterate(i->video.second);
|
||||
|
||||
// TODO(iphydf): Find out what MIN-semantics are desired here and
|
||||
// use a min_* function from util.h.
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
|
||||
if (i->msi_call->self_capabilities & msi_CapRAudio &&
|
||||
i->msi_call->peer_capabilities & msi_CapSAudio) {
|
||||
rc = MIN(i->audio.second->lp_frame_duration, rc);
|
||||
rc = min_s32(i->audio.second->lp_frame_duration, rc);
|
||||
}
|
||||
|
||||
if (i->msi_call->self_capabilities & msi_CapRVideo &&
|
||||
i->msi_call->peer_capabilities & msi_CapSVideo) {
|
||||
rc = MIN(i->video.second->lcfd, (uint32_t) rc);
|
||||
rc = min_u32(i->video.second->lcfd, rc);
|
||||
}
|
||||
|
||||
uint32_t fid = i->friend_number;
|
||||
|
|
|
@ -100,6 +100,11 @@ int32_t max_s32(int32_t a, int32_t b)
|
|||
return a > b ? a : b;
|
||||
}
|
||||
|
||||
int32_t min_s32(int32_t a, int32_t b)
|
||||
{
|
||||
return a < b ? a : b;
|
||||
}
|
||||
|
||||
uint32_t min_u32(uint32_t a, uint32_t b)
|
||||
{
|
||||
return a < b ? a : b;
|
||||
|
|
|
@ -47,6 +47,7 @@ void net_to_host(uint8_t *num, uint16_t numbytes);
|
|||
int create_recursive_mutex(pthread_mutex_t *mutex);
|
||||
|
||||
int32_t max_s32(int32_t a, int32_t b);
|
||||
int32_t min_s32(int32_t a, int32_t b);
|
||||
uint32_t min_u32(uint32_t a, uint32_t b);
|
||||
uint64_t min_u64(uint64_t a, uint64_t b);
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user