hash: don't abbreviate algorithm
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
diff --git a/src/hash.c b/src/hash.c
index 5a7278e..d56c772 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -19,15 +19,15 @@ int git_hash_ctx_init(git_hash_ctx *ctx)
if ((error = git_hash_sha1_ctx_init(&ctx->ctx.sha1)) < 0)
return error;
- ctx->algo = GIT_HASH_ALGO_SHA1;
+ ctx->algorithm = GIT_HASH_ALGORITHM_SHA1;
return 0;
}
void git_hash_ctx_cleanup(git_hash_ctx *ctx)
{
- switch (ctx->algo) {
- case GIT_HASH_ALGO_SHA1:
+ switch (ctx->algorithm) {
+ case GIT_HASH_ALGORITHM_SHA1:
git_hash_sha1_ctx_cleanup(&ctx->ctx.sha1);
return;
default:
@@ -37,8 +37,8 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx)
int git_hash_init(git_hash_ctx *ctx)
{
- switch (ctx->algo) {
- case GIT_HASH_ALGO_SHA1:
+ switch (ctx->algorithm) {
+ case GIT_HASH_ALGORITHM_SHA1:
return git_hash_sha1_init(&ctx->ctx.sha1);
default:
/* unreachable */ ;
@@ -49,8 +49,8 @@ int git_hash_init(git_hash_ctx *ctx)
int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
{
- switch (ctx->algo) {
- case GIT_HASH_ALGO_SHA1:
+ switch (ctx->algorithm) {
+ case GIT_HASH_ALGORITHM_SHA1:
return git_hash_sha1_update(&ctx->ctx.sha1, data, len);
default:
/* unreachable */ ;
@@ -61,8 +61,8 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
int git_hash_final(git_oid *out, git_hash_ctx *ctx)
{
- switch (ctx->algo) {
- case GIT_HASH_ALGO_SHA1:
+ switch (ctx->algorithm) {
+ case GIT_HASH_ALGORITHM_SHA1:
return git_hash_sha1_final(out, &ctx->ctx.sha1);
default:
/* unreachable */ ;
diff --git a/src/hash.h b/src/hash.h
index 87305cc..31a31b3 100644
--- a/src/hash.h
+++ b/src/hash.h
@@ -18,9 +18,9 @@ typedef struct {
} git_buf_vec;
typedef enum {
- GIT_HASH_ALGO_UNKNOWN = 0,
- GIT_HASH_ALGO_SHA1,
-} git_hash_algo_t;
+ GIT_HASH_ALGORITHM_NONE = 0,
+ GIT_HASH_ALGORITHM_SHA1
+} git_hash_algorithm_t;
#include "hash/sha1.h"
@@ -28,7 +28,7 @@ typedef struct git_hash_ctx {
union {
git_hash_sha1_ctx sha1;
} ctx;
- git_hash_algo_t algo;
+ git_hash_algorithm_t algorithm;
} git_hash_ctx;
int git_hash_global_init(void);