Fix use of uninitialized afhi->header_len.
[paraslash.git] / score.c
diff --git a/score.c b/score.c
index 58d219a..0e18a1b 100644 (file)
--- a/score.c
+++ b/score.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2007 Andre Noll <maan@systemlinux.org>
+ * Copyright (C) 2007-2008 Andre Noll <maan@systemlinux.org>
  *
  * Licensed under the GPL v2. For licencing details see COPYING.
  */
@@ -132,7 +132,7 @@ int score_add(const struct osl_row *aft_row, long score)
 
        assert(aft_row);
        size = score_table_desc.column_descriptions[SCORECOL_AFT_ROW].data_size;
-       score_objs[SCORECOL_AFT_ROW].data = aft_row;
+       score_objs[SCORECOL_AFT_ROW].data = (struct osl_row *)aft_row;
        score_objs[SCORECOL_AFT_ROW].size = size;
 
        size = score_table_desc.column_descriptions[SCORECOL_SCORE].data_size;
@@ -143,7 +143,7 @@ int score_add(const struct osl_row *aft_row, long score)
 //     PARA_DEBUG_LOG("adding %p\n", *(void **) (score_objs[SCORECOL_AFT_ROW].data));
        ret = osl_add_row(score_table, score_objs);
        if (ret < 0) {
-               PARA_ERROR_LOG("%s\n", PARA_STRERROR(-ret));
+               PARA_ERROR_LOG("%s\n", para_strerror(-ret));
                free(score_objs[SCORECOL_SCORE].data);
        }
        return ret;
@@ -178,7 +178,8 @@ int score_update(const struct osl_row *aft_row, long percent)
        struct osl_row *row;
        long new_score;
        unsigned n, new_pos;
-       struct osl_object obj = {.data = aft_row, .size = sizeof(aft_row)};
+       struct osl_object obj = {.data = (struct osl_row *)aft_row,
+               .size = sizeof(aft_row)};
        int ret = osl_get_row(score_table, SCORECOL_AFT_ROW, &obj, &row);
 
        if (ret < 0)
@@ -226,7 +227,8 @@ int get_score_and_aft_row(struct osl_row *score_row, long *score,
 static int get_score_row_from_aft_row(const struct osl_row *aft_row,
                struct osl_row **score_row)
 {
-       struct osl_object obj = {.data = aft_row, .size = sizeof(aft_row)};
+       struct osl_object obj = {.data = (struct osl_row *)aft_row,
+               .size = sizeof(aft_row)};
        return osl_get_row(score_table, SCORECOL_AFT_ROW, &obj, score_row);
 
 }