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 76464c71197f47a5716845a7087cb9e765c2a3d3..e12891c6c776c2f6fd7be5da52c84d6c6c367b1e 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 ec05846f870255a939a760fc15352a217b035010..4ff7ef198cf3f18de42836396b56bf221ff3cbc9 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 2fccac61ef6a1e7f28f9c3f139c6fb788507abd9..798a6cc4889fe02c7789fe10b282891fa76bee1f 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 84dec32ddffbb6bc5777caa79b8599fde4fa5350..031f6ae3a76c2e29cd429135f3b73e60c8bc38d8 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 d0799b55650117e00c36401bfd2fb789a3261f85..515a9c9464a143756e0759835aefe36dcadbcab7 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);
 }