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
f2bb894e
Commit
f2bb894e
authored
Jun 15, 2011
by
Vicent Martí
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #251 from nulltoken/fix/msvc-warnings
Fix compilation warnings in MSVC
parents
1aa1b09e
63fadf99
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
5 deletions
+9
-5
src/fileops.c
+3
-2
src/msvc-compat.h
+1
-1
tests/t00-core.c
+4
-1
tests/t09-tree.c
+1
-1
No files found.
src/fileops.c
View file @
f2bb894e
...
...
@@ -633,7 +633,7 @@ static int do_lstat(const char *file_name, struct stat *buf)
buf
->
st_gid
=
0
;
buf
->
st_uid
=
0
;
buf
->
st_nlink
=
1
;
buf
->
st_mode
=
fMode
;
buf
->
st_mode
=
(
mode_t
)
fMode
;
buf
->
st_size
=
fdata
.
nFileSizeLow
;
/* Can't use nFileSizeHigh, since it's not a stat64 */
buf
->
st_dev
=
buf
->
st_rdev
=
(
_getdrive
()
-
1
);
buf
->
st_atime
=
filetime_to_time_t
(
&
(
fdata
.
ftLastAccessTime
));
...
...
@@ -686,6 +686,7 @@ int gitfo_lstat__w32(const char *file_name, struct stat *buf)
alt_name
[
namelen
]
=
0
;
return
do_lstat
(
alt_name
,
buf
);
}
int
gitfo_readlink__w32
(
const
char
*
link
,
char
*
target
,
size_t
target_len
)
{
HANDLE
hFile
;
...
...
@@ -711,7 +712,7 @@ int gitfo_readlink__w32(const char *link, char *target, size_t target_len)
if
(
dwRet
>
4
)
{
/* Skip first 4 characters if they are "\\?\" */
if
(
target
[
0
]
==
'\\'
&&
target
[
1
]
==
'\\'
&&
target
[
2
]
==
'?'
&&
target
[
3
]
==
'\\'
)
{
char
tmp
[
MAXPATHLEN
];
char
tmp
[
GIT_PATH_MAX
];
unsigned
int
offset
=
4
;
dwRet
-=
4
;
...
...
src/msvc-compat.h
View file @
f2bb894e
...
...
@@ -21,7 +21,7 @@
# define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)
# define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
# define
MAXPATHLEN MAX_PATH
# define
mode_t unsigned short
/* case-insensitive string comparison */
# define strcasecmp _stricmp
...
...
tests/t00-core.c
View file @
f2bb894e
...
...
@@ -664,9 +664,12 @@ END_TEST
BEGIN_TEST
(
filebuf0
,
"make sure git_filebuf_open doesn't delete an existing lock"
)
git_filebuf
file
;
int
fd
;
char
test
[]
=
"test"
,
testlock
[]
=
"test.lock"
;
must_pass
(
gitfo_creat
(
testlock
,
0744
));
fd
=
gitfo_creat
(
testlock
,
0744
);
must_pass
(
fd
);
must_pass
(
gitfo_close
(
fd
));
must_fail
(
git_filebuf_open
(
&
file
,
test
,
0
));
must_pass
(
gitfo_exists
(
testlock
));
must_pass
(
gitfo_unlink
(
testlock
));
...
...
tests/t09-tree.c
View file @
f2bb894e
...
...
@@ -81,7 +81,7 @@ BEGIN_TEST(read0, "acces randomly the entries on a loaded tree")
must_be_true
(
git_tree_entry_byindex
(
tree
,
0
)
!=
NULL
);
must_be_true
(
git_tree_entry_byindex
(
tree
,
2
)
!=
NULL
);
must_be_true
(
git_tree_entry_byindex
(
tree
,
3
)
==
NULL
);
must_be_true
(
git_tree_entry_byindex
(
tree
,
-
1
)
==
NULL
);
must_be_true
(
git_tree_entry_byindex
(
tree
,
(
unsigned
int
)
-
1
)
==
NULL
);
git_tree_close
(
tree
);
git_repository_free
(
repo
);
...
...
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