Commit 253a873b by Edward Thomson

hash: use GIT_ASSERT

parent 03623b47
...@@ -31,7 +31,7 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx) ...@@ -31,7 +31,7 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx)
git_hash_sha1_ctx_cleanup(&ctx->sha1); git_hash_sha1_ctx_cleanup(&ctx->sha1);
return; return;
default: default:
assert(0); /* unreachable */ ;
} }
} }
...@@ -41,8 +41,7 @@ int git_hash_init(git_hash_ctx *ctx) ...@@ -41,8 +41,7 @@ int git_hash_init(git_hash_ctx *ctx)
case GIT_HASH_ALGO_SHA1: case GIT_HASH_ALGO_SHA1:
return git_hash_sha1_init(&ctx->sha1); return git_hash_sha1_init(&ctx->sha1);
default: default:
assert(0); GIT_ASSERT(0);
return -1;
} }
} }
...@@ -52,8 +51,7 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len) ...@@ -52,8 +51,7 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
case GIT_HASH_ALGO_SHA1: case GIT_HASH_ALGO_SHA1:
return git_hash_sha1_update(&ctx->sha1, data, len); return git_hash_sha1_update(&ctx->sha1, data, len);
default: default:
assert(0); GIT_ASSERT(0);
return -1;
} }
} }
...@@ -63,8 +61,7 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx) ...@@ -63,8 +61,7 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx)
case GIT_HASH_ALGO_SHA1: case GIT_HASH_ALGO_SHA1:
return git_hash_sha1_final(out, &ctx->sha1); return git_hash_sha1_final(out, &ctx->sha1);
default: default:
assert(0); GIT_ASSERT(0);
return -1;
} }
} }
...@@ -80,7 +77,7 @@ int git_hash_buf(git_oid *out, const void *data, size_t len) ...@@ -80,7 +77,7 @@ int git_hash_buf(git_oid *out, const void *data, size_t len)
error = git_hash_final(out, &ctx); error = git_hash_final(out, &ctx);
git_hash_ctx_cleanup(&ctx); git_hash_ctx_cleanup(&ctx);
return error; return error;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment