diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2020-04-05 16:33:54 +0100 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2020-11-27 11:09:20 +0000 |
| commit | 253a873b5e4c142cd58a99274d9b58d200ebfd87 (patch) | |
| tree | fa08aad482c0b68c8e8e8b8b06ddb5796bd7787e /src | |
| parent | 03623b47939696c2d75ed3872aa19e8ea7ac1a86 (diff) | |
| download | libgit2-253a873b5e4c142cd58a99274d9b58d200ebfd87.tar.gz | |
hash: use GIT_ASSERT
Diffstat (limited to 'src')
| -rw-r--r-- | src/hash.c | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/hash.c b/src/hash.c index 405c46a9a..963c28137 100644 --- a/src/hash.c +++ b/src/hash.c @@ -31,7 +31,7 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx) git_hash_sha1_ctx_cleanup(&ctx->sha1); return; default: - assert(0); + /* unreachable */ ; } } @@ -41,8 +41,7 @@ int git_hash_init(git_hash_ctx *ctx) case GIT_HASH_ALGO_SHA1: return git_hash_sha1_init(&ctx->sha1); default: - assert(0); - return -1; + GIT_ASSERT(0); } } @@ -52,8 +51,7 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len) case GIT_HASH_ALGO_SHA1: return git_hash_sha1_update(&ctx->sha1, data, len); default: - assert(0); - return -1; + GIT_ASSERT(0); } } @@ -63,8 +61,7 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx) case GIT_HASH_ALGO_SHA1: return git_hash_sha1_final(out, &ctx->sha1); default: - assert(0); - return -1; + GIT_ASSERT(0); } } @@ -80,7 +77,7 @@ int git_hash_buf(git_oid *out, const void *data, size_t len) error = git_hash_final(out, &ctx); git_hash_ctx_cleanup(&ctx); - + return error; } |
