From: Andre Noll Date: Wed, 26 Sep 2007 14:31:00 +0000 (+0200) Subject: Get rid of the "table" member in struct table_info. X-Git-Tag: v0.3.0~345 X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=0496a19e8ac1afecde726c2292720d415bdb7500;p=paraslash.git Get rid of the "table" member in struct table_info. afs.c has no busyness in dealing with the table, so do not expose it to afs.c. --- diff --git a/afs.h b/afs.h index 76464c71..e12891c6 100644 --- 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 ec05846f..4ff7ef19 100644 --- 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; diff --git a/attribute.c b/attribute.c index 2fccac61..798a6cc4 100644 --- a/attribute.c +++ b/attribute.c @@ -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 84dec32d..031f6ae3 100644 --- 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 d0799b55..515a9c94 100644 --- 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); }