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
1c3fac4d
Commit
1c3fac4d
authored
Sep 08, 2011
by
Sebastian Schuberth
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add casts to get rid of some warnings when filling zlib structures
parent
353560b4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
src/filebuf.c
+4
-4
src/odb_loose.c
+5
-5
src/pack.c
+1
-1
No files found.
src/filebuf.c
View file @
1c3fac4d
...
...
@@ -117,18 +117,18 @@ static int write_deflate(git_filebuf *file, void *source, size_t len)
if
(
len
>
0
||
file
->
flush_mode
==
Z_FINISH
)
{
zs
->
next_in
=
source
;
zs
->
avail_in
=
len
;
zs
->
avail_in
=
(
uInt
)
len
;
do
{
in
t
have
;
size_
t
have
;
zs
->
next_out
=
file
->
z_buf
;
zs
->
avail_out
=
file
->
buf_size
;
zs
->
avail_out
=
(
uInt
)
file
->
buf_size
;
result
=
deflate
(
zs
,
file
->
flush_mode
);
assert
(
result
!=
Z_STREAM_ERROR
);
have
=
file
->
buf_size
-
zs
->
avail_out
;
have
=
file
->
buf_size
-
(
size_t
)
zs
->
avail_out
;
if
(
p_write
(
file
->
fd
,
file
->
z_buf
,
have
)
<
GIT_SUCCESS
)
return
git__throw
(
GIT_EOSERR
,
"Failed to write to file"
);
...
...
src/odb_loose.c
View file @
1c3fac4d
...
...
@@ -183,19 +183,19 @@ static void init_stream(z_stream *s, void *out, size_t len)
{
memset
(
s
,
0
,
sizeof
(
*
s
));
s
->
next_out
=
out
;
s
->
avail_out
=
len
;
s
->
avail_out
=
(
uInt
)
len
;
}
static
void
set_stream_input
(
z_stream
*
s
,
void
*
in
,
size_t
len
)
{
s
->
next_in
=
in
;
s
->
avail_in
=
len
;
s
->
avail_in
=
(
uInt
)
len
;
}
static
void
set_stream_output
(
z_stream
*
s
,
void
*
out
,
size_t
len
)
{
s
->
next_out
=
out
;
s
->
avail_out
=
len
;
s
->
avail_out
=
(
uInt
)
len
;
}
...
...
@@ -243,10 +243,10 @@ static int inflate_buffer(void *in, size_t inlen, void *out, size_t outlen)
memset
(
&
zs
,
0x0
,
sizeof
(
zs
));
zs
.
next_out
=
out
;
zs
.
avail_out
=
outlen
;
zs
.
avail_out
=
(
uInt
)
outlen
;
zs
.
next_in
=
in
;
zs
.
avail_in
=
inlen
;
zs
.
avail_in
=
(
uInt
)
inlen
;
if
(
inflateInit
(
&
zs
)
<
Z_OK
)
return
git__throw
(
GIT_ERROR
,
"Failed to inflate buffer"
);
...
...
src/pack.c
View file @
1c3fac4d
...
...
@@ -404,7 +404,7 @@ int packfile_unpack_compressed(
memset
(
&
stream
,
0
,
sizeof
(
stream
));
stream
.
next_out
=
buffer
;
stream
.
avail_out
=
size
+
1
;
stream
.
avail_out
=
(
uInt
)
size
+
1
;
st
=
inflateInit
(
&
stream
);
if
(
st
!=
Z_OK
)
{
...
...
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