aboutsummaryrefslogtreecommitdiffstats
path: root/src/interface.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-08-28 20:02:17 +0200
committerEric Wong <normalperson@yhbt.net>2008-08-31 03:57:25 -0700
commitc52667aa8eee2a40547026735b9670a2221d4168 (patch)
tree09a27d6adbfbe8b2f54828851b892c6d5d4e19ea /src/interface.c
parentad02ebe21138fed633af5465d1690db103c4934e (diff)
downloadmpd-c52667aa8eee2a40547026735b9670a2221d4168.tar.gz
mpd-c52667aa8eee2a40547026735b9670a2221d4168.tar.xz
mpd-c52667aa8eee2a40547026735b9670a2221d4168.zip
const pointers
The usual bunch of pointer arguments which should be const.
Diffstat (limited to '')
-rw-r--r--src/interface.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/interface.c b/src/interface.c
index 45b81a2f7..83e0084b5 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -234,7 +234,7 @@ static void closeInterface(Interface * interface)
SECURE("interface %i: closed\n", interface->num);
}
-void openAInterface(int fd, struct sockaddr *addr)
+void openAInterface(int fd, const struct sockaddr *addr)
{
unsigned int i;
@@ -249,7 +249,7 @@ void openAInterface(int fd, struct sockaddr *addr)
switch (addr->sa_family) {
#ifdef HAVE_TCP
case AF_INET:
- hostname = (const char *)inet_ntoa(((struct sockaddr_in *)
+ hostname = (const char *)inet_ntoa(((const struct sockaddr_in *)
addr)->sin_addr);
if (!hostname)
hostname = "error getting ipv4 address";
@@ -259,8 +259,8 @@ void openAInterface(int fd, struct sockaddr *addr)
{
static char host[INET6_ADDRSTRLEN + 1];
memset(host, 0, INET6_ADDRSTRLEN + 1);
- if (inet_ntop(AF_INET6, (void *)
- &(((struct sockaddr_in6 *)addr)->
+ if (inet_ntop(AF_INET6, (const void *)
+ &(((const struct sockaddr_in6 *)addr)->
sin6_addr), host,
INET6_ADDRSTRLEN)) {
hostname = (const char *)host;
@@ -686,7 +686,7 @@ static void flushInterfaceBuffer(Interface * interface)
}
}
-int interfacePrintWithFD(int fd, char *buffer, size_t buflen)
+int interfacePrintWithFD(int fd, const char *buffer, size_t buflen)
{
static unsigned int i;
size_t copylen;