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
090d5e1f
Commit
090d5e1f
authored
Jan 11, 2013
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MSVC compilation warnings
parent
4a0ac175
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
28 deletions
+28
-28
src/indexer.c
+1
-1
src/pack.c
+1
-1
src/transports/winhttp.c
+7
-7
tests-clar/clone/nonetwork.c
+1
-1
tests-clar/revwalk/mergebase.c
+18
-18
No files found.
src/indexer.c
View file @
090d5e1f
...
...
@@ -273,7 +273,7 @@ static int crc_object(uint32_t *crc_out, git_mwindow_file *mwf, git_off_t start,
if
(
ptr
==
NULL
)
return
-
1
;
len
=
min
(
left
,
(
size_
t
)
size
);
len
=
min
(
left
,
(
unsigned
in
t
)
size
);
crc
=
crc32
(
crc
,
ptr
,
len
);
size
-=
len
;
start
+=
len
;
...
...
src/pack.c
View file @
090d5e1f
...
...
@@ -621,7 +621,7 @@ ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t
return
GIT_EBUFS
;
obj
->
zstream
.
next_out
=
buffer
;
obj
->
zstream
.
avail_out
=
len
;
obj
->
zstream
.
avail_out
=
(
unsigned
int
)
len
;
obj
->
zstream
.
next_in
=
in
;
st
=
inflate
(
&
obj
->
zstream
,
Z_SYNC_FLUSH
);
...
...
src/transports/winhttp.c
View file @
090d5e1f
...
...
@@ -298,7 +298,7 @@ static int write_chunk(HINTERNET request, const char *buffer, size_t len)
return
-
1
;
if
(
!
WinHttpWriteData
(
request
,
git_buf_cstr
(
&
buf
),
git_buf_len
(
&
buf
),
git_buf_cstr
(
&
buf
),
(
DWORD
)
git_buf_len
(
&
buf
),
&
bytes_written
))
{
git_buf_free
(
&
buf
);
giterr_set
(
GITERR_OS
,
"Failed to write chunk header"
);
...
...
@@ -309,7 +309,7 @@ static int write_chunk(HINTERNET request, const char *buffer, size_t len)
/* Chunk body */
if
(
!
WinHttpWriteData
(
request
,
buffer
,
len
,
buffer
,
(
DWORD
)
len
,
&
bytes_written
))
{
giterr_set
(
GITERR_OS
,
"Failed to write chunk"
);
return
-
1
;
...
...
@@ -494,7 +494,7 @@ replay:
if
(
!
WinHttpReadData
(
s
->
request
,
(
LPVOID
)
buffer
,
buf_size
,
(
DWORD
)
buf_size
,
&
dw_bytes_read
))
{
giterr_set
(
GITERR_OS
,
"Failed to read data"
);
...
...
@@ -580,7 +580,7 @@ static int put_uuid_string(LPWSTR buffer, DWORD buffer_len_cch)
static
int
get_temp_file
(
LPWSTR
buffer
,
DWORD
buffer_len_cch
)
{
in
t
len
;
size_
t
len
;
if
(
!
GetTempPathW
(
buffer_len_cch
,
buffer
))
{
giterr_set
(
GITERR_OS
,
"Failed to get temp path"
);
...
...
@@ -639,7 +639,7 @@ static int winhttp_stream_write_buffered(
}
}
if
(
!
WriteFile
(
s
->
post_body
,
buffer
,
len
,
&
bytes_written
,
NULL
))
{
if
(
!
WriteFile
(
s
->
post_body
,
buffer
,
(
DWORD
)
len
,
&
bytes_written
,
NULL
))
{
giterr_set
(
GITERR_OS
,
"Failed to write to temporary file"
);
return
-
1
;
}
...
...
@@ -697,7 +697,7 @@ static int winhttp_stream_write_chunked(
}
else
{
/* Append as much to the buffer as we can */
int
count
=
min
(
CACHED_POST_BODY_BUF_SIZE
-
s
->
chunk_buffer_len
,
len
);
int
count
=
min
(
CACHED_POST_BODY_BUF_SIZE
-
s
->
chunk_buffer_len
,
(
int
)
len
);
if
(
!
s
->
chunk_buffer
)
s
->
chunk_buffer
=
git__malloc
(
CACHED_POST_BODY_BUF_SIZE
);
...
...
@@ -717,7 +717,7 @@ static int winhttp_stream_write_chunked(
/* Is there any remaining data from the source? */
if
(
len
>
0
)
{
memcpy
(
s
->
chunk_buffer
,
buffer
,
len
);
s
->
chunk_buffer_len
=
len
;
s
->
chunk_buffer_len
=
(
unsigned
int
)
len
;
}
}
}
...
...
tests-clar/clone/nonetwork.c
View file @
090d5e1f
...
...
@@ -143,7 +143,7 @@ void test_clone_nonetwork__custom_autotag(void)
cl_git_pass
(
git_clone
(
&
g_repo
,
cl_git_fixture_url
(
"testrepo.git"
),
"./foo"
,
&
g_options
));
cl_git_pass
(
git_tag_list
(
&
tags
,
g_repo
));
cl_assert_equal_
i
(
0
,
tags
.
count
);
cl_assert_equal_
sz
(
0
,
tags
.
count
);
git_strarray_free
(
&
tags
);
}
...
...
tests-clar/revwalk/mergebase.c
View file @
090d5e1f
...
...
@@ -33,12 +33,12 @@ void test_revwalk_mergebase__single1(void)
cl_assert
(
git_oid_cmp
(
&
result
,
&
expected
)
==
0
);
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo
,
&
one
,
&
two
));
cl_assert_equal_
i
(
ahead
,
2
);
cl_assert_equal_
i
(
behind
,
1
);
cl_assert_equal_
sz
(
ahead
,
2
);
cl_assert_equal_
sz
(
behind
,
1
);
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo
,
&
two
,
&
one
));
cl_assert_equal_
i
(
ahead
,
1
);
cl_assert_equal_
i
(
behind
,
2
);
cl_assert_equal_
sz
(
ahead
,
1
);
cl_assert_equal_
sz
(
behind
,
2
);
}
void
test_revwalk_mergebase__single2
(
void
)
...
...
@@ -54,12 +54,12 @@ void test_revwalk_mergebase__single2(void)
cl_assert
(
git_oid_cmp
(
&
result
,
&
expected
)
==
0
);
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo
,
&
one
,
&
two
));
cl_assert_equal_
i
(
ahead
,
4
);
cl_assert_equal_
i
(
behind
,
1
);
cl_assert_equal_
sz
(
ahead
,
4
);
cl_assert_equal_
sz
(
behind
,
1
);
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo
,
&
two
,
&
one
));
cl_assert_equal_
i
(
ahead
,
1
);
cl_assert_equal_
i
(
behind
,
4
);
cl_assert_equal_
sz
(
ahead
,
1
);
cl_assert_equal_
sz
(
behind
,
4
);
}
void
test_revwalk_mergebase__merged_branch
(
void
)
...
...
@@ -78,12 +78,12 @@ void test_revwalk_mergebase__merged_branch(void)
cl_assert
(
git_oid_cmp
(
&
result
,
&
expected
)
==
0
);
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo
,
&
one
,
&
two
));
cl_assert_equal_
i
(
ahead
,
0
);
cl_assert_equal_
i
(
behind
,
3
);
cl_assert_equal_
sz
(
ahead
,
0
);
cl_assert_equal_
sz
(
behind
,
3
);
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo
,
&
two
,
&
one
));
cl_assert_equal_
i
(
ahead
,
3
);
cl_assert_equal_
i
(
behind
,
0
);
cl_assert_equal_
sz
(
ahead
,
3
);
cl_assert_equal_
sz
(
behind
,
0
);
}
void
test_revwalk_mergebase__two_way_merge
(
void
)
...
...
@@ -95,13 +95,13 @@ void test_revwalk_mergebase__two_way_merge(void)
cl_git_pass
(
git_oid_fromstr
(
&
two
,
"a953a018c5b10b20c86e69fef55ebc8ad4c5a417"
));
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo2
,
&
one
,
&
two
));
cl_assert_equal_
i
(
ahead
,
2
);
cl_assert_equal_
i
(
behind
,
8
);
cl_assert_equal_
sz
(
ahead
,
2
);
cl_assert_equal_
sz
(
behind
,
8
);
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo2
,
&
two
,
&
one
));
cl_assert_equal_
i
(
ahead
,
8
);
cl_assert_equal_
i
(
behind
,
2
);
cl_assert_equal_
sz
(
ahead
,
8
);
cl_assert_equal_
sz
(
behind
,
2
);
}
void
test_revwalk_mergebase__no_common_ancestor_returns_ENOTFOUND
(
void
)
...
...
@@ -119,8 +119,8 @@ void test_revwalk_mergebase__no_common_ancestor_returns_ENOTFOUND(void)
cl_assert_equal_i
(
GIT_ENOTFOUND
,
error
);
cl_git_pass
(
git_graph_ahead_behind
(
&
ahead
,
&
behind
,
_repo
,
&
one
,
&
two
));
cl_assert_equal_
i
(
2
,
ahead
);
cl_assert_equal_
i
(
4
,
behind
);
cl_assert_equal_
sz
(
2
,
ahead
);
cl_assert_equal_
sz
(
4
,
behind
);
}
void
test_revwalk_mergebase__no_off_by_one_missing
(
void
)
...
...
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