summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libstore/device.c4
-rw-r--r--libstore/file.c2
-rw-r--r--libstore/make.c5
-rw-r--r--libstore/rdwr.c2
-rw-r--r--libstore/set.c4
5 files changed, 9 insertions, 8 deletions
diff --git a/libstore/device.c b/libstore/device.c
index 82a85745..2655fbd4 100644
--- a/libstore/device.c
+++ b/libstore/device.c
@@ -64,7 +64,7 @@ store_device_create (device_t device, struct store **store)
{
off_t runs[2];
size_t sizes[DEV_GET_SIZE_COUNT], block_size;
- unsigned sizes_len = DEV_GET_SIZE_COUNT;
+ size_t sizes_len = DEV_GET_SIZE_COUNT;
error_t err = device_get_status (device, DEV_GET_SIZE, sizes, &sizes_len);
if (err)
@@ -82,7 +82,7 @@ store_device_create (device_t device, struct store **store)
/* Like store_device_create, but doesn't query the device for information. */
error_t
_store_device_create (device_t device, size_t block_size,
- off_t *runs, unsigned runs_len,
+ const off_t *runs, size_t runs_len,
struct store **store)
{
*store = _make_store (STORAGE_DEVICE, &device_meths, device, block_size,
diff --git a/libstore/file.c b/libstore/file.c
index d64f8a6a..8760f05c 100644
--- a/libstore/file.c
+++ b/libstore/file.c
@@ -125,7 +125,7 @@ store_file_create (file_t file, struct store **store)
/* Like store_file_create, but doesn't query the file for information. */
error_t
_store_file_create (file_t file, size_t block_size,
- off_t *runs, unsigned runs_len,
+ const off_t *runs, size_t runs_len,
struct store **store)
{
if (block_size == 1)
diff --git a/libstore/make.c b/libstore/make.c
index e5073607..340d583c 100644
--- a/libstore/make.c
+++ b/libstore/make.c
@@ -29,7 +29,7 @@
struct store *
_make_store (enum file_storage_class class, struct store_meths *meths,
mach_port_t port, size_t block_size,
- off_t *runs, size_t runs_len, off_t end)
+ const off_t *runs, size_t runs_len, off_t end)
{
if (block_size & (block_size - 1))
return 0; /* block size not a power of two. */
@@ -42,7 +42,8 @@ _make_store (enum file_storage_class class, struct store_meths *meths,
store->port = port;
store->runs = 0;
store->runs_len = 0;
- store->wrap = 0;
+ store->wrap_src = 0;
+ store->wrap_dst = 0;
store->end = end;
store->block_size = block_size;
store->source = MACH_PORT_NULL;
diff --git a/libstore/rdwr.c b/libstore/rdwr.c
index 674367bb..b6622a70 100644
--- a/libstore/rdwr.c
+++ b/libstore/rdwr.c
@@ -40,7 +40,7 @@ store_find_first_run (struct store *store, off_t addr,
/* Locate the correct position within a repeating pattern of runs. */
{
*base = addr / store->wrap_dst;
- addr %= wrap;
+ addr %= wrap_src;
}
else
*base = 0;
diff --git a/libstore/set.c b/libstore/set.c
index 28ede72f..60701f64 100644
--- a/libstore/set.c
+++ b/libstore/set.c
@@ -27,7 +27,7 @@
/* Set STORE's current runs list to (a copy of) RUNS and RUNS_LEN. */
error_t
-store_set_runs (struct store *store, off_t *runs, unsigned runs_len)
+store_set_runs (struct store *store, const off_t *runs, unsigned runs_len)
{
unsigned size = runs_len * sizeof (off_t);
off_t *copy = malloc (size);
@@ -50,7 +50,7 @@ store_set_runs (struct store *store, off_t *runs, unsigned runs_len)
/* Sets the name associated with STORE to a copy of NAME. */
error_t
-store_set_name (struct store *store, char *name)
+store_set_name (struct store *store, const char *name)
{
char *copy = malloc (strlen (name) + 1);