From 8176880173f593dc6833bf2ef52eb1c24786a935 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Mon, 19 Sep 2011 10:55:27 -0500 Subject: Simplify setsockopt() casting workaround On Win32, the third setsockopt parameter has type (char *) while on POSIX systems it is (void *). However, given that it is a no-op cast to go from a char pointer to a void pointer, we can cast to a char pointer (with a possible const modifier) on all platforms and satisfy the compiler. Signed-off-by: Dan McGee --- src/output/raop_output_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/output/raop_output_plugin.c') diff --git a/src/output/raop_output_plugin.c b/src/output/raop_output_plugin.c index 4bb20c70d..68d6897cb 100644 --- a/src/output/raop_output_plugin.c +++ b/src/output/raop_output_plugin.c @@ -328,7 +328,7 @@ open_udp_socket(char *hostname, unsigned short *port, GError **error_r) { int sd; - int size = 30000; + const int size = 30000; /* socket creation */ sd = socket(PF_INET, SOCK_DGRAM, 0); @@ -338,7 +338,7 @@ open_udp_socket(char *hostname, unsigned short *port, g_strerror(errno)); return -1; } - if (setsockopt(sd, SOL_SOCKET, SO_SNDBUF, (void *) &size, sizeof(size)) < 0) { + if (setsockopt(sd, SOL_SOCKET, SO_SNDBUF, (const char *) &size, sizeof(size)) < 0) { g_set_error(error_r, raop_output_quark(), errno, "failed to set UDP buffer size: %s", g_strerror(errno)); -- cgit v1.2.3