Skip to content

Commit 079a40c

Browse files
authored
Merge pull request libgit2#5715 from lhchavez/fix-non-debug-build
Fix the `ENABLE_WERROR=ON` build in Groovy Gorilla (gcc 10.2)
2 parents 4fadd59 + 5db304f commit 079a40c

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/hash.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,10 @@ int git_hash_init(git_hash_ctx *ctx)
4141
case GIT_HASH_ALGO_SHA1:
4242
return git_hash_sha1_init(&ctx->sha1);
4343
default:
44-
GIT_ASSERT(0);
44+
/* unreachable */ ;
4545
}
46+
GIT_ASSERT(0);
47+
return -1;
4648
}
4749

4850
int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
@@ -51,8 +53,10 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
5153
case GIT_HASH_ALGO_SHA1:
5254
return git_hash_sha1_update(&ctx->sha1, data, len);
5355
default:
54-
GIT_ASSERT(0);
56+
/* unreachable */ ;
5557
}
58+
GIT_ASSERT(0);
59+
return -1;
5660
}
5761

5862
int git_hash_final(git_oid *out, git_hash_ctx *ctx)
@@ -61,8 +65,10 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx)
6165
case GIT_HASH_ALGO_SHA1:
6266
return git_hash_sha1_final(out, &ctx->sha1);
6367
default:
64-
GIT_ASSERT(0);
68+
/* unreachable */ ;
6569
}
70+
GIT_ASSERT(0);
71+
return -1;
6672
}
6773

6874
int git_hash_buf(git_oid *out, const void *data, size_t len)

0 commit comments

Comments
 (0)