From 17c3451c18389990d74936e79ee19a4aa15e97d0 Mon Sep 17 00:00:00 2001 From: "/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org" Date: Tue, 15 Jan 2008 12:53:58 +0000 Subject: Max Kellermann : use const when possible --- src/buffer.c | 2 +- src/cache.c | 2 +- src/hash.c | 2 +- src/queue.c | 2 +- src/sync-ftfw.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/buffer.c b/src/buffer.c index 3283c15..4f60123 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -61,7 +61,7 @@ void buffer_flush(struct buffer *b, memset(b->data, 0, b->size); } -unsigned int buffer_size(struct buffer *b) +unsigned int buffer_size(const struct buffer *b) { return b->size; } diff --git a/src/cache.c b/src/cache.c index b92957a..a0950d5 100644 --- a/src/cache.c +++ b/src/cache.c @@ -398,7 +398,7 @@ void *cache_get_extra(struct cache *c, void *data) return data + c->extra_offset; } -void cache_stats(struct cache *c, int fd) +void cache_stats(const struct cache *c, int fd) { char buf[512]; int size; diff --git a/src/hash.c b/src/hash.c index 274a140..3ed6ad2 100644 --- a/src/hash.c +++ b/src/hash.c @@ -193,7 +193,7 @@ int hashtable_iterate(struct hashtable *table, void *data, return 0; } -unsigned int hashtable_counter(struct hashtable *table) +unsigned int hashtable_counter(const struct hashtable *table) { return table->count; } diff --git a/src/queue.c b/src/queue.c index 3413013..e73d692 100644 --- a/src/queue.c +++ b/src/queue.c @@ -122,7 +122,7 @@ void queue_iterate(struct queue *b, } } -unsigned int queue_len(struct queue *b) +unsigned int queue_len(const struct queue *b) { return b->num_elems; } diff --git a/src/sync-ftfw.c b/src/sync-ftfw.c index 8452e2e..0d57f36 100644 --- a/src/sync-ftfw.c +++ b/src/sync-ftfw.c @@ -161,7 +161,7 @@ static int ftfw_local(int fd, int type, void *data) static int rs_queue_to_tx(void *data1, void *data2) { struct nethdr *net = data1; - struct nethdr_ack *nack = data2; + const struct nethdr_ack *nack = data2; if (between(net->seq, nack->from, nack->to)) { dp("rs_queue_to_tx sq: %u fl:%u len:%u\n", @@ -174,7 +174,7 @@ static int rs_queue_to_tx(void *data1, void *data2) static int rs_queue_empty(void *data1, void *data2) { struct nethdr *net = data1; - struct nethdr_ack *h = data2; + const struct nethdr_ack *h = data2; if (between(net->seq, h->from, h->to)) { dp("remove from queue (seq=%u)\n", net->seq); -- cgit v1.2.3