diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-27 18:15:40 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-27 18:15:40 +0200 |
commit | 40232f4bd4d7e8e001f7d1e8f120606f59b2c147 (patch) | |
tree | 5d763f4f22a487fd2e669efe0970615096f1f5fd /lib/sqfs/dir_reader.c | |
parent | f6904a98bffe0bce5fc6aac408c141a25c0e05ab (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/dir_reader.c')
-rw-r--r-- | lib/sqfs/dir_reader.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sqfs/dir_reader.c b/lib/sqfs/dir_reader.c index aa9e1a4..a353069 100644 --- a/lib/sqfs/dir_reader.c +++ b/lib/sqfs/dir_reader.c @@ -25,13 +25,13 @@ struct sqfs_dir_reader_t { const sqfs_super_t *super; sqfs_dir_header_t hdr; - uint64_t dir_block_start; + sqfs_u64 dir_block_start; size_t entries; size_t size; size_t start_size; - uint16_t dir_offset; - uint16_t inode_offset; + sqfs_u16 dir_offset; + sqfs_u16 inode_offset; }; sqfs_dir_reader_t *sqfs_dir_reader_create(const sqfs_super_t *super, @@ -39,7 +39,7 @@ sqfs_dir_reader_t *sqfs_dir_reader_create(const sqfs_super_t *super, sqfs_file_t *file) { sqfs_dir_reader_t *rd = calloc(1, sizeof(*rd)); - uint64_t start, limit; + sqfs_u64 start, limit; if (rd == NULL) return NULL; @@ -85,7 +85,7 @@ void sqfs_dir_reader_destroy(sqfs_dir_reader_t *rd) int sqfs_dir_reader_open_dir(sqfs_dir_reader_t *rd, const sqfs_inode_generic_t *inode) { - uint64_t block_start; + sqfs_u64 block_start; size_t size, offset; if (inode->base.type == SQFS_INODE_DIR) { @@ -191,7 +191,7 @@ int sqfs_dir_reader_find(sqfs_dir_reader_t *rd, const char *name) int sqfs_dir_reader_get_inode(sqfs_dir_reader_t *rd, sqfs_inode_generic_t **inode) { - uint64_t block_start; + sqfs_u64 block_start; block_start = rd->hdr.start_block; @@ -203,8 +203,8 @@ int sqfs_dir_reader_get_inode(sqfs_dir_reader_t *rd, int sqfs_dir_reader_get_root_inode(sqfs_dir_reader_t *rd, sqfs_inode_generic_t **inode) { - uint64_t block_start = rd->super->root_inode_ref >> 16; - uint16_t offset = rd->super->root_inode_ref & 0xFFFF; + sqfs_u64 block_start = rd->super->root_inode_ref >> 16; + sqfs_u16 offset = rd->super->root_inode_ref & 0xFFFF; return sqfs_meta_reader_read_inode(rd->meta_inode, rd->super, block_start, offset, inode); |