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
c7a195a1
Unverified
Commit
c7a195a1
authored
Aug 25, 2021
by
Edward Thomson
Committed by
GitHub
Aug 25, 2021
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #6006 from boretrk/c11-warnings
GCC C11 warnings
parents
efc4e7e5
4bbe5e6e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
15 deletions
+16
-15
CMakeLists.txt
+1
-0
src/win32/path_w32.c
+6
-6
src/win32/reparse.h
+4
-4
tests/core/link.c
+5
-5
No files found.
CMakeLists.txt
View file @
c7a195a1
...
@@ -235,6 +235,7 @@ ELSE ()
...
@@ -235,6 +235,7 @@ ELSE ()
enable_warnings
(
unused-function
)
enable_warnings
(
unused-function
)
enable_warnings
(
int-conversion
)
enable_warnings
(
int-conversion
)
enable_warnings
(
c11-extensions
)
enable_warnings
(
c11-extensions
)
enable_warnings
(
c99-c11-compat
)
# MinGW uses gcc, which expects POSIX formatting for printf, but
# MinGW uses gcc, which expects POSIX formatting for printf, but
# uses the Windows C library, which uses its own format specifiers.
# uses the Windows C library, which uses its own format specifiers.
...
...
src/win32/path_w32.c
View file @
c7a195a1
...
@@ -381,14 +381,14 @@ int git_win32_path_readlink_w(git_win32_path dest, const git_win32_path path)
...
@@ -381,14 +381,14 @@ int git_win32_path_readlink_w(git_win32_path dest, const git_win32_path path)
switch
(
reparse_buf
->
ReparseTag
)
{
switch
(
reparse_buf
->
ReparseTag
)
{
case
IO_REPARSE_TAG_SYMLINK
:
case
IO_REPARSE_TAG_SYMLINK
:
target
=
reparse_buf
->
SymbolicLinkReparseBuffer
.
PathBuffer
+
target
=
reparse_buf
->
ReparseBuffer
.
SymbolicLink
.
PathBuffer
+
(
reparse_buf
->
SymbolicLinkReparseBuffer
.
SubstituteNameOffset
/
sizeof
(
WCHAR
));
(
reparse_buf
->
ReparseBuffer
.
SymbolicLink
.
SubstituteNameOffset
/
sizeof
(
WCHAR
));
target_len
=
reparse_buf
->
SymbolicLinkReparseBuffer
.
SubstituteNameLength
/
sizeof
(
WCHAR
);
target_len
=
reparse_buf
->
ReparseBuffer
.
SymbolicLink
.
SubstituteNameLength
/
sizeof
(
WCHAR
);
break
;
break
;
case
IO_REPARSE_TAG_MOUNT_POINT
:
case
IO_REPARSE_TAG_MOUNT_POINT
:
target
=
reparse_buf
->
MountPointReparseBuffer
.
PathBuffer
+
target
=
reparse_buf
->
ReparseBuffer
.
MountPoint
.
PathBuffer
+
(
reparse_buf
->
MountPointReparseBuffer
.
SubstituteNameOffset
/
sizeof
(
WCHAR
));
(
reparse_buf
->
ReparseBuffer
.
MountPoint
.
SubstituteNameOffset
/
sizeof
(
WCHAR
));
target_len
=
reparse_buf
->
MountPointReparseBuffer
.
SubstituteNameLength
/
sizeof
(
WCHAR
);
target_len
=
reparse_buf
->
ReparseBuffer
.
MountPoint
.
SubstituteNameLength
/
sizeof
(
WCHAR
);
break
;
break
;
default
:
default
:
errno
=
EINVAL
;
errno
=
EINVAL
;
...
...
src/win32/reparse.h
View file @
c7a195a1
...
@@ -26,18 +26,18 @@ typedef struct _GIT_REPARSE_DATA_BUFFER {
...
@@ -26,18 +26,18 @@ typedef struct _GIT_REPARSE_DATA_BUFFER {
USHORT
PrintNameLength
;
USHORT
PrintNameLength
;
ULONG
Flags
;
ULONG
Flags
;
WCHAR
PathBuffer
[
1
];
WCHAR
PathBuffer
[
1
];
}
SymbolicLink
ReparseBuffer
;
}
SymbolicLink
;
struct
{
struct
{
USHORT
SubstituteNameOffset
;
USHORT
SubstituteNameOffset
;
USHORT
SubstituteNameLength
;
USHORT
SubstituteNameLength
;
USHORT
PrintNameOffset
;
USHORT
PrintNameOffset
;
USHORT
PrintNameLength
;
USHORT
PrintNameLength
;
WCHAR
PathBuffer
[
1
];
WCHAR
PathBuffer
[
1
];
}
MountPoint
ReparseBuffer
;
}
MountPoint
;
struct
{
struct
{
UCHAR
DataBuffer
[
1
];
UCHAR
DataBuffer
[
1
];
}
Generic
ReparseBuffer
;
}
Generic
;
};
}
ReparseBuffer
;
}
GIT_REPARSE_DATA_BUFFER
;
}
GIT_REPARSE_DATA_BUFFER
;
#define REPARSE_DATA_HEADER_SIZE 8
#define REPARSE_DATA_HEADER_SIZE 8
...
...
tests/core/link.c
View file @
c7a195a1
...
@@ -123,7 +123,7 @@ static void do_junction(const char *old, const char *new)
...
@@ -123,7 +123,7 @@ static void do_junction(const char *old, const char *new)
reparse_buf
=
LocalAlloc
(
LMEM_FIXED
|
LMEM_ZEROINIT
,
reparse_buflen
);
reparse_buf
=
LocalAlloc
(
LMEM_FIXED
|
LMEM_ZEROINIT
,
reparse_buflen
);
cl_assert
(
reparse_buf
);
cl_assert
(
reparse_buf
);
subst_utf16
=
reparse_buf
->
MountPointReparseBuffer
.
PathBuffer
;
subst_utf16
=
reparse_buf
->
ReparseBuffer
.
MountPoint
.
PathBuffer
;
print_utf16
=
subst_utf16
+
subst_utf16_len
+
1
;
print_utf16
=
subst_utf16
+
subst_utf16_len
+
1
;
ret
=
git__utf8_to_16
(
subst_utf16
,
subst_utf16_len
+
1
,
ret
=
git__utf8_to_16
(
subst_utf16
,
subst_utf16_len
+
1
,
...
@@ -135,10 +135,10 @@ static void do_junction(const char *old, const char *new)
...
@@ -135,10 +135,10 @@ static void do_junction(const char *old, const char *new)
cl_assert_equal_i
(
print_utf16_len
,
ret
);
cl_assert_equal_i
(
print_utf16_len
,
ret
);
reparse_buf
->
ReparseTag
=
IO_REPARSE_TAG_MOUNT_POINT
;
reparse_buf
->
ReparseTag
=
IO_REPARSE_TAG_MOUNT_POINT
;
reparse_buf
->
MountPointReparseBuffer
.
SubstituteNameOffset
=
0
;
reparse_buf
->
ReparseBuffer
.
MountPoint
.
SubstituteNameOffset
=
0
;
reparse_buf
->
MountPointReparseBuffer
.
SubstituteNameLength
=
subst_byte_len
;
reparse_buf
->
ReparseBuffer
.
MountPoint
.
SubstituteNameLength
=
subst_byte_len
;
reparse_buf
->
MountPointReparseBuffer
.
PrintNameOffset
=
(
USHORT
)(
subst_byte_len
+
sizeof
(
WCHAR
));
reparse_buf
->
ReparseBuffer
.
MountPoint
.
PrintNameOffset
=
(
USHORT
)(
subst_byte_len
+
sizeof
(
WCHAR
));
reparse_buf
->
MountPointReparseBuffer
.
PrintNameLength
=
print_byte_len
;
reparse_buf
->
ReparseBuffer
.
MountPoint
.
PrintNameLength
=
print_byte_len
;
reparse_buf
->
ReparseDataLength
=
reparse_buflen
-
REPARSE_DATA_HEADER_SIZE
;
reparse_buf
->
ReparseDataLength
=
reparse_buflen
-
REPARSE_DATA_HEADER_SIZE
;
cl_win32_pass
(
DeviceIoControl
(
handle
,
FSCTL_SET_REPARSE_POINT
,
cl_win32_pass
(
DeviceIoControl
(
handle
,
FSCTL_SET_REPARSE_POINT
,
...
...
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