summaryrefslogtreecommitdiff
path: root/lib/sqfs/xattr_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/xattr_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/xattr_reader.c')
-rw-r--r--lib/sqfs/xattr_reader.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sqfs/xattr_reader.c b/lib/sqfs/xattr_reader.c
index 4164f66..fb9c36a 100644
--- a/lib/sqfs/xattr_reader.c
+++ b/lib/sqfs/xattr_reader.c
@@ -20,12 +20,12 @@
#include <errno.h>
struct sqfs_xattr_reader_t {
- uint64_t xattr_start;
+ sqfs_u64 xattr_start;
size_t num_id_blocks;
size_t num_ids;
- uint64_t *id_block_starts;
+ sqfs_u64 *id_block_starts;
sqfs_meta_reader_t *idrd;
sqfs_meta_reader_t *kvrd;
@@ -61,7 +61,7 @@ int sqfs_xattr_reader_load_locations(sqfs_xattr_reader_t *xr)
if ((xr->num_ids * sizeof(sqfs_xattr_id_t)) % SQFS_META_BLOCK_SIZE)
xr->num_id_blocks += 1;
- xr->id_block_starts = alloc_array(sizeof(uint64_t), xr->num_id_blocks);
+ xr->id_block_starts = alloc_array(sizeof(sqfs_u64), xr->num_id_blocks);
if (xr->id_block_starts == NULL) {
if (errno == EOVERFLOW)
return SQFS_ERROR_OVERFLOW;
@@ -71,7 +71,7 @@ int sqfs_xattr_reader_load_locations(sqfs_xattr_reader_t *xr)
err = xr->file->read_at(xr->file,
xr->super->xattr_id_table_start + sizeof(idtbl),
xr->id_block_starts,
- sizeof(uint64_t) * xr->num_id_blocks);
+ sizeof(sqfs_u64) * xr->num_id_blocks);
if (err)
goto fail;
@@ -140,7 +140,7 @@ int sqfs_xattr_reader_read_value(sqfs_xattr_reader_t *xr,
{
size_t offset, new_offset, size;
sqfs_xattr_value_t value, *out;
- uint64_t ref, start, new_start;
+ sqfs_u64 ref, start, new_start;
int ret;
ret = sqfs_meta_reader_read(xr->kvrd, &value, sizeof(value));
@@ -200,13 +200,13 @@ fail:
int sqfs_xattr_reader_seek_kv(sqfs_xattr_reader_t *xr,
const sqfs_xattr_id_t *desc)
{
- uint32_t offset = desc->xattr & 0xFFFF;
- uint64_t block = xr->xattr_start + (desc->xattr >> 16);
+ sqfs_u32 offset = desc->xattr & 0xFFFF;
+ sqfs_u64 block = xr->xattr_start + (desc->xattr >> 16);
return sqfs_meta_reader_seek(xr->kvrd, block, offset);
}
-int sqfs_xattr_reader_get_desc(sqfs_xattr_reader_t *xr, uint32_t idx,
+int sqfs_xattr_reader_get_desc(sqfs_xattr_reader_t *xr, sqfs_u32 idx,
sqfs_xattr_id_t *desc)
{
size_t block, offset;