From a848893d85cd027d831ba0ecae9dacef0a5f0605 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 30 Aug 2008 17:33:07 -0700 Subject: ringbuf: create a new struct rbvec instead of reusing struct iovec Using struct iovec means having to cast iov_base everywhere we want to do pointer arithmetic. Instead, just use rbvec which can be safely casted to iovec whenever we use the readv/writev functions. --- src/inputStream_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/inputStream_http.c') diff --git a/src/inputStream_http.c b/src/inputStream_http.c index a6c715459..cc31ed435 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -461,7 +461,7 @@ static ssize_t buffer_data(InputStream *is) assert(pthread_equal(data->io_thread, pthread_self())); assert_state2(CONN_STATE_BUFFER, CONN_STATE_PREBUFFER); - if (!ringbuf_get_write_vector(data->rb, vec)) { + if (!ringbuf_get_write_vector(data->rb, (struct rbvec *)vec)) { data->state = CONN_STATE_BUFFER_FULL; return 0; } -- cgit v1.2.3 From f150a02a3f025e71bac74dd9ca3eb262daeeed6e Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 25 Aug 2008 15:49:06 +0200 Subject: fix warnings in the HTTP client Fix a "unused argument" warning, and several warnings regarding void pointer calculation. --- src/inputStream_http.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/inputStream_http.c') diff --git a/src/inputStream_http.c b/src/inputStream_http.c index cc31ed435..8e4e0e115 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -847,7 +847,8 @@ static void parse_icy_metadata(InputStream * is, char *metadata, size_t size) } } -static size_t read_with_metadata(InputStream *is, void *ptr, ssize_t len) +static size_t read_with_metadata(InputStream *is, unsigned char *ptr, + ssize_t len) { struct http_data *data = (struct http_data *) is->data; size_t readed = 0; @@ -887,13 +888,13 @@ static size_t read_with_metadata(InputStream *is, void *ptr, ssize_t len) return readed; } -size_t inputStream_httpRead(InputStream * is, void *ptr, size_t size, +size_t inputStream_httpRead(InputStream * is, void *_ptr, size_t size, size_t nmemb) { struct http_data *data = (struct http_data *) is->data; size_t len = size * nmemb; size_t r; - void *ptr0 = ptr; + unsigned char *ptr = _ptr, *ptr0 = _ptr; long tries = len / 128; /* try harder for bigger reads */ retry: -- cgit v1.2.3 From ac5ec35a6e222f635912f6a7eaf3c036c71367b6 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 26 Aug 2008 08:27:02 +0200 Subject: enable -Wpointer-arith, -Wstrict-prototypes Also enable -Wunused-parameter - this forces us to add the gcc "unused" attribute to a lot of parameters (mostly library callback functions), but it's worth it during code refactorizations. --- src/inputStream_http.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/inputStream_http.c') diff --git a/src/inputStream_http.c b/src/inputStream_http.c index 8e4e0e115..8802eda2b 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -750,7 +750,7 @@ closed: return NULL; } -int inputStream_httpBuffer(InputStream *is) +int inputStream_httpBuffer(mpd_unused InputStream *is) { return 0; } -- cgit v1.2.3