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
c61300ed
Commit
c61300ed
authored
Jun 29, 2013
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1690 from nulltoken/fix/warnings
Fix Win32/64 compilation warnings & memory leak
parents
f2c41884
d90390c1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
10 additions
and
10 deletions
+10
-10
src/diff_tform.c
+1
-1
src/thread-utils.h
+1
-1
src/win32/findfile.c
+3
-5
tests-clar/checkout/index.c
+2
-0
tests-clar/clar/sandbox.h
+1
-1
tests-clar/diff/rename.c
+1
-1
tests-clar/merge/trees/automerge.c
+1
-1
No files found.
src/diff_tform.c
View file @
c61300ed
...
...
@@ -900,7 +900,7 @@ find_best_matches:
}
/* otherwise, if we just overwrote a source, update mapping */
else
if
(
j
>
i
&&
match_srcs
[
i
].
similarity
>
0
)
{
match_tgts
[
match_srcs
[
i
].
idx
].
idx
=
j
;
match_tgts
[
match_srcs
[
i
].
idx
].
idx
=
(
uint32_t
)
j
;
}
num_updates
++
;
...
...
src/thread-utils.h
View file @
c61300ed
...
...
@@ -104,7 +104,7 @@ GIT_INLINE(void *) git___compare_and_swap(
{
volatile
void
*
foundval
;
#if defined(GIT_WIN32)
foundval
=
InterlockedCompareExchangePointer
(
ptr
,
newval
,
oldval
);
foundval
=
InterlockedCompareExchangePointer
(
(
volatile
PVOID
*
)
ptr
,
newval
,
oldval
);
#elif defined(__GNUC__)
foundval
=
__sync_val_compare_and_swap
(
ptr
,
oldval
,
newval
);
#else
...
...
src/win32/findfile.c
View file @
c61300ed
...
...
@@ -156,7 +156,7 @@ static int win32_find_git_in_registry(
}
static
int
win32_find_existing_dirs
(
git_buf
*
out
,
const
wchar_t
*
tmpl
[]
,
char
*
temp
[]
)
git_buf
*
out
,
const
wchar_t
*
tmpl
[])
{
struct
git_win32__path
path16
;
git_buf
buf
=
GIT_BUF_INIT
;
...
...
@@ -209,7 +209,6 @@ int git_win32__find_system_dirs(git_buf *out)
int
git_win32__find_global_dirs
(
git_buf
*
out
)
{
char
*
temp
[
3
];
static
const
wchar_t
*
global_tmpls
[
4
]
=
{
L"%HOME%
\\
"
,
L"%HOMEDRIVE%%HOMEPATH%
\\
"
,
...
...
@@ -217,12 +216,11 @@ int git_win32__find_global_dirs(git_buf *out)
NULL
,
};
return
win32_find_existing_dirs
(
out
,
global_tmpls
,
temp
);
return
win32_find_existing_dirs
(
out
,
global_tmpls
);
}
int
git_win32__find_xdg_dirs
(
git_buf
*
out
)
{
char
*
temp
[
6
];
static
const
wchar_t
*
global_tmpls
[
7
]
=
{
L"%XDG_CONFIG_HOME%
\\
git"
,
L"%APPDATA%
\\
git"
,
...
...
@@ -233,5 +231,5 @@ int git_win32__find_xdg_dirs(git_buf *out)
NULL
,
};
return
win32_find_existing_dirs
(
out
,
global_tmpls
,
temp
);
return
win32_find_existing_dirs
(
out
,
global_tmpls
);
}
tests-clar/checkout/index.c
View file @
c61300ed
...
...
@@ -587,6 +587,8 @@ void test_checkout_index__target_directory_from_bare(void)
cl_git_pass
(
git_futils_rmdir_r
(
"alternative"
,
NULL
,
GIT_RMDIR_REMOVE_FILES
));
git_object_free
(
head
);
}
void
test_checkout_index__can_get_repo_from_index
(
void
)
...
...
tests-clar/clar/sandbox.h
View file @
c61300ed
...
...
@@ -45,7 +45,7 @@ find_tmp_path(char *buffer, size_t length)
#else
DWORD
env_len
;
if
((
env_len
=
GetEnvironmentVariable
(
"CLAR_TMP"
,
buffer
,
length
))
>
0
&&
if
((
env_len
=
GetEnvironmentVariable
(
"CLAR_TMP"
,
buffer
,
(
DWORD
)
length
))
>
0
&&
env_len
<
length
)
return
0
;
...
...
tests-clar/diff/rename.c
View file @
c61300ed
...
...
@@ -516,7 +516,7 @@ void test_diff_rename__working_directory_changes(void)
cl_git_pass
(
git_oid_fromstr
(
&
id
,
blobsha
));
cl_git_pass
(
git_blob_lookup
(
&
blob
,
g_repo
,
&
id
));
cl_git_pass
(
git_buf_set
(
&
content
,
git_blob_rawcontent
(
blob
),
git_blob_rawsize
(
blob
)));
&
content
,
git_blob_rawcontent
(
blob
),
(
size_t
)
git_blob_rawsize
(
blob
)));
cl_git_rewritefile
(
"renames/songof7cities.txt"
,
content
.
ptr
);
git_blob_free
(
blob
);
...
...
tests-clar/merge/trees/automerge.c
View file @
c61300ed
...
...
@@ -122,7 +122,7 @@ void test_merge_trees_automerge__automerge(void)
cl_assert
(
entry
->
file_size
==
strlen
(
AUTOMERGEABLE_MERGED_FILE
));
cl_git_pass
(
git_object_lookup
((
git_object
**
)
&
blob
,
repo
,
&
entry
->
oid
,
GIT_OBJ_BLOB
));
cl_assert
(
memcmp
(
git_blob_rawcontent
(
blob
),
AUTOMERGEABLE_MERGED_FILE
,
entry
->
file_size
)
==
0
);
cl_assert
(
memcmp
(
git_blob_rawcontent
(
blob
),
AUTOMERGEABLE_MERGED_FILE
,
(
size_t
)
entry
->
file_size
)
==
0
);
git_index_free
(
index
);
git_blob_free
(
blob
);
...
...
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