Commit 253a873b by Edward Thomson

hash: use GIT_ASSERT

parent 03623b47
......@@ -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;
}
......
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