From: Andre Noll Date: Wed, 26 Sep 2007 14:37:00 +0000 (+0200) Subject: Fix table init. X-Git-Tag: v0.3.0~344 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=f3c29f0f4c000f3d860c0da31d4387afc798a77a Fix table init. The previous patch introduced two instances of a bug which weren't noticed by the compiler because attribute_table and score_table were declared as void * pointers. Change that to struct osl_table *, and add the missing '&' operator. void * pointers a evil. --- diff --git a/attribute.c b/attribute.c index 798a6cc4..801d907a 100644 --- a/attribute.c +++ b/attribute.c @@ -10,7 +10,7 @@ #include "string.h" #include "net.h" -static void *attribute_table; +static struct osl_table *attribute_table; static int greatest_att_bitnum; /** The columns of the attribute table. */ @@ -466,7 +466,7 @@ 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, attribute_table); + ret = osl_open_table(ti->desc, &attribute_table); greatest_att_bitnum = -1; /* no atts available */ if (ret >= 0) { find_greatest_att_bitnum(); diff --git a/score.c b/score.c index 515a9c94..ad147bba 100644 --- a/score.c +++ b/score.c @@ -12,7 +12,7 @@ #include "list.h" #include "string.h" -static void *score_table; +static struct osl_table *score_table; static int ptr_compare(const struct osl_object *obj1, const struct osl_object *obj2) { @@ -358,5 +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; - return osl_open_table(ti->desc, score_table); + return osl_open_table(ti->desc, &score_table); }