dedup

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

commit d28e04853298face6e9a03a8c2b76bffcb394b32
parent f07513053f8662fac3f909bb6e2cdf895b567cb3
Author: sin <sin@2f30.org>
Date:   Sun,  7 Apr 2019 13:26:44 +0100

Consistent naming between compressor/hash types

Diffstat:
Mdedup.h | 6+++---
Mhash.c | 8++++----
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/dedup.h b/dedup.h @@ -34,9 +34,9 @@ enum compr_algo { }; enum hash_algo { - BLAKE2B_ALGO, - BLAKE2BP_ALGO, - NR_HASH_ALGOS, + HASH_BLAKE2B, + HASH_BLAKE2BP, + NR_HASHES, }; struct chunker; diff --git a/hash.c b/hash.c @@ -17,7 +17,7 @@ static struct hash_ops { int (*init)(struct hash_ctx *ctx, size_t n); int (*update)(struct hash_ctx *ctx, const void *buf, size_t n); int (*final)(struct hash_ctx *ctx, void *buf, size_t n); -} hashes[NR_HASH_ALGOS] = { +} hashes[NR_HASHES] = { { .init = blake2bi, .update = blake2bu, @@ -36,11 +36,11 @@ static struct algomap { } algomap[] = { { .name = "blake2b", - .type = BLAKE2B_ALGO, + .type = HASH_BLAKE2B, }, { .name = "blake2bp", - .type = BLAKE2BP_ALGO, + .type = HASH_BLAKE2BP, }, { .name = NULL, @@ -86,7 +86,7 @@ blake2bpf(struct hash_ctx *ctx, void *buf, size_t n) int hash_init(struct hash_ctx *ctx, int type, size_t n) { - if (type < 0 || type >= NR_HASH_ALGOS) + if (type < 0 || type >= NR_HASHES) return -1; ctx->ops = &hashes[type];