dedup

data deduplication program
git clone git://git.2f30.org/dedup.git
Log | Files | Refs | README | LICENSE

commit 14309b993f5034742f3977b3091b036c6fdb2606
parent fdf523492dd9b8ed238e07722b8f481f02ee46fd
Author: sin <sin@2f30.org>
Date:   Thu, 29 Mar 2018 15:30:54 +0100

Use uint8_t instead of unsigned char

Diffstat:
dedup.c | 22+++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/dedup.c b/dedup.c @@ -24,20 +24,20 @@ struct enthdr { struct ent { uint64_t sz; /* size of entire entry structure */ - unsigned char reserved[7]; - unsigned char md[32]; + uint8_t reserved[7]; + uint8_t md[32]; uint64_t nblks; uint64_t blks[]; } __attribute__((packed)); struct blk { - unsigned char md[32]; + uint8_t md[32]; uint64_t sz; - unsigned char data[BLKSIZ]; + uint8_t data[BLKSIZ]; } __attribute__((packed)); struct cache_data { - unsigned char md[32]; + uint8_t md[32]; uint64_t blkidx; } __attribute__((packed)); @@ -56,7 +56,7 @@ int verbose; char *argv0; void -dump_md(const unsigned char *md, size_t len) +dump_md(const uint8_t *md, size_t len) { size_t i; @@ -113,7 +113,7 @@ str2bin(char *s, uint8_t *d) ssize_t xread(int fd, void *buf, size_t nbytes) { - unsigned char *bp = buf; + uint8_t *bp = buf; ssize_t total = 0; while (nbytes > 0) { @@ -133,7 +133,7 @@ xread(int fd, void *buf, size_t nbytes) ssize_t xwrite(int fd, const void *buf, size_t nbytes) { - const unsigned char *bp = buf; + const uint8_t *bp = buf; ssize_t total = 0; while (nbytes > 0) { @@ -166,7 +166,7 @@ RB_PROTOTYPE(cache, cache_ent, e, cache_ent_cmp); RB_GENERATE(cache, cache_ent, e, cache_ent_cmp); struct cache_ent * -alloc_cache_ent(unsigned char *md, uint64_t blkidx) +alloc_cache_ent(uint8_t *md, uint64_t blkidx) { struct cache_ent *ent; @@ -310,7 +310,7 @@ lookup_blk(struct blk *blk, uint64_t *blkidx) void extract(char *id, int fd) { - unsigned char md[32]; + uint8_t md[32]; uint64_t nblks, i; str2bin(id, md); @@ -411,7 +411,7 @@ check(void) nblks = storefile_nblks(); lseek(ifd, sizeof(enthdr), SEEK_SET); for (i = 0; i < enthdr.nents; i++) { - unsigned char md[32]; + uint8_t md[32]; sha256_context ctx; struct ent *ent;