aboutsummaryrefslogtreecommitdiff
path: root/lib/sqfs/meta_reader.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-27 18:15:40 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-09-27 18:15:40 +0200
commit40232f4bd4d7e8e001f7d1e8f120606f59b2c147 (patch)
tree5d763f4f22a487fd2e669efe0970615096f1f5fd /lib/sqfs/meta_reader.c
parentf6904a98bffe0bce5fc6aac408c141a25c0e05ab (diff)
Cleanup: replace fixed with data types with typedefs
This is a fully automated search and replace, i.e. I ran this: git grep -l uint8_t | xargs sed -i 's/uint8_t/sqfs_u8/g' git grep -l uint16_t | xargs sed -i 's/uint16_t/sqfs_u16/g' git grep -l uint32_t | xargs sed -i 's/uint32_t/sqfs_u32/g' git grep -l uint64_t | xargs sed -i 's/uint64_t/sqfs_u64/g' git grep -l int8_t | xargs sed -i 's/int8_t/sqfs_s8/g' git grep -l int16_t | xargs sed -i 's/int16_t/sqfs_s16/g' git grep -l int32_t | xargs sed -i 's/int32_t/sqfs_s32/g' git grep -l int64_t | xargs sed -i 's/int64_t/sqfs_s64/g' and than added the appropriate definitions to sqfs/predef.h The whole point being better compatibillity with platforms that may not have an stdint.h with the propper definitions. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/sqfs/meta_reader.c')
-rw-r--r--lib/sqfs/meta_reader.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/sqfs/meta_reader.c b/lib/sqfs/meta_reader.c
index 89d698b..d3c3565 100644
--- a/lib/sqfs/meta_reader.c
+++ b/lib/sqfs/meta_reader.c
@@ -19,15 +19,15 @@
#include <string.h>
struct sqfs_meta_reader_t {
- uint64_t start;
- uint64_t limit;
+ sqfs_u64 start;
+ sqfs_u64 limit;
size_t data_used;
/* The location of the current block in the image */
- uint64_t block_offset;
+ sqfs_u64 block_offset;
/* The location of the next block after the current one */
- uint64_t next_block;
+ sqfs_u64 next_block;
/* A byte offset into the uncompressed data of the current block */
size_t offset;
@@ -39,15 +39,15 @@ struct sqfs_meta_reader_t {
sqfs_compressor_t *cmp;
/* The raw data read from the input file */
- uint8_t data[SQFS_META_BLOCK_SIZE];
+ sqfs_u8 data[SQFS_META_BLOCK_SIZE];
/* The uncompressed data read from the input file */
- uint8_t scratch[SQFS_META_BLOCK_SIZE];
+ sqfs_u8 scratch[SQFS_META_BLOCK_SIZE];
};
sqfs_meta_reader_t *sqfs_meta_reader_create(sqfs_file_t *file,
sqfs_compressor_t *cmp,
- uint64_t start, uint64_t limit)
+ sqfs_u64 start, sqfs_u64 limit)
{
sqfs_meta_reader_t *m = calloc(1, sizeof(*m));
@@ -66,11 +66,11 @@ void sqfs_meta_reader_destroy(sqfs_meta_reader_t *m)
free(m);
}
-int sqfs_meta_reader_seek(sqfs_meta_reader_t *m, uint64_t block_start,
+int sqfs_meta_reader_seek(sqfs_meta_reader_t *m, sqfs_u64 block_start,
size_t offset)
{
bool compressed;
- uint16_t header;
+ sqfs_u16 header;
ssize_t ret;
size_t size;
int err;
@@ -127,7 +127,7 @@ int sqfs_meta_reader_seek(sqfs_meta_reader_t *m, uint64_t block_start,
}
void sqfs_meta_reader_get_position(const sqfs_meta_reader_t *m,
- uint64_t *block_start, size_t *offset)
+ sqfs_u64 *block_start, size_t *offset)
{
*block_start = m->block_offset;
*offset = m->offset;