aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-10 10:53:09 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-10 10:53:09 +0200
commit5367faefd2490e09abed41f655c3db55d36752ad (patch)
tree1f9ed54dde8d31d72442bd1f2459156fafb071cc /lib/sqfs
parentc17de5d4c2699c6c5b4759f009ce8cb6560d2f13 (diff)
Cleanup: mark arguments const where possible
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs')
-rw-r--r--lib/sqfs/dir_writer.c8
-rw-r--r--lib/sqfs/id_table.c2
-rw-r--r--lib/sqfs/io.c4
-rw-r--r--lib/sqfs/meta_reader.c4
-rw-r--r--lib/sqfs/read_inode.c3
-rw-r--r--lib/sqfs/super.c2
-rw-r--r--lib/sqfs/write_inode.c5
7 files changed, 15 insertions, 13 deletions
diff --git a/lib/sqfs/dir_writer.c b/lib/sqfs/dir_writer.c
index 70c035e..d7bb590 100644
--- a/lib/sqfs/dir_writer.c
+++ b/lib/sqfs/dir_writer.c
@@ -260,22 +260,22 @@ int sqfs_dir_writer_end(sqfs_dir_writer_t *writer)
return 0;
}
-size_t sqfs_dir_writer_get_size(sqfs_dir_writer_t *writer)
+size_t sqfs_dir_writer_get_size(const sqfs_dir_writer_t *writer)
{
return writer->dir_size;
}
-uint64_t sqfs_dir_writer_get_dir_reference(sqfs_dir_writer_t *writer)
+uint64_t sqfs_dir_writer_get_dir_reference(const sqfs_dir_writer_t *writer)
{
return writer->dir_ref;
}
-size_t sqfs_dir_writer_get_index_size(sqfs_dir_writer_t *writer)
+size_t sqfs_dir_writer_get_index_size(const sqfs_dir_writer_t *writer)
{
return writer->idx_size;
}
-int sqfs_dir_writer_write_index(sqfs_dir_writer_t *writer,
+int sqfs_dir_writer_write_index(const sqfs_dir_writer_t *writer,
sqfs_meta_writer_t *im)
{
sqfs_dir_index_t ent;
diff --git a/lib/sqfs/id_table.c b/lib/sqfs/id_table.c
index 55477dc..a365a5f 100644
--- a/lib/sqfs/id_table.c
+++ b/lib/sqfs/id_table.c
@@ -74,7 +74,7 @@ int sqfs_id_table_index_to_id(const sqfs_id_table_t *tbl, uint16_t index,
}
int sqfs_id_table_read(sqfs_id_table_t *tbl, sqfs_file_t *file,
- sqfs_super_t *super, sqfs_compressor_t *cmp)
+ const sqfs_super_t *super, sqfs_compressor_t *cmp)
{
uint64_t upper_limit, lower_limit;
void *raw_ids;
diff --git a/lib/sqfs/io.c b/lib/sqfs/io.c
index d0b2558..f8773d0 100644
--- a/lib/sqfs/io.c
+++ b/lib/sqfs/io.c
@@ -87,9 +87,9 @@ static int stdio_write_at(sqfs_file_t *base, uint64_t offset,
return 0;
}
-static uint64_t stdio_get_size(sqfs_file_t *base)
+static uint64_t stdio_get_size(const sqfs_file_t *base)
{
- sqfs_file_stdio_t *file = (sqfs_file_stdio_t *)base;
+ const sqfs_file_stdio_t *file = (const sqfs_file_stdio_t *)base;
return file->size;
}
diff --git a/lib/sqfs/meta_reader.c b/lib/sqfs/meta_reader.c
index 72d8db1..08ac28d 100644
--- a/lib/sqfs/meta_reader.c
+++ b/lib/sqfs/meta_reader.c
@@ -126,8 +126,8 @@ int sqfs_meta_reader_seek(sqfs_meta_reader_t *m, uint64_t block_start,
return 0;
}
-void sqfs_meta_reader_get_position(sqfs_meta_reader_t *m, uint64_t *block_start,
- size_t *offset)
+void sqfs_meta_reader_get_position(const sqfs_meta_reader_t *m,
+ uint64_t *block_start, size_t *offset)
{
*block_start = m->block_offset;
*offset = m->offset;
diff --git a/lib/sqfs/read_inode.c b/lib/sqfs/read_inode.c
index 3efb1d8..5a87a45 100644
--- a/lib/sqfs/read_inode.c
+++ b/lib/sqfs/read_inode.c
@@ -223,7 +223,8 @@ static int read_inode_slink_ext(sqfs_meta_reader_t *ir, sqfs_inode_t *base,
return 0;
}
-int sqfs_meta_reader_read_inode(sqfs_meta_reader_t *ir, sqfs_super_t *super,
+int sqfs_meta_reader_read_inode(sqfs_meta_reader_t *ir,
+ const sqfs_super_t *super,
uint64_t block_start, size_t offset,
sqfs_inode_generic_t **result)
{
diff --git a/lib/sqfs/super.c b/lib/sqfs/super.c
index 10d911b..ad42c9f 100644
--- a/lib/sqfs/super.c
+++ b/lib/sqfs/super.c
@@ -49,7 +49,7 @@ int sqfs_super_init(sqfs_super_t *super, size_t block_size, uint32_t mtime,
return 0;
}
-int sqfs_super_write(sqfs_super_t *super, sqfs_file_t *file)
+int sqfs_super_write(const sqfs_super_t *super, sqfs_file_t *file)
{
sqfs_super_t copy;
diff --git a/lib/sqfs/write_inode.c b/lib/sqfs/write_inode.c
index 6e36544..e64e6a6 100644
--- a/lib/sqfs/write_inode.c
+++ b/lib/sqfs/write_inode.c
@@ -11,7 +11,8 @@
#include "sqfs/error.h"
#include "sqfs/inode.h"
-static int write_block_sizes(sqfs_meta_writer_t *ir, sqfs_inode_generic_t *n)
+static int write_block_sizes(sqfs_meta_writer_t *ir,
+ const sqfs_inode_generic_t *n)
{
uint32_t sizes[n->num_file_blocks];
size_t i;
@@ -24,7 +25,7 @@ static int write_block_sizes(sqfs_meta_writer_t *ir, sqfs_inode_generic_t *n)
}
int sqfs_meta_writer_write_inode(sqfs_meta_writer_t *ir,
- sqfs_inode_generic_t *n)
+ const sqfs_inode_generic_t *n)
{
sqfs_inode_t base;
int ret;