Get rid of the "table" member in struct table_info.
authorAndre Noll <maan@systemlinux.org>
Wed, 26 Sep 2007 14:31:00 +0000 (16:31 +0200)
committerAndre Noll <maan@systemlinux.org>
Wed, 26 Sep 2007 14:31:00 +0000 (16:31 +0200)
afs.c has no busyness in dealing with the table, so do not
expose it to afs.c.

afs.h
aft.c
attribute.c
blob.c
score.c

diff --git a/afs.h b/afs.h
index 76464c7..e12891c 100644 (file)
--- a/afs.h
+++ b/afs.h
@@ -28,7 +28,6 @@ enum afs_table_flags {TBLFLAG_SKIP_CREATE};
 
 struct table_info {
        const struct osl_table_description *desc;
-       struct osl_table *table;
        enum afs_table_flags flags;
 };
 
diff --git a/aft.c b/aft.c
index ec05846..4ff7ef1 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -1826,10 +1826,9 @@ int aft_init(struct table_info *ti, const char *db)
 
        audio_file_table_desc.dir = db;
        ti->desc = &audio_file_table_desc;
-       ret = osl_open_table(ti->desc, &ti->table);
+       ret = osl_open_table(ti->desc, &audio_file_table);
        if (ret >= 0) {
                unsigned num;
-               audio_file_table = ti->table;
                osl_get_num_rows(audio_file_table, &num);
                PARA_INFO_LOG("audio file table contains %d files\n", num);
                return ret;
index 2fccac6..798a6cc 100644 (file)
@@ -466,10 +466,9 @@ int attribute_init(struct table_info *ti, const char *db)
 
        attribute_table_desc.dir = db;
        ti->desc = &attribute_table_desc;
-       ret = osl_open_table(ti->desc, &ti->table);
+       ret = osl_open_table(ti->desc, attribute_table);
        greatest_att_bitnum = -1; /* no atts available */
        if (ret >= 0) {
-               attribute_table = ti->table;
                find_greatest_att_bitnum();
                return ret;
        }
diff --git a/blob.c b/blob.c
index 84dec32..031f6ae 100644 (file)
--- a/blob.c
+++ b/blob.c
@@ -486,11 +486,9 @@ static int blob_init(struct osl_table **table,
        int ret;
        desc->dir = db;
        ti->desc = desc;
-       ret = osl_open_table(ti->desc, &ti->table);
-       if (ret >= 0) {
-               *table = ti->table;
+       ret = osl_open_table(ti->desc, table);
+       if (ret >= 0)
                return ret;
-       }
        *table = NULL;
        return ret == -E_NOENT? 1 : ret;
 }
diff --git a/score.c b/score.c
index d0799b5..515a9c9 100644 (file)
--- a/score.c
+++ b/score.c
@@ -358,8 +358,5 @@ int score_init(struct table_info *ti, const char *db)
        score_table_desc.dir = db;
        ti->desc = &score_table_desc;
        ti->flags = TBLFLAG_SKIP_CREATE;
-       int ret = osl_open_table(ti->desc, &ti->table);
-
-       score_table = ti->table;
-       return ret;
+       return osl_open_table(ti->desc, score_table);
 }