diff options
Diffstat (limited to 't/helper/test-hash-speed.c')
| -rw-r--r-- | t/helper/test-hash-speed.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/t/helper/test-hash-speed.c b/t/helper/test-hash-speed.c index 7de822af51..fbf67fe6bd 100644 --- a/t/helper/test-hash-speed.c +++ b/t/helper/test-hash-speed.c @@ -3,25 +3,24 @@ #define NUM_SECONDS 3 -static inline void compute_hash(const struct git_hash_algo *algo, git_hash_ctx *ctx, uint8_t *final, const void *p, size_t len) +static inline void compute_hash(const struct git_hash_algo *algo, struct git_hash_ctx *ctx, uint8_t *final, const void *p, size_t len) { algo->init_fn(ctx); - algo->update_fn(ctx, p, len); - algo->final_fn(final, ctx); + git_hash_update(ctx, p, len); + git_hash_final(final, ctx); } int cmd__hash_speed(int ac, const char **av) { - git_hash_ctx ctx; + struct git_hash_ctx ctx; unsigned char hash[GIT_MAX_RAWSZ]; clock_t initial, start, end; unsigned bufsizes[] = { 64, 256, 1024, 8192, 16384 }; - int i; void *p; const struct git_hash_algo *algo = NULL; if (ac == 2) { - for (i = 1; i < GIT_HASH_NALGOS; i++) { + for (size_t i = 1; i < GIT_HASH_NALGOS; i++) { if (!strcmp(av[1], hash_algos[i].name)) { algo = &hash_algos[i]; break; @@ -36,7 +35,7 @@ int cmd__hash_speed(int ac, const char **av) printf("algo: %s\n", algo->name); - for (i = 0; i < ARRAY_SIZE(bufsizes); i++) { + for (size_t i = 0; i < ARRAY_SIZE(bufsizes); i++) { unsigned long j, kb; double kb_per_sec; p = xcalloc(1, bufsizes[i]); |
