mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-04 13:29:59 -05:00
socket-util: drop redundant casts
This commit is contained in:
parent
75f7a971db
commit
a82c6b0cd5
1 changed files with 12 additions and 12 deletions
|
|
@ -151,7 +151,7 @@ void pa_make_socket_low_delay(int fd) {
|
|||
pa_assert(fd >= 0);
|
||||
|
||||
priority = 6;
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_PRIORITY, (void*)&priority, sizeof(priority)) < 0)
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &priority, sizeof(priority)) < 0)
|
||||
pa_log_warn("SO_PRIORITY failed: %s", pa_cstrerror(errno));
|
||||
#endif
|
||||
}
|
||||
|
|
@ -165,9 +165,9 @@ void pa_make_tcp_socket_low_delay(int fd) {
|
|||
{
|
||||
int on = 1;
|
||||
#if defined(SOL_TCP)
|
||||
if (setsockopt(fd, SOL_TCP, TCP_NODELAY, (void*)&on, sizeof(on)) < 0)
|
||||
if (setsockopt(fd, SOL_TCP, TCP_NODELAY, &on, sizeof(on)) < 0)
|
||||
#else
|
||||
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, (void*)&on, sizeof(on)) < 0)
|
||||
if (setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &on, sizeof(on)) < 0)
|
||||
#endif
|
||||
pa_log_warn("TCP_NODELAY failed: %s", pa_cstrerror(errno));
|
||||
}
|
||||
|
|
@ -177,9 +177,9 @@ void pa_make_tcp_socket_low_delay(int fd) {
|
|||
{
|
||||
int tos = IPTOS_LOWDELAY;
|
||||
#ifdef SOL_IP
|
||||
if (setsockopt(fd, SOL_IP, IP_TOS, (void*)&tos, sizeof(tos)) < 0)
|
||||
if (setsockopt(fd, SOL_IP, IP_TOS, &tos, sizeof(tos)) < 0)
|
||||
#else
|
||||
if (setsockopt(fd, IPPROTO_IP, IP_TOS, (void*)&tos, sizeof(tos)) < 0)
|
||||
if (setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) < 0)
|
||||
#endif
|
||||
pa_log_warn("IP_TOS failed: %s", pa_cstrerror(errno));
|
||||
}
|
||||
|
|
@ -195,9 +195,9 @@ void pa_make_udp_socket_low_delay(int fd) {
|
|||
{
|
||||
int tos = IPTOS_LOWDELAY;
|
||||
#ifdef SOL_IP
|
||||
if (setsockopt(fd, SOL_IP, IP_TOS, (void*)&tos, sizeof(tos)) < 0)
|
||||
if (setsockopt(fd, SOL_IP, IP_TOS, &tos, sizeof(tos)) < 0)
|
||||
#else
|
||||
if (setsockopt(fd, IPPROTO_IP, IP_TOS, (void*)&tos, sizeof(tos)) < 0)
|
||||
if (setsockopt(fd, IPPROTO_IP, IP_TOS, &tos, sizeof(tos)) < 0)
|
||||
#endif
|
||||
pa_log_warn("IP_TOS failed: %s", pa_cstrerror(errno));
|
||||
}
|
||||
|
|
@ -209,7 +209,7 @@ int pa_socket_set_rcvbuf(int fd, size_t l) {
|
|||
|
||||
pa_assert(fd >= 0);
|
||||
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, (void*)&bufsz, sizeof(bufsz)) < 0) {
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_RCVBUF, &bufsz, sizeof(bufsz)) < 0) {
|
||||
pa_log_warn("SO_RCVBUF: %s", pa_cstrerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -222,8 +222,8 @@ int pa_socket_set_sndbuf(int fd, size_t l) {
|
|||
|
||||
pa_assert(fd >= 0);
|
||||
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, (void*)&bufsz, sizeof(bufsz)) < 0) {
|
||||
pa_log("SO_SNDBUF: %s", pa_cstrerror(errno));
|
||||
if (setsockopt(fd, SOL_SOCKET, SO_SNDBUF, &bufsz, sizeof(bufsz)) < 0) {
|
||||
pa_log_warn("SO_SNDBUF: %s", pa_cstrerror(errno));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue