]> git.tuebingen.mpg.de Git - osl.git/commitdiff
Simplify check_index_ranges().
authorAndre Noll <maan@systemlinux.org>
Sun, 12 Jul 2009 21:40:23 +0000 (23:40 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 12 Jul 2009 21:40:23 +0000 (23:40 +0200)
Use FOR_EACH_MAPPED_COLUMN rather than open-code it.

fsck.c

diff --git a/fsck.c b/fsck.c
index c5fdf3545cc1e4d9d3159787984ba7ee6b7d5a42..68f08d99249344c6a92ad29f4bc6048886ea4c92 100644 (file)
--- a/fsck.c
+++ b/fsck.c
@@ -399,15 +399,13 @@ static int check_index_ranges(struct osl_table *t)
        //DEBUG_LOG("%d rows. %d columns\n", t->num_rows, t->desc->num_columns);
        t->num_invalid_rows = 0;
        for (i = 0; i < t->num_rows; i++) {
        //DEBUG_LOG("%d rows. %d columns\n", t->num_rows, t->desc->num_columns);
        t->num_invalid_rows = 0;
        for (i = 0; i < t->num_rows; i++) {
+               const struct osl_column_description *cd;
+
                if (row_is_invalid(t, i)) {
                        t->num_invalid_rows++;
                        continue;
                }
                if (row_is_invalid(t, i)) {
                        t->num_invalid_rows++;
                        continue;
                }
-               for (j = 0; j < t->desc->num_columns; j++) { /* FXIME */
-                       const struct osl_column_description *cd =
-                               get_column_description(t->desc, j);
-                       if (cd->storage_type != OSL_MAPPED_STORAGE)
-                               continue;
+               FOR_EACH_MAPPED_COLUMN(j, t, cd) {
                        ret = check_range(t, i, j);
                        if (ret < 0) {
                                if (ret != -E_FSCK_RANGE_VIOLATION)
                        ret = check_range(t, i, j);
                        if (ret < 0) {
                                if (ret != -E_FSCK_RANGE_VIOLATION)