summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorOlivier Matz <olivier.matz@6wind.com>2014-01-28 17:06:41 +0100
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-02-04 15:40:56 +0100
commit44d8528d4b7189f627f4a04acbda0ab84148a646 (patch)
treefe9d1ee29697896591992e72fbc8579be4e081b4 /lib
parent49b3ab9dc53bc2b36e33e1d87cecf885f26e7112 (diff)
downloaddpdk-44d8528d4b7189f627f4a04acbda0ab84148a646.zip
dpdk-44d8528d4b7189f627f4a04acbda0ab84148a646.tar.gz
dpdk-44d8528d4b7189f627f4a04acbda0ab84148a646.tar.xz
kvargs: add const attribute in handler parameters
The "value" argument is read-only and should be const. Signed-off-by: Olivier Matz <olivier.matz@6wind.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/librte_kvargs/rte_kvargs.h2
-rw-r--r--lib/librte_pmd_pcap/rte_eth_pcap.c14
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/librte_kvargs/rte_kvargs.h b/lib/librte_kvargs/rte_kvargs.h
index d09dab8..98b8a7c 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;