Fix declarations and types conversions to build with -Werror --- ./encode.c +++ ./encode.c @@ -15,7 +15,7 @@ const char urlencstring[16] = "0123456789abcdef"; -char *urlencode(char *dest, char *source) +unsigned char *urlencode(unsigned char *dest, unsigned char *source) { unsigned char *p, *q; int digit; @@ -47,7 +47,7 @@ char *urlencode(char *dest, char *source) * */ -char *urlnencode(char *dest, char *source, size_t length) +unsigned char *urlnencode(unsigned char *dest, unsigned char *source, size_t length) { unsigned char *p, *q; int digit; --- ./encode.h +++ ./encode.h @@ -6,8 +6,8 @@ #ifndef __LIBSHOUT_ENCODE_H #define __LIBSHOUT_ENCODE_H -char *urlencode(char *dest, char *source); -char *urlnencode(char *dest, char *source, size_t length); +unsigned char *urlencode(unsigned char *dest, unsigned char *source); +unsigned char *urlnencode(unsigned char *dest, unsigned char *source, size_t length); #endif /* __LIBSHOUT_ENCODE_H */ --- ./shout.c +++ ./shout.c @@ -19,6 +19,7 @@ #include "sock.h" #include "timing.h" #include "mp3.h" +#include "encode.h" /* * INTERNAL PROTOTYPES @@ -278,10 +279,10 @@ void shout_sleep(shout_conn_t *self) } } -int shout_update_metadata(shout_conn_t *self, char *metadata) +int shout_update_metadata(shout_conn_t *self, unsigned char *metadata) { int s, res; - char *metatemp; + unsigned char *metatemp; /* sanity check */ if ((self->ip == NULL) || (self->password == NULL) || (self->port <= 0) || !self->connected) { @@ -295,7 +296,7 @@ int shout_update_metadata(shout_conn_t *self, char *metadata) return 0; } - metatemp = (char *)malloc(strlen(metadata) * 3 + 1); + metatemp = (unsigned char *)malloc(strlen((char *)metadata) * 3 + 1); if (metatemp == NULL) { sock_close(s); self->error = SHOUTERR_MALLOC; --- ./shout.h +++ ./shout.h @@ -93,7 +93,7 @@ void shout_sleep(shout_conn_t *self); ** ** the metadata info for the stream. meta is in block format */ -int shout_update_metadata(shout_conn_t *self, char *metadata); +int shout_update_metadata(shout_conn_t *self, unsigned char *metadata); /* ** shout_strerror --- ./sock.c +++ ./sock.c @@ -63,10 +63,6 @@ #include #endif -#ifndef HAVE_SOCKLEN_T -#define socklen_t int -#endif - #ifndef _WIN32 extern int h_errno, errno; #endif --- ./sock.h +++ ./sock.h @@ -34,7 +34,9 @@ typedef int SOCKET; #endif #define SOCK_BLOCK 0 +#ifndef SOCK_NONBLOCK #define SOCK_NONBLOCK 1 +#endif /* sock connect macro */ #define sock_connect(h, p) sock_connect_wto(h, p, 0)