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
aad5403f
Commit
aad5403f
authored
Nov 05, 2013
by
Ben Straub
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix MSVC 64-bit warnings
parent
a6993f24
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
src/blame.c
+9
-9
src/blame_git.c
+1
-1
No files found.
src/blame.c
View file @
aad5403f
...
...
@@ -20,7 +20,7 @@
static
int
hunk_byfinalline_search_cmp
(
const
void
*
key
,
const
void
*
entry
)
{
uint
32_t
lineno
=
*
(
size_t
*
)
key
;
uint
16_t
lineno
=
(
uint16_t
)
*
(
size_t
*
)
key
;
git_blame_hunk
*
hunk
=
(
git_blame_hunk
*
)
entry
;
if
(
lineno
<
hunk
->
final_start_line_number
)
...
...
@@ -145,7 +145,7 @@ void git_blame_free(git_blame *blame)
uint32_t
git_blame_get_hunk_count
(
git_blame
*
blame
)
{
assert
(
blame
);
return
blame
->
hunks
.
length
;
return
(
uint32_t
)
blame
->
hunks
.
length
;
}
const
git_blame_hunk
*
git_blame_get_hunk_byindex
(
git_blame
*
blame
,
uint32_t
index
)
...
...
@@ -160,7 +160,7 @@ const git_blame_hunk *git_blame_get_hunk_byline(git_blame *blame, uint32_t linen
assert
(
blame
);
if
(
!
git_vector_bsearch2
(
&
i
,
&
blame
->
hunks
,
hunk_byfinalline_search_cmp
,
&
lineno
))
{
return
git_blame_get_hunk_byindex
(
blame
,
i
);
return
git_blame_get_hunk_byindex
(
blame
,
(
uint32_t
)
i
);
}
return
NULL
;
...
...
@@ -211,13 +211,13 @@ static git_blame_hunk *split_hunk_in_vector(
}
new_line_count
=
hunk
->
lines_in_hunk
-
rel_line
;
nh
=
new_hunk
(
hunk
->
final_start_line_number
+
rel_line
,
new_line_count
,
hunk
->
orig_start_line_number
+
rel_line
,
hunk
->
orig_path
);
nh
=
new_hunk
(
(
uint16_t
)(
hunk
->
final_start_line_number
+
rel_line
),
(
uint16_t
)
new_line_count
,
(
uint16_t
)(
hunk
->
orig_start_line_number
+
rel_line
)
,
hunk
->
orig_path
);
git_oid_cpy
(
&
nh
->
final_commit_id
,
&
hunk
->
final_commit_id
);
git_oid_cpy
(
&
nh
->
orig_commit_id
,
&
hunk
->
orig_commit_id
);
/* Adjust hunk that was split */
hunk
->
lines_in_hunk
-=
new_line_count
;
hunk
->
lines_in_hunk
-=
(
uint16_t
)
new_line_count
;
git_vector_insert_sorted
(
vec
,
nh
,
NULL
);
{
git_blame_hunk
*
ret
=
return_new
?
nh
:
hunk
;
...
...
@@ -374,7 +374,7 @@ static int buffer_hunk_cb(
void
*
payload
)
{
git_blame
*
blame
=
(
git_blame
*
)
payload
;
size
_t
wedge_line
;
uint32
_t
wedge_line
;
GIT_UNUSED
(
delta
);
...
...
@@ -420,7 +420,7 @@ static int buffer_line_cb(
}
else
{
/* Create a new buffer-blame hunk with this line */
shift_hunks_by
(
&
blame
->
hunks
,
blame
->
current_diff_line
,
1
);
blame
->
current_hunk
=
new_hunk
(
blame
->
current_diff_line
,
1
,
0
,
blame
->
path
);
blame
->
current_hunk
=
new_hunk
(
(
uint16_t
)
blame
->
current_diff_line
,
1
,
0
,
blame
->
path
);
git_vector_insert_sorted
(
&
blame
->
hunks
,
blame
->
current_hunk
,
NULL
);
}
blame
->
current_diff_line
++
;
...
...
@@ -436,7 +436,7 @@ static int buffer_line_cb(
if
(
!
git_vector_search2
(
&
i
,
&
blame
->
hunks
,
ptrs_equal_cmp
,
blame
->
current_hunk
))
{
git_vector_remove
(
&
blame
->
hunks
,
i
);
free_hunk
(
blame
->
current_hunk
);
blame
->
current_hunk
=
(
git_blame_hunk
*
)
git_blame_get_hunk_byindex
(
blame
,
i
);
blame
->
current_hunk
=
(
git_blame_hunk
*
)
git_blame_get_hunk_byindex
(
blame
,
(
uint32_t
)
i
);
}
}
shift_hunks_by
(
&
blame
->
hunks
,
shift_base
,
-
1
);
...
...
src/blame_git.c
View file @
aad5403f
...
...
@@ -324,7 +324,7 @@ static void trim_common_tail(mmfile_t *a, mmfile_t *b, long ctx)
long
trimmed
=
0
,
recovered
=
0
;
char
*
ap
=
a
->
ptr
+
a
->
size
;
char
*
bp
=
b
->
ptr
+
b
->
size
;
long
smaller
=
(
a
->
size
<
b
->
size
)
?
a
->
size
:
b
->
size
;
long
smaller
=
(
long
)((
a
->
size
<
b
->
size
)
?
a
->
size
:
b
->
size
)
;
if
(
ctx
)
return
;
...
...
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