summaryrefslogtreecommitdiff
path: root/libstore
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-05-10 21:19:13 +0000
committerMiles Bader <miles@gnu.org>1996-05-10 21:19:13 +0000
commit8bbe3bcc862ce11c70287e1197446f9de78c478a (patch)
tree068b2d38551d237b0b8f97929a387636a05efa16 /libstore
parent4e015aefeea3e11e6a0afd32cdbe0fb82dbcdba0 (diff)
(_store_derive): Use store_run, not off_t, vectors; tweak accordingly.
Diffstat (limited to 'libstore')
-rw-r--r--libstore/derive.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libstore/derive.c b/libstore/derive.c
index 5a7e0173..63cf3430 100644
--- a/libstore/derive.c
+++ b/libstore/derive.c
@@ -28,18 +28,18 @@ void
_store_derive (struct store *store)
{
unsigned i;
- off_t *runs = store->runs;
+ struct store_run *runs = store->runs;
unsigned num_runs = store->num_runs;
size_t bsize = store->block_size;
/* BLOCK & SIZE */
store->blocks = 0;
- for (i = 0; i < num_runs; i += 2)
+ for (i = 0; i < num_runs; i++)
{
- store->wrap_src += runs[i + 1];
- if (runs[i] >= 0)
- store->blocks += runs[i + 1];
+ store->wrap_src += runs[i].length;
+ if (runs[i].start >= 0) /* Not a hole */
+ store->blocks += runs[i].length;
}
if (store->end == 0)
@@ -54,14 +54,14 @@ _store_derive (struct store *store)
store->blocks *= num_iters;
- for (i = 0; i < num_runs; i += 2)
- if (last_part_base + runs[i + 1] < store->end)
+ for (i = 0; i < num_runs; i++)
+ if (last_part_base + runs[i].length < store->end)
{
- store->blocks += store->end - (last_part_base + runs[i + 1]);
+ store->blocks += store->end - (last_part_base + runs[i].length);
break;
}
- else if (runs[i] >= 0)
- store->blocks += runs[i + 1];
+ else if (runs[i].start >= 0)
+ store->blocks += runs[i].length;
/* WRAP_DST must be set by the caller. */
}