Clean 'shadowed declaration' warnings
index is a function in string.h, so replace index with idx all over the
source code.
diff --git a/libkmod/libkmod-index.c b/libkmod/libkmod-index.c
index 3d697d6..3fb736d 100644
--- a/libkmod/libkmod-index.c
+++ b/libkmod/libkmod-index.c
@@ -528,10 +528,10 @@
return new;
}
-void index_file_close(struct index_file *index)
+void index_file_close(struct index_file *idx)
{
- fclose(index->file);
- free(index);
+ fclose(idx->file);
+ free(idx);
}
diff --git a/libkmod/libkmod.c b/libkmod/libkmod.c
index df75e70..ce7ef3c 100644
--- a/libkmod/libkmod.c
+++ b/libkmod/libkmod.c
@@ -275,7 +275,7 @@
{
char *fn;
int err, nmatch = 0, i;
- struct index_file *index;
+ struct index_file *idx;
struct index_value *realnames, *realname;
struct kmod_list *l;
@@ -284,13 +284,13 @@
DBG(ctx, "file=%s name=%s\n", fn, name);
- index = index_file_open(fn);
- if (index == NULL) {
+ idx = index_file_open(fn);
+ if (idx == NULL) {
free(fn);
return -ENOSYS;
}
- realnames = index_searchwild(index, name);
+ realnames = index_searchwild(idx, name);
for (realname = realnames; realname; realname = realnames->next) {
struct kmod_module *mod;
@@ -305,7 +305,7 @@
}
index_values_free(realnames);
- index_file_close(index);
+ index_file_close(idx);
free(fn);
return nmatch;
@@ -342,7 +342,7 @@
struct kmod_list **list)
{
char *fn, *line, *p;
- struct index_file *index;
+ struct index_file *idx;
int n = 0;
/*
@@ -357,13 +357,13 @@
DBG(ctx, "file=%s modname=%s\n", fn, name);
- index = index_file_open(fn);
- if (index == NULL) {
+ idx = index_file_open(fn);
+ if (idx == NULL) {
free(fn);
return -ENOSYS;
}
- line = index_search(index, name);
+ line = index_search(idx, name);
if (line != NULL) {
struct kmod_module *mod;
@@ -379,7 +379,7 @@
finish:
free(line);
- index_file_close(index);
+ index_file_close(idx);
free(fn);
return n;