X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=score.c;h=ad147bba1ef7dc9ac90fbcb30e20a267e0376160;hp=86c6c4bb366af7e1e9f6d2ddec3d820b45f74a51;hb=7e58bd75a29d2d4e1d184191c2500b6aa7a7ad8a;hpb=191d16070b9511f5b32b1ede7a9d0db1ffb3da54 diff --git a/score.c b/score.c index 86c6c4bb..ad147bba 100644 --- a/score.c +++ b/score.c @@ -12,9 +12,7 @@ #include "list.h" #include "string.h" -int mood_compute_score(const void *row, long *score); - -static void *score_table; +static struct osl_table *score_table; static int ptr_compare(const struct osl_object *obj1, const struct osl_object *obj2) { @@ -198,7 +196,7 @@ int score_update(const struct osl_row *aft_row, long percent) obj.size = sizeof(long); obj.data = para_malloc(obj.size); *(long *)obj.data = new_score; - PARA_NOTICE_LOG("new score: %ld, position: %u/%u\n", new_score, + PARA_DEBUG_LOG("new score: %ld, position: %u/%u\n", new_score, new_pos, n); return osl_update_object(score_table, row, SCORECOL_SCORE, &obj); } @@ -342,6 +340,7 @@ int row_belongs_to_score_table(const struct osl_row *aft_row) void score_shutdown(enum osl_close_flags flags) { osl_close_table(score_table, flags | OSL_FREE_VOLATILE); + score_table = NULL; } /** @@ -359,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); }