diff options
Diffstat (limited to '')
-rw-r--r-- | src/interface.c | 10 | ||||
-rw-r--r-- | src/interface.h | 4 | ||||
-rw-r--r-- | src/sllist.c | 8 | ||||
-rw-r--r-- | src/sllist.h | 4 | ||||
-rw-r--r-- | src/tag.c | 4 | ||||
-rw-r--r-- | src/tag.h | 2 |
6 files changed, 16 insertions, 16 deletions
diff --git a/src/interface.c b/src/interface.c index db5959f3a..ade2e36fc 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; @@ -689,7 +689,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; diff --git a/src/interface.h b/src/interface.h index a364f7922..c83381319 100644 --- a/src/interface.h +++ b/src/interface.h @@ -22,10 +22,10 @@ #include "os_compat.h" void initInterfaces(void); -void openAInterface(int fd, struct sockaddr *addr); +void openAInterface(int fd, const struct sockaddr *addr); void freeAllInterfaces(void); void closeOldInterfaces(void); -int interfacePrintWithFD(int fd, char *buffer, size_t len); +int interfacePrintWithFD(int fd, const char *buffer, size_t len); int doIOForInterfaces(void); diff --git a/src/sllist.c b/src/sllist.c index cfe392d60..0f4529fd3 100644 --- a/src/sllist.c +++ b/src/sllist.c @@ -34,22 +34,22 @@ struct strnode *new_strnode(char *s) return x; } -struct strnode *new_strnode_dup(char *s, const size_t size) +struct strnode *new_strnode_dup(const char *s, const size_t size) { struct strnode *x = xmalloc(sizeof(struct strnode) + size); x->next = NULL; x->data = ((char *)x + sizeof(struct strnode)); - memcpy((void *)x->data, (void*)s, size); + memcpy((void *)x->data, (const void*)s, size); return x; } -struct sllnode *new_sllnode(void *s, const size_t size) +struct sllnode *new_sllnode(const void *s, const size_t size) { struct sllnode *x = xmalloc(sizeof(struct sllnode) + size); x->next = NULL; x->size = size; x->data = ((char *)x + sizeof(struct sllnode)); - memcpy(x->data, (void *)s, size); + memcpy(x->data, (const void *)s, size); return x; } diff --git a/src/sllist.h b/src/sllist.h index ba7d8ea95..e8cb8805d 100644 --- a/src/sllist.h +++ b/src/sllist.h @@ -42,11 +42,11 @@ struct sllnode { struct strnode *new_strnode(char *s); -struct strnode *new_strnode_dup(char *s, const size_t size); +struct strnode *new_strnode_dup(const char *s, const size_t size); struct strnode *dup_strlist(struct strnode *old); -struct sllnode *new_sllnode(void *s, const size_t size); +struct sllnode *new_sllnode(const void *s, const size_t size); #endif /* SLLIST_H */ @@ -697,7 +697,7 @@ int mpdTagsAreEqual(MpdTag * tag1, MpdTag * tag2) } static void appendToTagItems(MpdTag * tag, enum tag_type type, - char *value, size_t len) + const char *value, size_t len) { unsigned int i = tag->numOfItems; char *duplicated = xmalloc(len + 1); @@ -718,7 +718,7 @@ static void appendToTagItems(MpdTag * tag, enum tag_type type, } void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType, - char *value, size_t len) + const char *value, size_t len) { if (ignoreTagItems[itemType]) { @@ -73,7 +73,7 @@ void clearItemsFromMpdTag(MpdTag * tag, enum tag_type itemType); void freeMpdTag(MpdTag * tag); void addItemToMpdTagWithLen(MpdTag * tag, enum tag_type itemType, - char *value, size_t len); + const char *value, size_t len); #define addItemToMpdTag(tag, itemType, value) \ addItemToMpdTagWithLen(tag, itemType, value, strlen(value)) |