summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-06-07 16:15:42 +0200
committerJim Meyering <meyering@redhat.com>2009-06-07 16:16:45 +0200
commit4add9e3626e8b61993200874a0e7a2fd701e085a (patch)
tree6b3458735b3837e5cf8cecfbf5fa338d09d2d75b
parentf6fbc99408212db2f69e321197a80c9e0fdef0fe (diff)
downloadidutils-4add9e3626e8b61993200874a0e7a2fd701e085a.tar.gz
idutils-4add9e3626e8b61993200874a0e7a2fd701e085a.tar.bz2
idutils-4add9e3626e8b61993200874a0e7a2fd701e085a.zip
maint: add const attribute to a few declarations
* libidu/hash.c (hash_print_stats, hash_dump): Add const. * libidu/hash.h: Likewise. * src/mkid.c (scan_files): Likewise.
-rw-r--r--libidu/hash.c6
-rw-r--r--libidu/hash.h6
-rw-r--r--src/mkid.c6
3 files changed, 9 insertions, 9 deletions
diff --git a/libidu/hash.c b/libidu/hash.c
index bc64ad5..50389f2 100644
--- a/libidu/hash.c
+++ b/libidu/hash.c
@@ -1,5 +1,5 @@
/* hash.c -- hash table maintenance
- Copyright (C) 1995, 1999, 2007-2008 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1999, 2007-2009 Free Software Foundation, Inc.
Written by Greg McGary <gkm@gnu.ai.mit.edu>
This program is free software; you can redistribute it and/or modify
@@ -259,7 +259,7 @@ hash_rehash (struct hash_table* ht)
}
void
-hash_print_stats (struct hash_table *ht, FILE *out_FILE)
+hash_print_stats (struct hash_table const *ht, FILE *out_FILE)
{
fprintf (out_FILE, _("Load=%ld/%ld=%.0f%%, "), ht->ht_fill, ht->ht_size,
100.0 * (double) ht->ht_fill / (double) ht->ht_size);
@@ -274,7 +274,7 @@ hash_print_stats (struct hash_table *ht, FILE *out_FILE)
user-supplied vector, or malloc one. */
void**
-hash_dump (struct hash_table *ht, void **vector_0, qsort_cmp_t compare)
+hash_dump (struct hash_table const *ht, void **vector_0, qsort_cmp_t compare)
{
void **vector;
void **slot;
diff --git a/libidu/hash.h b/libidu/hash.h
index 81810be..1391b66 100644
--- a/libidu/hash.h
+++ b/libidu/hash.h
@@ -1,5 +1,5 @@
/* hash.h -- decls for hash table
- Copyright (C) 1995, 1999, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1999, 2007-2009 Free Software Foundation, Inc.
Written by Greg McGary <gkm@gnu.ai.mit.edu>
This program is free software; you can redistribute it and/or modify
@@ -58,8 +58,8 @@ extern void hash_delete_items (struct hash_table *ht);
extern void hash_free_items (struct hash_table *ht);
extern void hash_free (struct hash_table *ht, int free_items);
extern void hash_map (struct hash_table *ht, hash_map_func_t map);
-extern void hash_print_stats (struct hash_table *ht, FILE *out_FILE);
-extern void **hash_dump (struct hash_table *ht, void **vector_0,
+extern void hash_print_stats (struct hash_table const *ht, FILE *out_FILE);
+extern void **hash_dump (struct hash_table const *ht, void **vector_0,
qsort_cmp_t compare);
extern void *hash_deleted_item;
diff --git a/src/mkid.c b/src/mkid.c
index 0090fdc..beb3168 100644
--- a/src/mkid.c
+++ b/src/mkid.c
@@ -63,7 +63,7 @@ static void help_me (void);
static int ceil_log_8 (unsigned long n);
static int ceil_log_2 (unsigned long n);
static void assert_writeable (char const *file_name);
-static void scan_files (struct idhead *idhp);
+static void scan_files (struct idhead const *idhp);
static void scan_member_file (struct member_file const *member);
static void scan_member_file_1 (get_token_func_t get_token,
void const *args, FILE *source_FILE);
@@ -398,7 +398,7 @@ assert_writeable (char const *filename)
Create a tree8 to store the set of files where a token occurs. */
static void
-scan_files (struct idhead *idhp)
+scan_files (struct idhead const *idhp)
{
struct member_file **members_0
= (struct member_file **) hash_dump (&idhp->idh_member_file_table,
@@ -432,7 +432,7 @@ scan_files (struct idhead *idhp)
for (;;)
{
- struct member_file *member = *members++;
+ const struct member_file *member = *members++;
scan_member_file (member);
if (members == end)
break;