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
}
{
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));
}
{
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));
}
{
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));
}
}
int pa_socket_set_rcvbuf(int fd, size_t l) {
- int bufsz = (int)l;
+ int bufsz = (int) 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;
}
}
int pa_socket_set_sndbuf(int fd, size_t l) {
- int bufsz = (int)l;
+ int bufsz = (int) 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;
}