use const for char buffer in uclient_write
authorRafał Miłecki <zajec5@gmail.com>
Wed, 21 Jan 2015 21:48:35 +0000 (22:48 +0100)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 22 Jan 2015 10:59:43 +0000 (11:59 +0100)
We are not supposed to modify it and ustream accepts const already.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
uclient-backend.h
uclient-http.c
uclient.c
uclient.h

index a5cf4f3..9ccc799 100644 (file)
@@ -32,7 +32,7 @@ struct uclient_backend {
        void (*disconnect)(struct uclient *cl);
 
        int (*read)(struct uclient *cl, char *buf, unsigned int len);
        void (*disconnect)(struct uclient *cl);
 
        int (*read)(struct uclient *cl, char *buf, unsigned int len);
-       int (*write)(struct uclient *cl, char *buf, unsigned int len);
+       int (*write)(struct uclient *cl, const char *buf, unsigned int len);
 };
 
 void uclient_backend_set_error(struct uclient *cl, int code);
 };
 
 void uclient_backend_set_error(struct uclient *cl, int code);
index af43b05..9f9fac9 100644 (file)
@@ -931,7 +931,7 @@ uclient_http_set_header(struct uclient *cl, const char *name, const char *value)
 }
 
 static int
 }
 
 static int
-uclient_http_send_data(struct uclient *cl, char *buf, unsigned int len)
+uclient_http_send_data(struct uclient *cl, const char *buf, unsigned int len)
 {
        struct uclient_http *uh = container_of(cl, struct uclient_http, uc);
 
 {
        struct uclient_http *uh = container_of(cl, struct uclient_http, uc);
 
index d599763..21f6f5d 100644 (file)
--- a/uclient.c
+++ b/uclient.c
@@ -221,7 +221,7 @@ void uclient_free(struct uclient *cl)
        free(url);
 }
 
        free(url);
 }
 
-int uclient_write(struct uclient *cl, char *buf, int len)
+int uclient_write(struct uclient *cl, const char *buf, int len)
 {
        if (!cl->backend->write)
                return -1;
 {
        if (!cl->backend->write)
                return -1;
index 5904a38..0c76f6e 100644 (file)
--- a/uclient.h
+++ b/uclient.h
@@ -106,7 +106,7 @@ int uclient_connect(struct uclient *cl);
 void uclient_disconnect(struct uclient *cl);
 
 int uclient_read(struct uclient *cl, char *buf, int len);
 void uclient_disconnect(struct uclient *cl);
 
 int uclient_read(struct uclient *cl, char *buf, int len);
-int uclient_write(struct uclient *cl, char *buf, int len);
+int uclient_write(struct uclient *cl, const char *buf, int len);
 int uclient_request(struct uclient *cl);
 
 char *uclient_get_addr(char *dest, int *port, union uclient_addr *a);
 int uclient_request(struct uclient *cl);
 
 char *uclient_get_addr(char *dest, int *port, union uclient_addr *a);