From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com [74.125.82.44]) by dpdk.org (Postfix) with ESMTP id 2E7476939 for ; Tue, 28 Jan 2014 17:06:02 +0100 (CET) Received: by mail-wg0-f44.google.com with SMTP id l18so1156530wgh.11 for ; Tue, 28 Jan 2014 08:07:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=59tqlUr7OZUYazNqueKmD0VMk6eix0pB10ZuTT6GOxs=; b=LJ6igB9drrUTR+IcZuCmmayvqJLVqbozR+nrsnBHF5e1zx5xOWP4e1GW8mQ5lTSv8D 0ZNSjWKUd6hw06ZbfH9q2i23MbmY5zyrKBr63tCvrWmcrbEmLV7O0kj7fAz4PgFMKVrq kerTM/AxNAc8kmmW23nP+3l/MG/eU0tv6Nh4mp6pwJgLQ3WljJb1uC5b+3fYfKy+exz6 zM0lz8vaLgLge9a1OqcjTPJ6rzdkNBObkxnObpWwGNEJScY0J8e9BJ7xb0pyVXEuyPqs gNqEy3gNjbAkRPiUdXgP1NVFcwmTb1G7Bvoq8UwyF/NLqXG0GrH1eKiS20wOW9UG3uep 5NqA== X-Gm-Message-State: ALoCoQne9baFMiVoC6U9xUYIKE93wtjf8uJZxZ1FEJ7WqGfQOe0eTK3i84+pnRFZxagRbv/RZJKh X-Received: by 10.194.61.133 with SMTP id p5mr326673wjr.73.1390925240688; Tue, 28 Jan 2014 08:07:20 -0800 (PST) Received: from glumotte.dev.6wind.com (6wind.net2.nerim.net. [213.41.180.237]) by mx.google.com with ESMTPSA id d6sm36407821wic.9.2014.01.28.08.07.17 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 28 Jan 2014 08:07:18 -0800 (PST) From: Olivier Matz To: dev@dpdk.org Date: Tue, 28 Jan 2014 17:06:41 +0100 Message-Id: <1390925204-10800-9-git-send-email-olivier.matz@6wind.com> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1390925204-10800-1-git-send-email-olivier.matz@6wind.com> References: <1390925204-10800-1-git-send-email-olivier.matz@6wind.com> Subject: [dpdk-dev] [PATCH 08/11] kvargs: add const attribute in handler parameters X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jan 2014 16:06:02 -0000 The "value" argument is read-only and should be const. Signed-off-by: Olivier Matz --- lib/librte_kvargs/rte_kvargs.h | 2 +- lib/librte_pmd_pcap/rte_eth_pcap.c | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h index 352ae9a..35572ba 100644 --- a/lib/librte_kvargs/rte_kvargs.h +++ b/lib/librte_kvargs/rte_kvargs.h @@ -64,7 +64,7 @@ extern "C" { #define RTE_KVARGS_KV_DELIM "=" /** Type of callback function used by rte_kvargs_process() */ -typedef int (*arg_handler_t)(char *value, void *opaque); +typedef int (*arg_handler_t)(const char *value, void *opaque); /** A key/value association */ struct rte_kvargs_pair { diff --git a/lib/librte_pmd_pcap/rte_eth_pcap.c b/lib/librte_pmd_pcap/rte_eth_pcap.c index 1f46cc9..8484497 100644 --- a/lib/librte_pmd_pcap/rte_eth_pcap.c +++ b/lib/librte_pmd_pcap/rte_eth_pcap.c @@ -419,10 +419,10 @@ static struct eth_dev_ops ops = { * reference of it for use it later on. */ static int -open_rx_pcap(char *value, void *extra_args) +open_rx_pcap(const char *value, void *extra_args) { unsigned i; - char *pcap_filename = value; + const char *pcap_filename = value; struct rx_pcaps *pcaps = extra_args; pcap_t *rx_pcap; @@ -442,10 +442,10 @@ open_rx_pcap(char *value, void *extra_args) * for use it later on. */ static int -open_tx_pcap(char *value, void *extra_args) +open_tx_pcap(const char *value, void *extra_args) { unsigned i; - char *pcap_filename = value; + const char *pcap_filename = value; struct tx_pcaps *dumpers = extra_args; pcap_t *tx_pcap; pcap_dumper_t *dumper; @@ -492,7 +492,7 @@ open_iface_live(const char *iface, pcap_t **pcap) { * Opens an interface for reading and writing */ static inline int -open_rx_tx_iface(char *value, void *extra_args) +open_rx_tx_iface(const char *value, void *extra_args) { const char *iface = value; pcap_t **pcap = extra_args; @@ -506,7 +506,7 @@ open_rx_tx_iface(char *value, void *extra_args) * Opens a NIC for reading packets from it */ static inline int -open_rx_iface(char *value, void *extra_args) +open_rx_iface(const char *value, void *extra_args) { unsigned i; const char *iface = value; @@ -526,7 +526,7 @@ open_rx_iface(char *value, void *extra_args) * Opens a NIC for writing packets to it */ static inline int -open_tx_iface(char *value, void *extra_args) +open_tx_iface(const char *value, void *extra_args) { unsigned i; const char *iface = value; -- 1.8.4.rc3