From patchwork Wed Jan 21 21:48:35 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= X-Patchwork-Id: 431615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 82B0314012C for ; Thu, 22 Jan 2015 08:48:53 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id CB86D280172; Wed, 21 Jan 2015 22:46:25 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, T_DKIM_INVALID autolearn=no version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 467B3280142 for ; Wed, 21 Jan 2015 22:46:21 +0100 (CET) X-policyd-weight: using cached result; rate: -8.5 Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 21 Jan 2015 22:46:20 +0100 (CET) Received: by mail-wg0-f43.google.com with SMTP id k14so42240613wgh.2 for ; Wed, 21 Jan 2015 13:48:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=o+1JMDQNqbIykH+8HDhBnqS4Ek8/RjVYUISYbvdVJ/Y=; b=rvb6VrFo+BmtlbanMJizq+pEJxrRYqhJXxFOuinE9yeeZKv1WI3zePBq4lrdTt2gn1 wiiM9AtGDRcCYTYKg1ZN6N3auVxEk1CYmLWm5Q41coFDvnt+pEMfrXyB3GNNASU4E5FN NEhZ1CgitEOVhygkPzpZEC9lTzNtXC8SmsDtH64aOXKdqipQ6cmQzp6bq852qfo75RAV kF24I6xvAgET6akqHdn1BGNnyOFMIdpAj2g2AESbrG4gFng2+th1p6wyLsL+wMqzRz5e aq3ImeVDyTN1LN7YXb5TMtrsu5rks5RkwVIl/JmqZPOouz4atesVahK2HjOYUfrcc7cS zrrQ== X-Received: by 10.180.83.5 with SMTP id m5mr25058267wiy.74.1421876920975; Wed, 21 Jan 2015 13:48:40 -0800 (PST) Received: from linux-tdhb.lan (ip-194-187-74-233.konfederacka.maverick.com.pl. [194.187.74.233]) by mx.google.com with ESMTPSA id h13sm505122wiw.4.2015.01.21.13.48.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 13:48:40 -0800 (PST) From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= To: Felix Fietkau Date: Wed, 21 Jan 2015 22:48:35 +0100 Message-Id: <1421876915-17791-1-git-send-email-zajec5@gmail.com> X-Mailer: git-send-email 1.8.4.5 MIME-Version: 1.0 Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH uclient] use const for char buffer in uclient_write X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" We are not supposed to modify it and ustream accepts const already. Signed-off-by: Rafał Miłecki --- uclient-backend.h | 2 +- uclient-http.c | 2 +- uclient.c | 2 +- uclient.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/uclient-backend.h b/uclient-backend.h index a5cf4f3..9ccc799 100644 --- a/uclient-backend.h +++ b/uclient-backend.h @@ -32,7 +32,7 @@ struct uclient_backend { 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); diff --git a/uclient-http.c b/uclient-http.c index af43b05..9f9fac9 100644 --- a/uclient-http.c +++ b/uclient-http.c @@ -931,7 +931,7 @@ uclient_http_set_header(struct uclient *cl, const char *name, const char *value) } 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); diff --git a/uclient.c b/uclient.c index d599763..21f6f5d 100644 --- a/uclient.c +++ b/uclient.c @@ -221,7 +221,7 @@ void uclient_free(struct uclient *cl) 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; diff --git a/uclient.h b/uclient.h index 5904a38..0c76f6e 100644 --- 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); -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);