Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
40f3702c
Commit
40f3702c
authored
Aug 25, 2021
by
Peter Pettersson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
c90/c99: name the unnamed union in git_hash_ctx
parent
51d69dda
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
src/hash.c
+5
-5
src/hash.h
+1
-1
No files found.
src/hash.c
View file @
40f3702c
...
@@ -16,7 +16,7 @@ int git_hash_ctx_init(git_hash_ctx *ctx)
...
@@ -16,7 +16,7 @@ int git_hash_ctx_init(git_hash_ctx *ctx)
{
{
int
error
;
int
error
;
if
((
error
=
git_hash_sha1_ctx_init
(
&
ctx
->
sha1
))
<
0
)
if
((
error
=
git_hash_sha1_ctx_init
(
&
ctx
->
ctx
.
sha1
))
<
0
)
return
error
;
return
error
;
ctx
->
algo
=
GIT_HASH_ALGO_SHA1
;
ctx
->
algo
=
GIT_HASH_ALGO_SHA1
;
...
@@ -28,7 +28,7 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx)
...
@@ -28,7 +28,7 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx)
{
{
switch
(
ctx
->
algo
)
{
switch
(
ctx
->
algo
)
{
case
GIT_HASH_ALGO_SHA1
:
case
GIT_HASH_ALGO_SHA1
:
git_hash_sha1_ctx_cleanup
(
&
ctx
->
sha1
);
git_hash_sha1_ctx_cleanup
(
&
ctx
->
ctx
.
sha1
);
return
;
return
;
default:
default:
/* unreachable */
;
/* unreachable */
;
...
@@ -39,7 +39,7 @@ int git_hash_init(git_hash_ctx *ctx)
...
@@ -39,7 +39,7 @@ int git_hash_init(git_hash_ctx *ctx)
{
{
switch
(
ctx
->
algo
)
{
switch
(
ctx
->
algo
)
{
case
GIT_HASH_ALGO_SHA1
:
case
GIT_HASH_ALGO_SHA1
:
return
git_hash_sha1_init
(
&
ctx
->
sha1
);
return
git_hash_sha1_init
(
&
ctx
->
ctx
.
sha1
);
default:
default:
/* unreachable */
;
/* unreachable */
;
}
}
...
@@ -51,7 +51,7 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
...
@@ -51,7 +51,7 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
{
{
switch
(
ctx
->
algo
)
{
switch
(
ctx
->
algo
)
{
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
->
ctx
.
sha1
,
data
,
len
);
default:
default:
/* unreachable */
;
/* unreachable */
;
}
}
...
@@ -63,7 +63,7 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx)
...
@@ -63,7 +63,7 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx)
{
{
switch
(
ctx
->
algo
)
{
switch
(
ctx
->
algo
)
{
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
->
ctx
.
sha1
);
default:
default:
/* unreachable */
;
/* unreachable */
;
}
}
...
...
src/hash.h
View file @
40f3702c
...
@@ -27,7 +27,7 @@ typedef enum {
...
@@ -27,7 +27,7 @@ typedef enum {
typedef
struct
git_hash_ctx
{
typedef
struct
git_hash_ctx
{
union
{
union
{
git_hash_sha1_ctx
sha1
;
git_hash_sha1_ctx
sha1
;
};
}
ctx
;
git_hash_algo_t
algo
;
git_hash_algo_t
algo
;
}
git_hash_ctx
;
}
git_hash_ctx
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment