diff options
| author | Edward Thomson <ethomson@microsoft.com> | 2012-11-12 19:22:49 -0600 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2012-11-13 10:23:05 -0600 |
| commit | 603bee07918b50051d7bb45722932fc409b38a67 (patch) | |
| tree | 99951bc2c5470bc429d42eb9eb6151b2de6b08be /src/hash.c | |
| parent | d6fb09240913c9756de5f4a2462062008ebac252 (diff) | |
| download | libgit2-603bee07918b50051d7bb45722932fc409b38a67.tar.gz | |
Remove git_hash_ctx_new - callers now _ctx_init()
Diffstat (limited to 'src/hash.c')
| -rw-r--r-- | src/hash.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/hash.c b/src/hash.c index 336030d41..21db2e129 100644 --- a/src/hash.c +++ b/src/hash.c @@ -10,38 +10,38 @@ int git_hash_buf(git_oid *out, const void *data, size_t len) { - git_hash_ctx *ctx; + git_hash_ctx ctx; int error = 0; - if ((ctx = git_hash_ctx_new()) == NULL) + if (git_hash_ctx_init(&ctx) < 0) return -1; - if ((error = git_hash_update(ctx, data, len)) >= 0) - error = git_hash_final(out, ctx); + if ((error = git_hash_update(&ctx, data, len)) >= 0) + error = git_hash_final(out, &ctx); - git_hash_ctx_free(ctx); + git_hash_ctx_cleanup(&ctx); return error; } int git_hash_vec(git_oid *out, git_buf_vec *vec, size_t n) { - git_hash_ctx *ctx; + git_hash_ctx ctx; size_t i; int error = 0; - if ((ctx = git_hash_ctx_new()) == NULL) + if (git_hash_ctx_init(&ctx) < 0) return -1; for (i = 0; i < n; i++) { - if ((error = git_hash_update(ctx, vec[i].data, vec[i].len)) < 0) + if ((error = git_hash_update(&ctx, vec[i].data, vec[i].len)) < 0) goto done; } - error = git_hash_final(out, ctx); + error = git_hash_final(out, &ctx); done: - git_hash_ctx_free(ctx); + git_hash_ctx_cleanup(&ctx); return error; } |
